Skip to content

Commit e297652

Browse files
committed
Don't immediately error for recursive projections
1 parent 6c4feb6 commit e297652

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

compiler/rustc_error_codes/src/error_codes/E0284.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ fn main() {
1414

1515
Here we have an addition of `d` and `n.into()`. Hence, `n.into()` can return
1616
any type `T` where `u64: Add<T>`. On the other hand, the `into` method can
17-
rteurn any type where `u32: Into<T>`.
17+
return any type where `u32: Into<T>`.
1818

1919
The author of this code probably wants `into()` to return a `u64`, but the
2020
compiler can't be sure that there isn't another type `T` where both

src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ impl<'a, 'b> Lam<&'a &'b u8> for L2 {
2424

2525
trait Case1 {
2626
type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
27-
//~^ ERROR overflow evaluating the requirement `<<Self as Case1>::C as std::iter::Iterator>::Item`
27+
//~^ ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` is not an iterator
28+
//~| ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely
29+
//~| ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely
2830
}
2931

3032
pub struct S1;

src/test/ui/associated-type-bounds/bad-bounds-on-assoc-in-trait.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow evaluating the requirement `<<Self as Case1>::C as std::iter::Iterator>::Item`
1+
error[E0277]: `<<Self as Case1>::C as std::iter::Iterator>::Item` is not an iterator
22
--> $DIR/bad-bounds-on-assoc-in-trait.rs:28:5
33
|
44
LL | / type C: Clone + Iterator<Item:
@@ -49,6 +49,6 @@ help: consider further restricting the associated type
4949
LL | trait Case1 where <<Self as Case1>::C as std::iter::Iterator>::Item: std::marker::Sync {
5050
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5151

52-
error: aborting due to previous error
52+
error: aborting due to 3 previous errors
5353

54-
For more information about this error, try `rustc --explain E0275`.
54+
For more information about this error, try `rustc --explain E0277`.
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
1+
error[E0271]: type mismatch resolving `<bool as Tr>::B == _`
22
--> $DIR/defaults-cyclic-fail-1.rs:26:5
33
|
44
LL | type A = Box<Self::B>;
55
| ^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
66

7-
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
7+
error[E0271]: type mismatch resolving `<usize as Tr>::A == _`
88
--> $DIR/defaults-cyclic-fail-1.rs:32:5
99
|
1010
LL | type B = &'static Self::A;
1111
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
1212

1313
error: aborting due to 2 previous errors
1414

15-
Some errors have detailed explanations: E0271, E0275.
16-
For more information about an error, try `rustc --explain E0271`.
15+
For more information about this error, try `rustc --explain E0271`.

src/test/ui/associated-types/defaults-cyclic-fail-2.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
1+
error[E0271]: type mismatch resolving `<bool as Tr>::B == _`
22
--> $DIR/defaults-cyclic-fail-2.rs:27:5
33
|
44
LL | type A = Box<Self::B>;
55
| ^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
66

7-
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
7+
error[E0271]: type mismatch resolving `<usize as Tr>::A == _`
88
--> $DIR/defaults-cyclic-fail-2.rs:33:5
99
|
1010
LL | type B = &'static Self::A;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A`
1+
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A == _`
22
--> $DIR/issue-21946.rs:8:5
33
|
44
LL | type A = <FooStruct as Foo>::A;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next`
1+
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next == _`
22
--> $DIR/issue-23122-1.rs:8:5
33
|
44
LL | type Next = <GetNext<T> as Next>::Next;

0 commit comments

Comments
 (0)