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

7 lines
193 B
Rust

// compile-flags: -Zmiri-seed=0000000000000000
fn main() {
let x: i32 = unsafe { *std::ptr::null() }; //~ ERROR invalid use of NULL pointer
panic!("this should never print: {}", x);
}