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