mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Don't immediately error for recursive projections
This commit is contained in:
parent
6c4feb681f
commit
e29765250b
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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`.
|
||||
|
@ -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`.
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user