rust/src/test/ui/safe-extern-statics.rs

16 lines
365 B
Rust
Raw Normal View History

// aux-build:extern-statics.rs
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
}