1 // gate-test-const_raw_ptr_deref
3 const REG_ADDR: *const u8 = 0x5f3759df as *const u8;
5 const VALUE: u8 = unsafe { *REG_ADDR };
6 //~^ ERROR dereferencing raw pointers in constants is unstable
8 const unsafe fn unreachable() -> ! {
9 use std::convert::Infallible;
11 const INFALLIBLE: *const Infallible = [].as_ptr();
13 //~^ ERROR dereferencing raw pointers in constant functions is unstable
15 const BAD: () = unsafe { match *INFALLIBLE {} };
16 //~^ ERROR dereferencing raw pointers in constants is unstable