summaryrefslogtreecommitdiffstats
path: root/src/test/ui/static/static-mut-foreign-requires-unsafe.rs
blob: 4f96acb3375b8a433f508d03ba326e34edb2a773 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// 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
}