Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
consts
/
const-deref-ptr.rs
blob: 2607d4de22919d72046b0e99d24828cce9d3bc65 [
file
] [
log
] [
blame
] [
edit
]
// Check that you can't dereference invalid raw pointers in constants.
fn
main
()
{
static
C
:
u64
=
unsafe
{*(
0xdeadbeef
as
*
const
u64
)};
//~^ ERROR could not evaluate static initializer
//~| dangling pointer
println
!(
"{}"
,
C
);
}