rust/tests/compile-fail/intptrcast_wild_pointer_deref.rs
2019-06-21 16:32:54 -05:00

8 lines
209 B
Rust

// compile-flags: -Zmiri-seed=0000000000000000
fn main() {
let p = 44 as *const i32;
let x = unsafe { *p }; //~ ERROR dangling pointer was dereferenced
panic!("this should never print: {}", x);
}