-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
240 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
tests/ui/associated-types/associated-types-coherence-failure.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0119]: conflicting implementations of trait `Trait<_>` | ||
--> $DIR/opaques.rs:27:1 | ||
| | ||
LL | impl<T> Trait<T> for T { | ||
| ---------------------- first implementation here | ||
... | ||
LL | impl<T> Trait<T> for defining_scope::Alias<T> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
error[E0119]: conflicting implementations of trait `AnotherTrait` for type `D<_>` | ||
--> $DIR/auto-trait-coherence.rs:21:1 | ||
| | ||
LL | impl<T: Send> AnotherTrait for T {} | ||
| -------------------------------- first implementation here | ||
... | ||
LL | impl AnotherTrait for D<OpaqueType> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `D<_>` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0119`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,69 @@ | ||
//~ ERROR overflow evaluating the requirement `([isize; 0], _): Sized | ||
|
||
trait Foo<A> { | ||
fn get(&self, A: &A) { } | ||
fn get(&self, A: &A) {} | ||
} | ||
|
||
trait Bar { | ||
type Out; | ||
} | ||
|
||
impl<T> Foo<T> for [isize;0] { | ||
impl<T> Foo<T> for [isize; 0] { | ||
// OK, T is used in `Foo<T>`. | ||
} | ||
|
||
impl<T,U> Foo<T> for [isize;1] { | ||
impl<T, U> Foo<T> for [isize; 1] { | ||
//~^ ERROR the type parameter `U` is not constrained | ||
} | ||
|
||
impl<T,U> Foo<T> for [isize;2] where T : Bar<Out=U> { | ||
impl<T, U> Foo<T> for [isize; 2] | ||
where | ||
T: Bar<Out = U>, | ||
{ | ||
// OK, `U` is now constrained by the output type parameter. | ||
} | ||
|
||
impl<T:Bar<Out=U>,U> Foo<T> for [isize;3] { | ||
impl<T: Bar<Out = U>, U> Foo<T> for [isize; 3] { | ||
// OK, same as above but written differently. | ||
} | ||
|
||
impl<T,U> Foo<T> for U { | ||
impl<T, U> Foo<T> for U { | ||
//~^ ERROR conflicting implementations of trait `Foo<_>` for type `[isize; 0]` | ||
} | ||
|
||
impl<T,U> Bar for T { | ||
impl<T, U> Bar for T { | ||
//~^ ERROR the type parameter `U` is not constrained | ||
|
||
type Out = U; | ||
|
||
// Using `U` in an associated type within the impl is not good enough! | ||
} | ||
|
||
impl<T,U> Bar for T | ||
where T : Bar<Out=U> | ||
impl<T, U> Bar for T | ||
where | ||
T: Bar<Out = U>, | ||
{ | ||
//~^^^ ERROR the type parameter `U` is not constrained | ||
|
||
//~^^^^ ERROR the type parameter `U` is not constrained by the impl trait, self type, or predicates | ||
//~| ERROR conflicting implementations of trait `Bar` | ||
// This crafty self-referential attempt is still no good. | ||
} | ||
|
||
impl<T,U,V> Foo<T> for T | ||
where (T,U): Bar<Out=V> | ||
impl<T, U, V> Foo<T> for T | ||
where | ||
(T, U): Bar<Out = V>, | ||
{ | ||
//~^^^ ERROR the type parameter `U` is not constrained | ||
//~| ERROR the type parameter `V` is not constrained | ||
//~^^^^ ERROR the type parameter `U` is not constrained | ||
//~| ERROR the type parameter `V` is not constrained | ||
//~| ERROR conflicting implementations of trait `Foo<[isize; 0]>` for type `[isize; 0]` | ||
|
||
// Here, `V` is bound by an output type parameter, but the inputs | ||
// are not themselves constrained. | ||
} | ||
|
||
impl<T,U,V> Foo<(T,U)> for T | ||
where (T,U): Bar<Out=V> | ||
impl<T, U, V> Foo<(T, U)> for T | ||
where | ||
(T, U): Bar<Out = V>, | ||
{ | ||
//~^^^^ ERROR conflicting implementations of trait `Foo<([isize; 0], _)>` for type `[isize; 0]` | ||
// As above, but both T and U ARE constrained. | ||
} | ||
|
||
fn main() { } | ||
fn main() {} |
Oops, something went wrong.