mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-03 05:27:36 +00:00
9 lines
201 B
Rust
9 lines
201 B
Rust
//@ run-fail
|
|
//@ compile-flags: -C debug-assertions
|
|
//@ error-pattern: null pointer dereference occurred
|
|
|
|
fn main() {
|
|
let ptr: *const () = std::ptr::null();
|
|
let _ptr: &() = unsafe { &*ptr };
|
|
}
|