Open
Description
mod sub {
fn foo() {
let map = HashMap::new();
}
}
suggestios:
Compiling playground v0.0.1 (/playground)
error[E0433]: failed to resolve: use of undeclared type `HashMap`
--> src/lib.rs:3:19
|
3 | let map = HashMap::new();
| ^^^^^^^ use of undeclared type `HashMap`
|
help: consider importing one of these items
|
2 + use std::collections::HashMap;
|
2 + use ahash::HashMap;
|
2 + use hashbrown::HashMap;
|
2 + use nom::lib::std::collections::HashMap;
|
For more information about this error, try `rustc --explain E0433`.
error: could not compile `playground` (lib) due to 1 previous error
The compiler suggests to put these imports at line 2 (so just after mod sub {
, which fixes the issue and correctly imports the hashmap, but when you click to add it, the import gets added at the start of the file.
current behavior:
use std::collections::HashMap;
mod sub {
fn foo() {
let map = HashMap::new();
}
}
expected:
mod sub{
use std::collections::HashMap;
fn foo() {
let map = HashMap::new();
}
}
Metadata
Metadata
Assignees
Labels
No labels