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