mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
7 lines
220 B
Rust
7 lines
220 B
Rust
// Check that you can't dereference invalid raw pointers in constants.
|
|
|
|
fn main() {
|
|
static C: u64 = unsafe {*(0xdeadbeef as *const u64)};
|
|
//~^ ERROR could not evaluate static initializer
|
|
println!("{}", C);
|
|
}
|