You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 {fnfoo(){let map = HashMap::new();}}
expected:
mod sub{use std::collections::HashMap;fnfoo(){let map = HashMap::new();}}
suggestios:
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:
expected:
playground
The text was updated successfully, but these errors were encountered: