summary refs log tree commit diff
path: root/src/test/ui/safe-extern-statics.rs
blob: eda309444681b630a5be382be2ca9f21468e2276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// aux-build:extern-statics.rs

#![allow(unused)]

extern crate extern_statics;
use extern_statics::*;

extern {
    static A: u8;
}

fn main() {
    let a = A; //~ ERROR use of extern static is unsafe
               //~^ WARN this was previously accepted by the compiler
    let ra = &A; //~ ERROR use of extern static is unsafe
                 //~^ WARN this was previously accepted by the compiler
    let xa = XA; //~ ERROR use of extern static is unsafe
                 //~^ WARN this was previously accepted by the compiler
    let xra = &XA; //~ ERROR use of extern static is unsafe
                   //~^ WARN this was previously accepted by the compiler
}