rust/tests/ui/static/safe-extern-statics.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
429 B
Rust
Raw Normal View History

// aux-build:extern-statics.rs
// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
extern crate extern_statics;
use extern_statics::*;
2020-09-01 16:12:52 -05:00
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
}