mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
6 lines
177 B
Rust
6 lines
177 B
Rust
#[allow(deref_nullptr)]
|
|
fn main() {
|
|
let x: i32 = unsafe { *std::ptr::null() }; //~ ERROR: null pointer is a dangling pointer
|
|
panic!("this should never print: {}", x);
|
|
}
|