]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/consts/miri_unleashed/ptr_arith.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 #![feature(core_intrinsics)]
5 // During CTFE, we prevent pointer comparison and pointer-to-int casts.
8 let x
= &0 as *const _
;
10 //~^ ERROR could not evaluate static initializer
11 //~| NOTE pointer arithmetic or comparison
14 static INT_PTR_ARITH
: () = unsafe {
15 let x
: usize = std
::mem
::transmute(&0);
17 //~^ ERROR could not evaluate static initializer
18 //~| NOTE cannot cast pointer to integer