about summary refs log tree commit diff
path: root/tests/ui/consts/write-to-static-mut-in-static.rs
blob: 016bfb06ccfc762ff975a13d4118ab909430b43f (plain)
1
2
3
4
5
6
7
8
9
10
11
pub static mut A: u32 = 0;
pub static mut B: () = unsafe { A = 1; };
//~^ ERROR modifying a static's initial value

pub static mut C: u32 = unsafe { C = 1; 0 };
//~^ ERROR static that tried to access itself during initialization

pub static D: u32 = D;
//~^ ERROR static that tried to access itself during initialization

fn main() {}