]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-enum-variants/self-in-enum-definition.stderr
Auto merge of #96711 - emilio:inline-slice-clone, r=nikic
[rust.git] / src / test / 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 computing layout of `Alpha`...
18    = note: ...which again requires simplifying constant for the type system `Alpha::V3::{constant#0}`, completing the cycle
19 note: cycle used when collecting item types in top-level module
20   --> $DIR/self-in-enum-definition.rs:1:1
21    |
22 LL | / #[repr(u8)]
23 LL | | enum Alpha {
24 LL | |     V1 = 41,
25 LL | |     V2 = Self::V1 as u8 + 1,    // OK; See #50072.
26 ...  |
27 LL | |
28 LL | | fn main() {}
29    | |____________^
30
31 error: aborting due to previous error
32
33 For more information about this error, try `rustc --explain E0391`.