File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
src/test/ui/associated-const Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 1- // compile -fail
1+ // build -fail
22
33// Cyclic assoc. const defaults don't error unless *used*
44trait Tr {
55 const A : u8 = Self :: B ;
6- //~^ ERROR cycle detected when const-evaluating `Tr::A`
6+ //~^ ERROR cycle detected when const-evaluating + checking `Tr::A`
77
88 const B : u8 = Self :: A ;
99}
Original file line number Diff line number Diff line change 1- error[E0391]: cycle detected when const-evaluating `Tr::A`
1+ error[E0391]: cycle detected when const-evaluating + checking `Tr::A`
2+ --> $DIR/defaults-cyclic-fail.rs:5:5
3+ |
4+ LL | const A: u8 = Self::B;
5+ | ^^^^^^^^^^^^^^^^^^^^^^
6+ |
7+ note: ...which requires const-evaluating `Tr::A`...
28 --> $DIR/defaults-cyclic-fail.rs:5:19
39 |
410LL | const A: u8 = Self::B;
511 | ^^^^^^^
12+ note: ...which requires const-evaluating + checking `Tr::B`...
13+ --> $DIR/defaults-cyclic-fail.rs:8:5
614 |
15+ LL | const B: u8 = Self::A;
16+ | ^^^^^^^^^^^^^^^^^^^^^^
717note: ...which requires const-evaluating `Tr::B`...
818 --> $DIR/defaults-cyclic-fail.rs:8:19
919 |
1020LL | const B: u8 = Self::A;
1121 | ^^^^^^^
12- = note: ...which again requires const-evaluating `Tr::A`, completing the cycle
22+ = note: ...which again requires const-evaluating + checking `Tr::A`, completing the cycle
1323note: cycle used when const-evaluating `main`
1424 --> $DIR/defaults-cyclic-fail.rs:16:16
1525 |
Original file line number Diff line number Diff line change 1- // compile -fail
1+ // build -fail
22
33trait Tr {
44 const A : u8 = 255 ;
You can’t perform that action at this time.
0 commit comments