about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/assign-to-static-within-other-static.rs
blob: 7a7a2566940113ef8b58e9cef61877e591a884ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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
};

fn main() {}