forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#73320 - estebank:type-param-sugg-more, r=da…
…vidtwco Make new type param suggestion more targetted Do not suggest new type param when encountering a missing type in an ADT field with generic parameters. Fix rust-lang#72640.
- Loading branch information
Showing
6 changed files
with
80 additions
and
15 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
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,9 @@ | ||
struct Struct { | ||
m: Vec<Someunknownname<String, ()>>, //~ ERROR cannot find type `Someunknownname` in this scope | ||
//~^ NOTE not found in this scope | ||
} | ||
struct OtherStruct { //~ HELP you might be missing a type parameter | ||
m: K, //~ ERROR cannot find type `K` in this scope | ||
//~^ NOTE not found in this scope | ||
} | ||
fn main() {} |
17 changes: 17 additions & 0 deletions
17
src/test/ui/suggestions/type-not-found-in-adt-field.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,17 @@ | ||
error[E0412]: cannot find type `Someunknownname` in this scope | ||
--> $DIR/type-not-found-in-adt-field.rs:2:12 | ||
| | ||
LL | m: Vec<Someunknownname<String, ()>>, | ||
| ^^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error[E0412]: cannot find type `K` in this scope | ||
--> $DIR/type-not-found-in-adt-field.rs:6:8 | ||
| | ||
LL | struct OtherStruct { | ||
| - help: you might be missing a type parameter: `<K>` | ||
LL | m: K, | ||
| ^ not found in this scope | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0412`. |