]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/miri_unleashed/mutating_global.rs
Rollup merge of #84083 - ltratt:threadid_doc_tweak, r=dtolnay
[rust.git] / src / test / ui / consts / miri_unleashed / mutating_global.rs
1 // compile-flags: -Zunleash-the-miri-inside-of-you
2 #![allow(const_err)]
3
4 // Make sure we cannot mutate globals.
5
6 static mut GLOBAL: i32 = 0;
7
8 static MUTATING_GLOBAL: () = {
9     unsafe {
10         GLOBAL = 99
11         //~^ ERROR could not evaluate static initializer
12         //~| NOTE modifying a static's initial value
13     }
14 };
15
16 fn main() {}