File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
- // This should fail even without validation
2
- // compile-flags: -Zmiri-disable-validation
1
+ // This should fail even without validation, but some MIR opts mask the error
2
+ // compile-flags: -Zmiri-disable-validation -Zmir-opt-level=0
3
3
4
4
static mut LEAK : usize = 0 ;
5
5
Original file line number Diff line number Diff line change 1
1
#[ repr( u32 ) ]
2
+ #[ derive( Debug ) ]
2
3
enum Bool { True }
3
4
4
5
fn evil ( x : & mut Bool ) {
@@ -9,6 +10,7 @@ fn evil(x: &mut Bool) {
9
10
fn main ( ) {
10
11
let mut x = Bool :: True ;
11
12
evil ( & mut x) ;
12
- let _y = x; // reading this ought to be enough to trigger validation
13
+ let y = x; // reading this ought to be enough to trigger validation
13
14
//~^ ERROR encountered 0x0000002c at .<enum-tag>, but expected a valid enum tag
15
+ println ! ( "{:?}" , y) ; // make sure it is used (and not optimized away)
14
16
}
You can’t perform that action at this time.
0 commit comments