rust/tests/ui/consts/miri_unleashed/mutating_global.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
319 B
Rust
Raw Normal View History

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