File tree 2 files changed +17
-2
lines changed
src/test/ui/consts/miri_unleashed
2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
// compile-flags: -Zunleash-the-miri-inside-of-you
2
- #![ allow ( const_err) ]
2
+ #![ warn ( const_err) ]
3
3
4
4
// A test demonstrating that we prevent calling non-const fn during CTFE.
5
5
6
6
fn foo ( ) { }
7
7
8
8
const C : ( ) = foo ( ) ; //~ WARN: skipping const checks
9
+ //~^ WARN any use of this value will cause an error
9
10
10
11
fn main ( ) {
11
12
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
4
4
LL | const C: () = foo();
5
5
| ^^^^^
6
6
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
+
7
21
error[E0080]: evaluation of constant expression failed
8
- --> $DIR/non_const_fn.rs:11 :22
22
+ --> $DIR/non_const_fn.rs:12 :22
9
23
|
10
24
LL | println!("{:?}", C);
11
25
| ^ referenced constant has errors
You can’t perform that action at this time.
0 commit comments