1 error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
2 --> $DIR/issue-16538.rs:15:22
4 LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ dereference of raw pointer
7 = note: raw pointers may be null, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
9 error[E0133]: use of extern static is unsafe and requires unsafe function or block
10 --> $DIR/issue-16538.rs:15:30
12 LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
13 | ^^^^ use of extern static
15 = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
17 error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
18 --> $DIR/issue-16538.rs:15:23
20 LL | static foo: &Y::X = &*Y::foo(Y::x as *const Y::X);
21 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 error: aborting due to 3 previous errors
25 Some errors have detailed explanations: E0015, E0133.
26 For more information about an error, try `rustc --explain E0015`.