]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-16538.rs
Check for use of mutable/extern statics in THIR unsafeck
[rust.git] / src / test / ui / issues / issue-16538.rs
1 // revisions: mir thir
2 // [thir]compile-flags: -Z thir-unsafeck
3
4 mod Y {
5     pub type X = usize;
6     extern "C" {
7         pub static x: *const usize;
8     }
9     pub fn foo(value: *const X) -> *const X {
10         value
11     }
12 }
13
14 static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
15 //~^ ERROR `*const usize` cannot be shared between threads safely [E0277]
16 //~| ERROR E0015
17 //~| ERROR use of extern static is unsafe and requires
18
19 fn main() {}