blob: 238d350d1bdaf0f93227a81257ff40324954357e (
plain)
1
2
3
4
5
6
7
8
9
10
|
//@ run-fail
//@ compile-flags: -C debug-assertions
//@ error-pattern: null pointer dereference occurred
fn main() {
let ptr: *mut u32 = std::ptr::null_mut();
unsafe {
*(ptr) = 42;
}
}
|