1 // New test for #53818: modifying static memory at compile-time is not allowed.
2 // The test should never compile successfully
4 #![feature(const_raw_ptr_deref, const_mut_refs)]
6 use std::cell::UnsafeCell;
8 struct Foo(UnsafeCell<u32>);
10 unsafe impl Send for Foo {}
11 unsafe impl Sync for Foo {}
13 static FOO: Foo = Foo(UnsafeCell::new(42));
15 static BAR: () = unsafe {
16 *FOO.0.get() = 5; //~ ERROR