]> git.lizzy.rs Git - rust.git/blob - src/test/ui/safe-extern-statics.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / safe-extern-statics.rs
1 // aux-build:extern-statics.rs
2
3 #![allow(unused)]
4
5 extern crate extern_statics;
6 use extern_statics::*;
7
8 extern {
9     static A: u8;
10 }
11
12 fn main() {
13     let a = A; //~ ERROR use of extern static is unsafe
14                //~^ WARN this was previously accepted by the compiler
15     let ra = &A; //~ ERROR use of extern static is unsafe
16                  //~^ WARN this was previously accepted by the compiler
17     let xa = XA; //~ ERROR use of extern static is unsafe
18                  //~^ WARN this was previously accepted by the compiler
19     let xra = &XA; //~ ERROR use of extern static is unsafe
20                    //~^ WARN this was previously accepted by the compiler
21 }