2016-08-26 11:23:42 -05:00
|
|
|
// aux-build:extern-statics.rs
|
2021-05-16 17:29:54 -05:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
2016-08-26 11:23:42 -05:00
|
|
|
|
|
|
|
extern crate extern_statics;
|
|
|
|
use extern_statics::*;
|
|
|
|
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" {
|
2016-08-26 11:23:42 -05:00
|
|
|
static A: u8;
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2018-07-10 03:52:05 -05:00
|
|
|
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
|
2016-08-26 11:23:42 -05:00
|
|
|
}
|