mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-02 21:17:39 +00:00
9 lines
203 B
Rust
9 lines
203 B
Rust
//@ 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 };
|
|
}
|