]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/assign-to-static-within-other-static.rs
Stabilize File::options()
[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 #![feature(const_raw_ptr_deref)]
5
6 use std::cell::UnsafeCell;
7
8 static mut FOO: u32 = 42;
9 static BOO: () = unsafe {
10     FOO = 5;
11     //~^ could not evaluate static initializer [E0080]
12 };
13
14 fn main() {}