]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/assign-to-static-within-other-static.rs
Merge commit '35d9c6bf256968e1b40e0d554607928bdf9cebea' into sync_cg_clif-2022-02-23
[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() {}