summary refs log tree commit diff
path: root/tests/ui/mir/null/borrowed_null.rs
blob: fefac3a7212c98969f77e5dd15a58d0b2a9064cc (plain)
1
2
3
4
5
6
7
8
//@ run-fail
//@ 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 };
}