-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Closed
Copy link
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`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
In this example:
fn main() {
let _: HashMap<u32, u32> = HashMap::new();
}
there are two uses of HashMap
. Neither is in scope, but only the type gives me a suggestion for how to import it:
error[E0433]: failed to resolve. Use of undeclared type or module `HashMap`
--> src/main.rs:2:32
|
2 | let _: HashMap<u32, u32> = HashMap::new();
| ^^^^^^^ Use of undeclared type or module `HashMap`
error[E0412]: cannot find type `HashMap` in this scope
--> src/main.rs:2:12
|
2 | let _: HashMap<u32, u32> = HashMap::new();
| ^^^^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
1 | use std::collections::HashMap;
|
1 | use std::collections::hash_map::HashMap;
|
This issue has been assigned to @Patryk27 via this comment.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`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.