]> git.proxmox.com Git - rustc.git/blame - tests/ui/static/safe-extern-statics-mut.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / static / safe-extern-statics-mut.rs
CommitLineData
9e0c209e 1// aux-build:extern-statics.rs
17df50a5
XL
2// revisions: mir thir
3// [thir]compile-flags: -Z thir-unsafeck
9e0c209e 4
9e0c209e
SL
5extern crate extern_statics;
6use extern_statics::*;
7
5869c6ff 8extern "C" {
9e0c209e
SL
9 static mut B: u8;
10}
11
12fn main() {
8faf50e0
XL
13 let b = B; //~ ERROR use of mutable static is unsafe
14 let rb = &B; //~ ERROR use of mutable static is unsafe
15 let xb = XB; //~ ERROR use of mutable static is unsafe
16 let xrb = &XB; //~ ERROR use of mutable static is unsafe
9e0c209e 17}