rust/tests/ui/static/static-mut-foreign-requires-unsafe.rs
2023-01-11 09:32:08 +00:00

13 lines
238 B
Rust

// revisions: mir thir
// [thir]compile-flags: -Z thir-unsafeck
extern "C" {
static mut a: i32;
}
fn main() {
a += 3; //~ ERROR: requires unsafe
a = 4; //~ ERROR: requires unsafe
let _b = a; //~ ERROR: requires unsafe
}