]>
Commit | Line | Data |
---|---|---|
8faf50e0 | 1 | error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants |
60c5eb7d | 2 | --> $DIR/issue-16538.rs:11:27 |
8faf50e0 XL |
3 | | |
4 | LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X); | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
6 | ||
7 | error[E0277]: `*const usize` cannot be shared between threads safely | |
60c5eb7d | 8 | --> $DIR/issue-16538.rs:11:1 |
8faf50e0 XL |
9 | | |
10 | LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X); | |
11 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const usize` cannot be shared between threads safely | |
12 | | | |
13 | = help: the trait `std::marker::Sync` is not implemented for `*const usize` | |
14 | = note: shared static variables must have a type that implements `Sync` | |
15 | ||
60c5eb7d XL |
16 | error[E0133]: use of extern static is unsafe and requires unsafe function or block |
17 | --> $DIR/issue-16538.rs:11:34 | |
18 | | | |
19 | LL | static foo: *const Y::X = Y::foo(Y::x as *const Y::X); | |
20 | | ^^^^ use of extern static | |
21 | | | |
22 | = note: extern statics are not controlled by the Rust type system: invalid data, aliasing violations or data races will cause undefined behavior | |
23 | ||
24 | error: aborting due to 3 previous errors | |
8faf50e0 | 25 | |
60c5eb7d | 26 | Some errors have detailed explanations: E0015, E0133, E0277. |
8faf50e0 | 27 | For more information about an error, try `rustc --explain E0015`. |