blob: 30e40bd8be13e09af4c077d963be8bfd34489317 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
// 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;
//~^ ERROR could not evaluate static initializer [E0080]
};
fn main() {}
|