2018-11-19 04:19:14 -06:00
|
|
|
// New test for #53818: modifying static memory at compile-time is not allowed.
|
|
|
|
// The test should never compile successfully
|
|
|
|
|
|
|
|
use std::cell::UnsafeCell;
|
|
|
|
|
2018-11-19 06:49:07 -06:00
|
|
|
static mut FOO: u32 = 42;
|
|
|
|
static BOO: () = unsafe {
|
2019-11-12 06:20:44 -06:00
|
|
|
FOO = 5;
|
|
|
|
//~^ could not evaluate static initializer [E0080]
|
2018-11-19 04:19:14 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|