rust/tests/compile-fail/zst.rs
2016-09-22 15:47:16 +02:00

5 lines
146 B
Rust

fn main() {
let x = &() as *const () as *const i32;
let _ = unsafe { *x }; //~ ERROR: tried to access memory through an invalid pointer
}