2021-10-05 04:55:57 -04:00
|
|
|
// Check that you can't dereference invalid raw pointers in constants.
|
2015-05-28 00:35:56 +03:00
|
|
|
|
|
|
|
fn main() {
|
2018-07-02 19:00:07 +02:00
|
|
|
static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
|
2021-10-05 04:55:57 -04:00
|
|
|
//~^ ERROR could not evaluate static initializer
|
2015-05-28 00:35:56 +03:00
|
|
|
println!("{}", C);
|
|
|
|
}
|