summaryrefslogtreecommitdiffstats
path: root/tests/ui/static/safe-extern-statics.rs
blob: 0aa90c442ea75141f6318d310988a5ca5677876e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// aux-build:extern-statics.rs
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck

extern crate extern_statics;
use extern_statics::*;

extern "C" {
    static A: u8;
}

fn main() {
    let a = A; //~ ERROR use of extern static is unsafe
    let ra = &A; //~ ERROR use of extern static is unsafe
    let xa = XA; //~ ERROR use of extern static is unsafe
    let xra = &XA; //~ ERROR use of extern static is unsafe
}