rust/tests/ui/static/safe-extern-statics-mut.rs
Matthew Jasper 982b49494e Remove revisions for THIR unsafeck
This is to make the diff when stabilizing it easier to review.
2024-01-05 09:30:27 +00:00

16 lines
373 B
Rust

// aux-build:extern-statics.rs
extern crate extern_statics;
use extern_statics::*;
extern "C" {
static mut B: u8;
}
fn main() {
let b = B; //~ ERROR use of mutable static is unsafe
let rb = &B; //~ ERROR use of mutable static is unsafe
let xb = XB; //~ ERROR use of mutable static is unsafe
let xrb = &XB; //~ ERROR use of mutable static is unsafe
}