Don't immediately error for recursive projections

This commit is contained in:
Matthew Jasper 2020-07-25 21:27:34 +01:00
parent 6c4feb681f
commit e29765250b
7 changed files with 14 additions and 13 deletions

View File

@ -14,7 +14,7 @@ fn main() {
Here we have an addition of `d` and `n.into()`. Hence, `n.into()` can return
any type `T` where `u64: Add<T>`. On the other hand, the `into` method can
rteurn any type where `u32: Into<T>`.
return any type where `u32: Into<T>`.
The author of this code probably wants `into()` to return a `u64`, but the
compiler can't be sure that there isn't another type `T` where both

View File

@ -24,7 +24,9 @@ impl<'a, 'b> Lam<&'a &'b u8> for L2 {
trait Case1 {
type C: Clone + Iterator<Item: Send + Iterator<Item: for<'a> Lam<&'a u8, App: Debug>> + Sync>;
//~^ ERROR overflow evaluating the requirement `<<Self as Case1>::C as std::iter::Iterator>::Item`
//~^ ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` is not an iterator
//~| ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` cannot be sent between threads safely
//~| ERROR `<<Self as Case1>::C as std::iter::Iterator>::Item` cannot be shared between threads safely
}
pub struct S1;

View File

@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `<<Self as Case1>::C as std::iter::Iterator>::Item`
error[E0277]: `<<Self as Case1>::C as std::iter::Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:28:5
|
LL | / type C: Clone + Iterator<Item:
@ -49,6 +49,6 @@ help: consider further restricting the associated type
LL | trait Case1 where <<Self as Case1>::C as std::iter::Iterator>::Item: std::marker::Sync {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0275`.
For more information about this error, try `rustc --explain E0277`.

View File

@ -1,10 +1,10 @@
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
error[E0271]: type mismatch resolving `<bool as Tr>::B == _`
--> $DIR/defaults-cyclic-fail-1.rs:26:5
|
LL | type A = Box<Self::B>;
| ^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
error[E0271]: type mismatch resolving `<usize as Tr>::A == _`
--> $DIR/defaults-cyclic-fail-1.rs:32:5
|
LL | type B = &'static Self::A;
@ -12,5 +12,4 @@ LL | type B = &'static Self::A;
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0271, E0275.
For more information about an error, try `rustc --explain E0271`.
For more information about this error, try `rustc --explain E0271`.

View File

@ -1,10 +1,10 @@
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B`
error[E0271]: type mismatch resolving `<bool as Tr>::B == _`
--> $DIR/defaults-cyclic-fail-2.rs:27:5
|
LL | type A = Box<Self::B>;
| ^^^^^^^^^^^^^^^^^^^^^^ cyclic type of infinite size
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A`
error[E0271]: type mismatch resolving `<usize as Tr>::A == _`
--> $DIR/defaults-cyclic-fail-2.rs:33:5
|
LL | type B = &'static Self::A;

View File

@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A`
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A == _`
--> $DIR/issue-21946.rs:8:5
|
LL | type A = <FooStruct as Foo>::A;

View File

@ -1,4 +1,4 @@
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next`
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next == _`
--> $DIR/issue-23122-1.rs:8:5
|
LL | type Next = <GetNext<T> as Next>::Next;