-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #97640 - TaKO8Ki:fix-wrong-suggestion-for-adding-wher…
…e-clauses, r=lcnr Fix wrong suggestion for adding where clauses closes #97576
- Loading branch information
Showing
3 changed files
with
40 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
struct Foo { | ||
bar: String, | ||
} | ||
|
||
impl Foo { | ||
pub fn new(bar: impl ToString) -> Self { | ||
Self { | ||
bar: bar.into(), //~ ERROR the trait bound `String: From<impl ToString>` is not satisfied | ||
} | ||
} | ||
} | ||
|
||
fn main() {} |
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,11 @@ | ||
error[E0277]: the trait bound `String: From<impl ToString>` is not satisfied | ||
--> $DIR/issue-97576.rs:8:22 | ||
| | ||
LL | bar: bar.into(), | ||
| ^^^^ the trait `From<impl ToString>` is not implemented for `String` | ||
| | ||
= note: required because of the requirements on the impl of `Into<String>` for `impl ToString` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |