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