-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
struct S {
m: Hashmap<String, ()>,
}
error[E0412]: cannot find type `Hashmap` in this scope
--> src/main.rs:2:8
|
2 | m: Hashmap<String, ()>,
| ^^^^^^^ not found in this scope
If the code had been written with HashMap
instead of Hashmap
, we would get the following extremely likely correct suggestion:
error[E0412]: cannot find type `HashMap` in this scope
--> src/main.rs:2:8
|
2 | m: HashMap<String, ()>,
| ^^^^^^^ not found in this scope
|
help: consider importing one of these items
|
1 | use std::collections::HashMap;
|
1 | use std::collections::hash_map::HashMap;
|
Hashmap
is a fairly common capitalization in other languages (https://grep.app/search?q=Hashmap&case=true) so it would be good to provide an appropriate suggestion in this case.
(For whatever reason this doesn't trigger #72640.)
joshtriplett and est31
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.D-papercutDiagnostics: An error or lint that needs small tweaks.Diagnostics: An error or lint that needs small tweaks.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.