2020-03-21 13:47:52 -05:00
|
|
|
// compile-flags: -Zunleash-the-miri-inside-of-you
|
|
|
|
|
|
|
|
// Make sure we cannot mutate globals.
|
|
|
|
|
|
|
|
static mut GLOBAL: i32 = 0;
|
|
|
|
|
2020-04-19 05:32:21 -05:00
|
|
|
static MUTATING_GLOBAL: () = {
|
2020-03-21 13:47:52 -05:00
|
|
|
unsafe {
|
2020-04-19 05:32:21 -05:00
|
|
|
GLOBAL = 99
|
|
|
|
//~^ ERROR could not evaluate static initializer
|
|
|
|
//~| NOTE modifying a static's initial value
|
2020-03-21 13:47:52 -05:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
fn main() {}
|