Closed
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
Area: Messages for errors, warnings, and lintsArea: Name/path resolution done by `rustc_resolve` specificallyArea: Suggestions generated by the compiler applied by `cargo fix`Diagnostics: An error or lint that needs small tweaks.Relevant to the compiler team, which will review and decide on the PR/issue.