]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/assign-to-static-within-other-static.rs
Merge commit '1411a98352ba6bee8ba3b0131c9243e5db1e6a2e' into sync_cg_clif-2021-12-31
[rust.git] / src / test / ui / consts / const-eval / assign-to-static-within-other-static.rs
1 // New test for #53818: modifying static memory at compile-time is not allowed.
2 // The test should never compile successfully
3
4 use std::cell::UnsafeCell;
5
6 static mut FOO: u32 = 42;
7 static BOO: () = unsafe {
8     FOO = 5;
9     //~^ could not evaluate static initializer [E0080]
10 };
11
12 fn main() {}