2021-05-16 17:29:54 -05:00
|
|
|
// revisions: mir thir
|
|
|
|
// [thir]compile-flags: -Z thir-unsafeck
|
|
|
|
|
2014-12-22 23:20:31 -06:00
|
|
|
mod Y {
|
2016-02-22 16:33:38 -06:00
|
|
|
pub type X = usize;
|
2020-09-01 16:12:52 -05:00
|
|
|
extern "C" {
|
2016-02-22 16:33:38 -06:00
|
|
|
pub static x: *const usize;
|
2014-12-22 23:20:31 -06:00
|
|
|
}
|
2016-02-22 16:33:38 -06:00
|
|
|
pub fn foo(value: *const X) -> *const X {
|
2014-12-22 23:20:31 -06:00
|
|
|
value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-26 08:11:45 -06:00
|
|
|
static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
|
|
|
|
//~^ ERROR dereference of raw pointer
|
2015-05-05 07:47:04 -05:00
|
|
|
//~| ERROR E0015
|
2019-08-03 12:34:21 -05:00
|
|
|
//~| ERROR use of extern static is unsafe and requires
|
2014-12-22 23:20:31 -06:00
|
|
|
|
|
|
|
fn main() {}
|