forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't add specialized notes to error messages pointing at a Type
Fixes rust-lang#121398
- Loading branch information
1 parent
16de60e
commit 5d18799
Showing
5 changed files
with
81 additions
and
11 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
46 changes: 46 additions & 0 deletions
46
tests/ui/errors/traits/no-specialized-error-for-types-121398.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,46 @@ | ||
error[E0277]: `String` is not an iterator | ||
--> $DIR/no-specialized-error-for-types-121398.rs:3:14 | ||
| | ||
LL | impl Bar for String {} | ||
| ^^^^^^ `String` is not an iterator | ||
| | ||
= help: the trait `Iterator` is not implemented for `String` | ||
note: required by a bound in `Bar` | ||
--> $DIR/no-specialized-error-for-types-121398.rs:1:12 | ||
| | ||
LL | trait Bar: Iterator {} | ||
| ^^^^^^^^ required by this bound in `Bar` | ||
|
||
error[E0277]: `Vec<T>` is not an iterator | ||
--> $DIR/no-specialized-error-for-types-121398.rs:5:17 | ||
| | ||
LL | impl<T> Bar for Vec<T> {} | ||
| ^^^^^^ `Vec<T>` is not an iterator | ||
| | ||
= help: the trait `Iterator` is not implemented for `Vec<T>` | ||
note: required by a bound in `Bar` | ||
--> $DIR/no-specialized-error-for-types-121398.rs:1:12 | ||
| | ||
LL | trait Bar: Iterator {} | ||
| ^^^^^^^^ required by this bound in `Bar` | ||
|
||
error[E0277]: the type `String` cannot be mutably indexed by `Idx` | ||
--> $DIR/no-specialized-error-for-types-121398.rs:10:24 | ||
| | ||
LL | impl<Idx> Foo<Idx> for String {} | ||
| ^^^^^^ `String` cannot be mutably indexed by `Idx` | ||
| | ||
= help: the trait `IndexMut<Idx>` is not implemented for `String` | ||
note: required by a bound in `Foo` | ||
--> $DIR/no-specialized-error-for-types-121398.rs:8:17 | ||
| | ||
LL | trait Foo<Idx>: IndexMut<Idx> {} | ||
| ^^^^^^^^^^^^^ required by this bound in `Foo` | ||
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | ||
| | ||
LL | impl<Idx> Foo<Idx> for String where String: IndexMut<Idx> {} | ||
| +++++++++++++++++++++++++++ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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[E0277]: `String` is not an iterator | ||
--> $DIR/specialized-error-for-expr.rs:3:14 | ||
| | ||
LL | for _ in s {} | ||
| ^ `String` is not an iterator; try calling `.chars()` or `.bytes()` | ||
| | ||
= help: the trait `Iterator` is not implemented for `String`, which is required by `String: IntoIterator` | ||
= note: required for `String` to implement `IntoIterator` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |