about summary refs log tree commit diff
path: root/tests/ui/mir/null/borrowed_mut_null.rs
blob: a4660f4bf5734357c0ed59597cef57bc21318cab (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: *mut u32 = std::ptr::null_mut();
    let _ptr: &mut u32 = unsafe { &mut *ptr };
}