]> git.lizzy.rs Git - rust.git/blob - src/test/ui/static/safe-extern-statics.rs
Add 'src/tools/rust-analyzer/' from commit '977e12a0bdc3e329af179ef3a9d466af9eb613bb'
[rust.git] / src / test / ui / static / safe-extern-statics.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 A: u8;
10 }
11
12 fn main() {
13     let a = A; //~ ERROR use of extern static is unsafe
14     let ra = &A; //~ ERROR use of extern static is unsafe
15     let xa = XA; //~ ERROR use of extern static is unsafe
16     let xra = &XA; //~ ERROR use of extern static is unsafe
17 }