You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #110107 - cjgillot:const-prop-lint-junk, r=oli-obk
Ensure mir_drops_elaborated_and_const_checked when requiring codegen.
mir_drops_elaborated_and_const_checked may emit errors while codegen has started, and the compiler would exit leaving object code files around.
Found by `@cuviper` in #109731
Copy file name to clipboardExpand all lines: src/tools/miri/tests/fail/erroneous_const2.stderr
+14
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,20 @@ error[E0080]: evaluation of constant value failed
4
4
LL | const FOO: u32 = [X - Y, Y - X][(X < Y) as usize];
5
5
| ^^^^^ attempt to compute `5_u32 - 6_u32`, which would overflow
6
6
7
+
note: erroneous constant used
8
+
--> $DIR/erroneous_const2.rs:LL:CC
9
+
|
10
+
LL | println!("{}", FOO);
11
+
| ^^^
12
+
13
+
note: erroneous constant used
14
+
--> $DIR/erroneous_const2.rs:LL:CC
15
+
|
16
+
LL | println!("{}", FOO);
17
+
| ^^^
18
+
|
19
+
= note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
20
+
7
21
error: aborting due to previous error
8
22
9
23
For more information about this error, try `rustc --explain E0080`.
0 commit comments