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