Files
rust/tests/ui/consts/const-eval/assign-to-static-within-other-static.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
287 B
Rust
Raw Normal View History

2018-11-19 11:19:14 +01:00
// New test for #53818: modifying static memory at compile-time is not allowed.
// The test should never compile successfully
use std::cell::UnsafeCell;
static mut FOO: u32 = 42;
static BOO: () = unsafe {
FOO = 5;
//~^ ERROR modifying a static's initial value
2018-11-19 11:19:14 +01:00
};
fn main() {}