rust/tests/compile-fail/null_pointer_write.rs
2021-04-15 10:00:39 +02:00

5 lines
142 B
Rust

#[allow(deref_nullptr)]
fn main() {
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
}