2021-10-05 03:55:57 -05:00
|
|
|
const REG_ADDR: *mut u8 = 0x5f3759df as *mut u8;
|
2016-08-15 06:58:28 -05:00
|
|
|
|
2018-07-02 12:00:07 -05:00
|
|
|
const VALUE: u8 = unsafe { *REG_ADDR };
|
2021-10-05 03:55:57 -05:00
|
|
|
//~^ ERROR dereferencing raw mutable pointers in constants is unstable
|
2016-08-15 06:58:28 -05:00
|
|
|
|
2020-12-19 13:25:27 -06:00
|
|
|
const unsafe fn unreachable() -> ! {
|
|
|
|
use std::convert::Infallible;
|
|
|
|
|
2021-10-05 03:55:57 -05:00
|
|
|
const INFALLIBLE: *mut Infallible = &[] as *const [Infallible] as *const _ as _;
|
2020-12-19 13:25:27 -06:00
|
|
|
match *INFALLIBLE {}
|
2021-10-05 03:55:57 -05:00
|
|
|
//~^ ERROR dereferencing raw mutable pointers in constant functions is unstable
|
2020-12-19 13:25:27 -06:00
|
|
|
|
|
|
|
const BAD: () = unsafe { match *INFALLIBLE {} };
|
2021-10-05 03:55:57 -05:00
|
|
|
//~^ ERROR dereferencing raw mutable pointers in constants is unstable
|
2020-12-19 13:25:27 -06:00
|
|
|
}
|
|
|
|
|
2016-08-15 06:58:28 -05:00
|
|
|
fn main() {
|
|
|
|
}
|