mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
error[E0080]: could not evaluate static initializer
|
|
--> $DIR/write-to-static-mut-in-static.rs:2:33
|
|
|
|
|
LL | pub static mut B: () = unsafe { A = 1; };
|
|
| ^^^^^ modifying a static's initial value from another static's initializer
|
|
|
|
error[E0391]: cycle detected when const-evaluating + checking `C`
|
|
--> $DIR/write-to-static-mut-in-static.rs:5:1
|
|
|
|
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
note: ...which requires const-evaluating + checking `C`...
|
|
--> $DIR/write-to-static-mut-in-static.rs:5:34
|
|
|
|
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
|
|
| ^^^^^
|
|
= note: ...which again requires const-evaluating + checking `C`, completing the cycle
|
|
note: cycle used when linting top-level module
|
|
--> $DIR/write-to-static-mut-in-static.rs:1:1
|
|
|
|
|
LL | / pub static mut A: u32 = 0;
|
|
LL | | pub static mut B: () = unsafe { A = 1; };
|
|
LL | |
|
|
LL | |
|
|
... |
|
|
LL | |
|
|
LL | | fn main() {}
|
|
| |____________^
|
|
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
Some errors have detailed explanations: E0080, E0391.
|
|
For more information about an error, try `rustc --explain E0080`.
|