]> git.lizzy.rs Git - rust.git/blob - tests/ui/consts/const-eval/assign-to-static-within-other-static.rs
Rollup merge of #104672 - Voultapher:unify-sort-modules, r=thomcc
[rust.git] / tests / 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() {}