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

11 lines
246 B
Rust

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