Sign in
rust
/
miri
/
refs/heads/rustc_doublecheck
/
.
/
tests
/
fail
/
dangling_pointers
/
null_pointer_deref.rs
blob: dee05952a9936998ed1c68f8bca3275eac19ebf0 [
file
] [
log
] [
blame
] [
edit
]
#[
allow
(
deref_nullptr
)]
fn
main
()
{
let
x
:
i32
=
unsafe
{
*
std
::
ptr
::
null
()
};
//~ ERROR: null pointer
panic
!(
"this should never print: {}"
,
x
);
}