rust/tests/compile-fail/null_pointer_write.rs

4 lines
118 B
Rust
Raw Normal View History

fn main() {
2020-05-01 07:43:59 -05:00
unsafe { *std::ptr::null_mut() = 0i32 }; //~ ERROR inbounds test failed: 0x0 is not a valid pointer
}