2018-12-17 13:20:42 +00:00
|
|
|
error[E0080]: could not evaluate static initializer
|
2018-12-28 19:05:22 +00:00
|
|
|
--> $DIR/write-to-static-mut-in-static.rs:2:33
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | pub static mut B: () = unsafe { A = 1; };
|
2020-03-21 22:20:43 +00:00
|
|
|
| ^^^^^ modifying a static's initial value from another static's initializer
|
2018-08-08 12:28:26 +00:00
|
|
|
|
2020-09-07 15:30:38 +00:00
|
|
|
error[E0391]: cycle detected when const-evaluating + checking `C`
|
2020-06-01 09:17:38 +00:00
|
|
|
--> $DIR/write-to-static-mut-in-static.rs:5:1
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
|
2022-02-13 15:27:59 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^
|
2018-12-17 13:20:42 +00:00
|
|
|
|
|
2020-09-07 15:30:38 +00:00
|
|
|
note: ...which requires const-evaluating + checking `C`...
|
2022-06-04 19:48:16 +00:00
|
|
|
--> $DIR/write-to-static-mut-in-static.rs:5:34
|
2018-12-17 13:20:42 +00:00
|
|
|
|
|
|
|
|
LL | pub static mut C: u32 = unsafe { C = 1; 0 };
|
2022-06-04 19:48:16 +00:00
|
|
|
| ^^^^^
|
2020-09-07 15:30:38 +00:00
|
|
|
= note: ...which again requires const-evaluating + checking `C`, completing the cycle
|
2022-06-18 17:48:44 +00:00
|
|
|
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() {}
|
|
|
|
| |____________^
|
2018-08-08 12:28:26 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2019-04-17 17:26:38 +00:00
|
|
|
Some errors have detailed explanations: E0080, E0391.
|
2018-12-17 13:20:42 +00:00
|
|
|
For more information about an error, try `rustc --explain E0080`.
|