]> git.lizzy.rs Git - rust.git/blob - tests/compile-fail/null_pointer_write.rs
f8dca6882c2d5e0f854107b431cc561ad1ad6d3b
[rust.git] / tests / compile-fail / null_pointer_write.rs
1 #[allow(deref_nullptr)]
2 fn main() {
3     unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR null pointer is not a valid pointer
4 }