Skip to content

Commit 3608535

Browse files
Cycle errors are caught during const-checking again
1 parent 918dcf2 commit 3608535

File tree

5 files changed

+27
-106
lines changed

5 files changed

+27
-106
lines changed

src/test/ui/issues/issue-17252.stderr

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
1-
error[E0391]: cycle detected when normalizing `FOO`
2-
|
3-
note: ...which requires const-evaluating + checking `FOO`...
4-
--> $DIR/issue-17252.rs:1:1
5-
|
6-
LL | const FOO: usize = FOO;
7-
| ^^^^^^^^^^^^^^^^^^^^^^^
8-
note: ...which requires const-evaluating + checking `FOO`...
9-
--> $DIR/issue-17252.rs:1:1
1+
error[E0391]: cycle detected when const checking `FOO`
2+
--> $DIR/issue-17252.rs:1:20
103
|
114
LL | const FOO: usize = FOO;
12-
| ^^^^^^^^^^^^^^^^^^^^^^^
13-
note: ...which requires const-evaluating `FOO`...
14-
--> $DIR/issue-17252.rs:1:1
5+
| ^^^
156
|
16-
LL | const FOO: usize = FOO;
17-
| ^^^^^^^^^^^^^^^^^^^^^^^
18-
= note: ...which again requires normalizing `FOO`, completing the cycle
19-
note: cycle used when const-evaluating `main::{{constant}}#0`
7+
= note: ...which again requires const checking `FOO`, completing the cycle
8+
note: cycle used when const checking `main::{{constant}}#0`
209
--> $DIR/issue-17252.rs:4:18
2110
|
2211
LL | let _x: [u8; FOO]; // caused stack overflow prior to fix

src/test/ui/issues/issue-23302-1.stderr

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `X::A::{{constant}}#0`
1+
error[E0391]: cycle detected when const checking `X::A::{{constant}}#0`
22
--> $DIR/issue-23302-1.rs:4:9
33
|
44
LL | A = X::A as isize,
55
| ^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `X::A::{{constant}}#0`...
7+
= note: ...which again requires const checking `X::A::{{constant}}#0`, completing the cycle
8+
note: cycle used when processing `X::A::{{constant}}#0`
89
--> $DIR/issue-23302-1.rs:4:9
910
|
1011
LL | A = X::A as isize,
1112
| ^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `X::A::{{constant}}#0`...
13-
--> $DIR/issue-23302-1.rs:4:9
14-
|
15-
LL | A = X::A as isize,
16-
| ^^^^^^^^^^^^^
17-
= note: ...which requires normalizing `X::A as isize`...
18-
= note: ...which again requires const-evaluating + checking `X::A::{{constant}}#0`, completing the cycle
19-
note: cycle used when collecting item types in top-level module
20-
--> $DIR/issue-23302-1.rs:3:1
21-
|
22-
LL | enum X {
23-
| ^^^^^^
2413

2514
error: aborting due to previous error
2615

src/test/ui/issues/issue-23302-2.stderr

+3-14
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,15 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `Y::A::{{constant}}#0`
1+
error[E0391]: cycle detected when const checking `Y::A::{{constant}}#0`
22
--> $DIR/issue-23302-2.rs:4:9
33
|
44
LL | A = Y::B as isize,
55
| ^^^^^^^^^^^^^
66
|
7-
note: ...which requires const-evaluating + checking `Y::A::{{constant}}#0`...
7+
= note: ...which again requires const checking `Y::A::{{constant}}#0`, completing the cycle
8+
note: cycle used when processing `Y::A::{{constant}}#0`
89
--> $DIR/issue-23302-2.rs:4:9
910
|
1011
LL | A = Y::B as isize,
1112
| ^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `Y::A::{{constant}}#0`...
13-
--> $DIR/issue-23302-2.rs:4:9
14-
|
15-
LL | A = Y::B as isize,
16-
| ^^^^^^^^^^^^^
17-
= note: ...which requires normalizing `Y::B as isize`...
18-
= note: ...which again requires const-evaluating + checking `Y::A::{{constant}}#0`, completing the cycle
19-
note: cycle used when collecting item types in top-level module
20-
--> $DIR/issue-23302-2.rs:3:1
21-
|
22-
LL | enum Y {
23-
| ^^^^^^
2413

2514
error: aborting due to previous error
2615

src/test/ui/issues/issue-23302-3.stderr

+9-27
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,20 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `A`
2-
--> $DIR/issue-23302-3.rs:1:1
1+
error[E0391]: cycle detected when const checking `A`
2+
--> $DIR/issue-23302-3.rs:1:16
33
|
44
LL | const A: i32 = B;
5-
| ^^^^^^^^^^^^^^^^^
5+
| ^
66
|
7-
note: ...which requires const-evaluating + checking `A`...
8-
--> $DIR/issue-23302-3.rs:1:1
7+
note: ...which requires const checking `B`...
8+
--> $DIR/issue-23302-3.rs:3:16
99
|
10-
LL | const A: i32 = B;
11-
| ^^^^^^^^^^^^^^^^^
12-
note: ...which requires const-evaluating `A`...
10+
LL | const B: i32 = A;
11+
| ^
12+
= note: ...which again requires const checking `A`, completing the cycle
13+
note: cycle used when processing `A`
1314
--> $DIR/issue-23302-3.rs:1:1
1415
|
1516
LL | const A: i32 = B;
1617
| ^^^^^^^^^^^^^^^^^
17-
= note: ...which requires normalizing `B`...
18-
note: ...which requires const-evaluating + checking `B`...
19-
--> $DIR/issue-23302-3.rs:3:1
20-
|
21-
LL | const B: i32 = A;
22-
| ^^^^^^^^^^^^^^^^^
23-
note: ...which requires const-evaluating + checking `B`...
24-
--> $DIR/issue-23302-3.rs:3:1
25-
|
26-
LL | const B: i32 = A;
27-
| ^^^^^^^^^^^^^^^^^
28-
note: ...which requires const-evaluating `B`...
29-
--> $DIR/issue-23302-3.rs:3:1
30-
|
31-
LL | const B: i32 = A;
32-
| ^^^^^^^^^^^^^^^^^
33-
= note: ...which requires normalizing `A`...
34-
= note: ...which again requires const-evaluating + checking `A`, completing the cycle
35-
= note: cycle used when running analysis passes on this crate
3618

3719
error: aborting due to previous error
3820

src/test/ui/issues/issue-36163.stderr

+7-35
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,20 @@
1-
error[E0391]: cycle detected when const-evaluating + checking `Foo::B::{{constant}}#0`
1+
error[E0391]: cycle detected when const checking `Foo::B::{{constant}}#0`
22
--> $DIR/issue-36163.rs:4:9
33
|
44
LL | B = A,
55
| ^
66
|
7-
note: ...which requires const-evaluating + checking `Foo::B::{{constant}}#0`...
8-
--> $DIR/issue-36163.rs:4:9
7+
note: ...which requires const checking `A`...
8+
--> $DIR/issue-36163.rs:1:18
99
|
10-
LL | B = A,
11-
| ^
12-
note: ...which requires const-evaluating `Foo::B::{{constant}}#0`...
10+
LL | const A: isize = Foo::B as isize;
11+
| ^^^^^^^^^^^^^^^
12+
= note: ...which again requires const checking `Foo::B::{{constant}}#0`, completing the cycle
13+
note: cycle used when processing `Foo::B::{{constant}}#0`
1314
--> $DIR/issue-36163.rs:4:9
1415
|
1516
LL | B = A,
1617
| ^
17-
= note: ...which requires normalizing `A`...
18-
note: ...which requires const-evaluating + checking `A`...
19-
--> $DIR/issue-36163.rs:1:1
20-
|
21-
LL | const A: isize = Foo::B as isize;
22-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23-
note: ...which requires const-evaluating + checking `A`...
24-
--> $DIR/issue-36163.rs:1:1
25-
|
26-
LL | const A: isize = Foo::B as isize;
27-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28-
note: ...which requires const-evaluating `A`...
29-
--> $DIR/issue-36163.rs:1:1
30-
|
31-
LL | const A: isize = Foo::B as isize;
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33-
= note: ...which requires normalizing `A`...
34-
= note: ...which again requires const-evaluating + checking `Foo::B::{{constant}}#0`, completing the cycle
35-
note: cycle used when collecting item types in top-level module
36-
--> $DIR/issue-36163.rs:1:1
37-
|
38-
LL | / const A: isize = Foo::B as isize;
39-
LL | |
40-
LL | | enum Foo {
41-
LL | | B = A,
42-
LL | | }
43-
LL | |
44-
LL | | fn main() {}
45-
| |____________^
4618

4719
error: aborting due to previous error
4820

0 commit comments

Comments
 (0)