rust/tests/compile-fail/null_pointer_write.rs
2019-04-21 13:18:05 +02:00

4 lines
97 B
Rust

fn main() {
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR invalid use of NULL pointer
}