mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-12 00:24:03 +00:00
13 lines
292 B
Rust
13 lines
292 B
Rust
// New test for #53818: modifying static memory at compile-time is not allowed.
|
|
// The test should never compile successfully
|
|
|
|
use std::cell::UnsafeCell;
|
|
|
|
static mut FOO: u32 = 42;
|
|
static BOO: () = unsafe {
|
|
FOO = 5;
|
|
//~^ could not evaluate static initializer [E0080]
|
|
};
|
|
|
|
fn main() {}
|