]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-deref-ptr.rs
Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
[rust.git] / tests / ui / consts / const-deref-ptr.rs
1 // Check that you can't dereference invalid raw pointers in constants.
2
3 fn main() {
4     static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
5     //~^ ERROR could not evaluate static initializer
6     println!("{}", C);
7 }