]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr
Rollup merge of #106427 - mejrs:translation_errors, r=davidtwco
[rust.git] / tests / ui / type-alias-enum-variants / self-in-enum-definition.stderr
1 error[E0391]: cycle detected when simplifying constant for the type system `Alpha::V3::{constant#0}`
2   --> $DIR/self-in-enum-definition.rs:5:10
3    |
4 LL |     V3 = Self::V1 {} as u8 + 2,
5    |          ^^^^^^^^^^^^^^^^^^^^^
6    |
7 note: ...which requires simplifying constant for the type system `Alpha::V3::{constant#0}`...
8   --> $DIR/self-in-enum-definition.rs:5:10
9    |
10 LL |     V3 = Self::V1 {} as u8 + 2,
11    |          ^^^^^^^^^^^^^^^^^^^^^
12 note: ...which requires const-evaluating + checking `Alpha::V3::{constant#0}`...
13   --> $DIR/self-in-enum-definition.rs:5:10
14    |
15 LL |     V3 = Self::V1 {} as u8 + 2,
16    |          ^^^^^^^^^^^^^^^^^^^^^
17 note: ...which requires caching mir of `Alpha::V3::{constant#0}` for CTFE...
18   --> $DIR/self-in-enum-definition.rs:5:10
19    |
20 LL |     V3 = Self::V1 {} as u8 + 2,
21    |          ^^^^^^^^^^^^^^^^^^^^^
22 note: ...which requires elaborating drops for `Alpha::V3::{constant#0}`...
23   --> $DIR/self-in-enum-definition.rs:5:10
24    |
25 LL |     V3 = Self::V1 {} as u8 + 2,
26    |          ^^^^^^^^^^^^^^^^^^^^^
27 note: ...which requires borrow-checking `Alpha::V3::{constant#0}`...
28   --> $DIR/self-in-enum-definition.rs:5:10
29    |
30 LL |     V3 = Self::V1 {} as u8 + 2,
31    |          ^^^^^^^^^^^^^^^^^^^^^
32 note: ...which requires processing MIR for `Alpha::V3::{constant#0}`...
33   --> $DIR/self-in-enum-definition.rs:5:10
34    |
35 LL |     V3 = Self::V1 {} as u8 + 2,
36    |          ^^^^^^^^^^^^^^^^^^^^^
37 note: ...which requires const checking `Alpha::V3::{constant#0}`...
38   --> $DIR/self-in-enum-definition.rs:5:10
39    |
40 LL |     V3 = Self::V1 {} as u8 + 2,
41    |          ^^^^^^^^^^^^^^^^^^^^^
42 note: ...which requires preparing `Alpha::V3::{constant#0}` for borrow checking...
43   --> $DIR/self-in-enum-definition.rs:5:10
44    |
45 LL |     V3 = Self::V1 {} as u8 + 2,
46    |          ^^^^^^^^^^^^^^^^^^^^^
47 note: ...which requires unsafety-checking `Alpha::V3::{constant#0}`...
48   --> $DIR/self-in-enum-definition.rs:5:10
49    |
50 LL |     V3 = Self::V1 {} as u8 + 2,
51    |          ^^^^^^^^^^^^^^^^^^^^^
52 note: ...which requires building MIR for `Alpha::V3::{constant#0}`...
53   --> $DIR/self-in-enum-definition.rs:5:10
54    |
55 LL |     V3 = Self::V1 {} as u8 + 2,
56    |          ^^^^^^^^^^^^^^^^^^^^^
57    = note: ...which requires computing layout of `Alpha`...
58    = note: ...which again requires simplifying constant for the type system `Alpha::V3::{constant#0}`, completing the cycle
59 note: cycle used when collecting item types in top-level module
60   --> $DIR/self-in-enum-definition.rs:1:1
61    |
62 LL | / #[repr(u8)]
63 LL | | enum Alpha {
64 LL | |     V1 = 41,
65 LL | |     V2 = Self::V1 as u8 + 1,    // OK; See #50072.
66 ...  |
67 LL | |
68 LL | | fn main() {}
69    | |____________^
70
71 error: aborting due to previous error
72
73 For more information about this error, try `rustc --explain E0391`.