-
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.
Suggest new type param on single char ident
Suggest new type parameter on single char uppercase ident even if it doesn't appear in a field's type parameter. Address comment in #72641.
- Loading branch information
Showing
4 changed files
with
61 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
struct S { | ||
m: Vec<Hashmap<String, ()>>, //~ ERROR cannot find type `Hashmap` in this scope | ||
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() {} |
16 changes: 12 additions & 4 deletions
16
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 |
---|---|---|
@@ -1,9 +1,17 @@ | ||
error[E0412]: cannot find type `Hashmap` in this scope | ||
error[E0412]: cannot find type `Someunknownname` in this scope | ||
--> $DIR/type-not-found-in-adt-field.rs:2:12 | ||
| | ||
LL | m: Vec<Hashmap<String, ()>>, | ||
| ^^^^^^^ not found in this scope | ||
LL | m: Vec<Someunknownname<String, ()>>, | ||
| ^^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error: aborting due to previous error | ||
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`. |