about summary refs log tree commit diff
path: root/tests/ui/mir/null/borrowed_null.rs
blob: 2a50058a48202f69d6476cf357db974eb362b5ed (plain)
1
2
3
4
5
6
7
8
//@ run-crash
//@ compile-flags: -C debug-assertions
//@ error-pattern: null pointer dereference occurred

fn main() {
    let ptr: *const u32 = std::ptr::null();
    let _ptr: &u32 = unsafe { &*ptr };
}