2018-07-15 16:11:54 -05:00
|
|
|
error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
|
2021-05-16 17:29:54 -05:00
|
|
|
--> $DIR/issue-16538.rs:14:27
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
|
|
error[E0277]: `*const usize` cannot be shared between threads safely
|
2021-05-16 17:29:54 -05:00
|
|
|
--> $DIR/issue-16538.rs:14:1
|
2018-07-15 16:11:54 -05:00
|
|
|
|
|
|
|
|
LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const usize` cannot be shared between threads safely
|
|
|
|
|
|
2020-09-02 02:40:56 -05:00
|
|
|
= help: the trait `Sync` is not implemented for `*const usize`
|
2018-07-15 16:11:54 -05:00
|
|
|
= note: shared static variables must have a type that implements `Sync`
|
|
|
|
|
2019-08-03 12:34:21 -05:00
|
|
|
error[E0133]: use of extern static is unsafe and requires unsafe function or block
|
2021-05-16 17:29:54 -05:00
|
|
|
--> $DIR/issue-16538.rs:14:34
|
2019-08-03 12:34:21 -05:00
|
|
|
|
|
|
|
|
LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X);
|
|
|
|
| ^^^^ use of extern static
|
|
|
|
|
|
|
|
|
= note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior
|
|
|
|
|
|
|
|
error: aborting due to 3 previous errors
|
2018-07-15 16:11:54 -05:00
|
|
|
|
2019-08-03 12:34:21 -05:00
|
|
|
Some errors have detailed explanations: E0015, E0133, E0277.
|
2018-07-15 16:11:54 -05:00
|
|
|
For more information about an error, try `rustc --explain E0015`.
|