File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
src/test/ui/consts/miri_unleashed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 11// compile-flags: -Zunleash-the-miri-inside-of-you
2- #![ allow ( const_err) ]
2+ #![ warn ( const_err) ]
33
44// A test demonstrating that we prevent calling non-const fn during CTFE.
55
66fn foo ( ) { }
77
88const C : ( ) = foo ( ) ; //~ WARN: skipping const checks
9+ //~^ WARN any use of this value will cause an error
910
1011fn main ( ) {
1112 println ! ( "{:?}" , C ) ; //~ ERROR: evaluation of constant expression failed
Original file line number Diff line number Diff line change @@ -4,8 +4,22 @@ warning: skipping const checks
44LL | const C: () = foo();
55 | ^^^^^
66
7+ warning: any use of this value will cause an error
8+ --> $DIR/non_const_fn.rs:8:15
9+ |
10+ LL | const C: () = foo();
11+ | --------------^^^^^-
12+ | |
13+ | calling non-const function `foo`
14+ |
15+ note: lint level defined here
16+ --> $DIR/non_const_fn.rs:2:9
17+ |
18+ LL | #![warn(const_err)]
19+ | ^^^^^^^^^
20+
721error[E0080]: evaluation of constant expression failed
8- --> $DIR/non_const_fn.rs:11 :22
22+ --> $DIR/non_const_fn.rs:12 :22
923 |
1024LL | println!("{:?}", C);
1125 | ^ referenced constant has errors
You can’t perform that action at this time.
0 commit comments