Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only do check for trait objects, not trait or trait alias definitions.
- Loading branch information
Alexander Regueiro
committed
Nov 7, 2018
1 parent
6d3ee41
commit 7d9ee03
Showing
13 changed files
with
112 additions
and
163 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
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
13 changes: 13 additions & 0 deletions
13
src/test/ui/associated-types/associated-types-overridden-binding-2.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::Iterator>::Item == i32` | ||
--> $DIR/associated-types-overridden-binding-2.rs:16:39 | ||
| | ||
LL | let _: &I32Iterator<Item = u32> = &vec![42].into_iter(); | ||
| ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32 | ||
| | ||
= note: expected type `u32` | ||
found type `i32` | ||
= note: required for the cast to the object type `dyn I32Iterator<Item=u32, Item=i32>` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0271`. |
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
15 changes: 15 additions & 0 deletions
15
src/test/ui/associated-types/associated-types-overridden-binding.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
error[E0284]: type annotations required: cannot resolve `<Self as std::iter::Iterator>::Item == i32` | ||
--> $DIR/associated-types-overridden-binding.rs:14:1 | ||
| | ||
LL | trait Bar: Foo<Item = u32> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: required by `Foo` | ||
--> $DIR/associated-types-overridden-binding.rs:13:1 | ||
| | ||
LL | trait Foo: Iterator<Item = i32> {} | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0284`. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,11 +1,19 @@ | ||
error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified | ||
--> $DIR/E0719.rs:12:22 | ||
--> $DIR/E0719.rs:11:33 | ||
| | ||
LL | let _: &Iterator<Item = i32, Item = i32>; //~ ERROR E0719 | ||
| ^^^^^^^^^^ ---------- `Item` bound here first | ||
| | | ||
| re-bound here | ||
LL | trait Foo: Iterator<Item = i32, Item = i32> {} | ||
| ---------- ^^^^^^^^^^ re-bound here | ||
| | | ||
| `Item` bound here first | ||
|
||
error: aborting due to previous error | ||
error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified | ||
--> $DIR/E0719.rs:15:38 | ||
| | ||
LL | fn test() -> Box<Iterator<Item = (), Item = Unit>> { | ||
| --------- ^^^^^^^^^^^ re-bound here | ||
| | | ||
| `Item` bound here first | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0719`. |
23 changes: 0 additions & 23 deletions
23
src/test/ui/lint/issue-50589-multiple-associated-types.stderr
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.