Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1580046

Browse files
committed
Fix const_fn_mir
1 parent f797c92 commit 1580046

File tree

4 files changed

+11
-27
lines changed

4 files changed

+11
-27
lines changed

‎tests/run-make/const_fn_mir/dump.mir

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,3 @@ fn foo() -> i32 {
2424
return;
2525
}
2626
}
27-
28-
fn main() -> () {
29-
let mut _0: ();
30-
let _1: i32;
31-
32-
bb0: {
33-
_1 = foo() -> [return: bb1, unwind continue];
34-
}
35-
36-
bb1: {
37-
return;
38-
}
39-
}

‎tests/run-make/const_fn_mir/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// emit-mir
2+
//@ check-pass
3+
4+
#![crate_type = "lib"]
5+
6+
pub const fn foo() -> i32 {
7+
5 + 6
8+
}

‎tests/run-make/const_fn_mir/main.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎tests/run-make/const_fn_mir/rmake.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// The `needs-unwind -Cpanic=abort` gives a different MIR output.
2-
3-
//@ needs-unwind
1+
//! This test is supposed to check that --emit=mir emits both optimized_mir and mir_for_ctfe for a
2+
//! const fn.
43
54
use run_make_support::{diff, rustc};
65

76
fn main() {
8-
rustc().input("main.rs").emit("mir").output("dump-actual.mir").run();
7+
rustc().input("lib.rs").emit("mir").output("dump-actual.mir").run();
98
diff().expected_file("dump.mir").actual_file("dump-actual.mir").run();
109
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /