rust/tests/fail/dangling_pointers/null_pointer_write.rs
2022-07-05 18:16:20 -04:00

5 lines
128 B
Rust

#[allow(deref_nullptr)]
fn main() {
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR null pointer is a dangling pointer
}