This repository was archived by the owner on May 28, 2025. It is now read-only.
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
2
2
3
3
// Cyclic assoc. const defaults don't error unless *used*
4
4
trait Tr {
5
5
const A : u8 = Self :: B ;
6
- //~^ ERROR cycle detected when const-evaluating `Tr::A`
6
+ //~^ ERROR cycle detected when const-evaluating + checking `Tr::A`
7
7
8
8
const B : u8 = Self :: A ;
9
9
}
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`...
2
8
--> $DIR/defaults-cyclic-fail.rs:5:19
3
9
|
4
10
LL | const A: u8 = Self::B;
5
11
| ^^^^^^^
12
+ note: ...which requires const-evaluating + checking `Tr::B`...
13
+ --> $DIR/defaults-cyclic-fail.rs:8:5
6
14
|
15
+ LL | const B: u8 = Self::A;
16
+ | ^^^^^^^^^^^^^^^^^^^^^^
7
17
note: ...which requires const-evaluating `Tr::B`...
8
18
--> $DIR/defaults-cyclic-fail.rs:8:19
9
19
|
10
20
LL | const B: u8 = Self::A;
11
21
| ^^^^^^^
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
13
23
note: cycle used when const-evaluating `main`
14
24
--> $DIR/defaults-cyclic-fail.rs:16:16
15
25
|
Original file line number Diff line number Diff line change 1
- // compile -fail
1
+ // build -fail
2
2
3
3
trait Tr {
4
4
const A : u8 = 255 ;
You can’t perform that action at this time.
0 commit comments