]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/safe-extern-statics-mut.rs
Auto merge of #102717 - beetrees:repr128-c-style-debuginfo, r=nagisa
[rust.git] / src / test / ui / static / safe-extern-statics-mut.rs
1 // aux-build:extern-statics.rs
2 // revisions: mir thir
3 // [thir]compile-flags: -Z thir-unsafeck
4
5 extern crate extern_statics;
6 use extern_statics::*;
7
8 extern "C" {
9     static mut B: u8;
10 }
11
12 fn main() {
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
17 }