summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_error_codes/src/error_codes/E0433.md
blob: 5a64c13c9af512f0bb1e136476ee3e5c30837bb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
An undeclared crate, module, or type was used.

Erroneous code example:

```compile_fail,E0433
let map = HashMap::new();
// error: failed to resolve: use of undeclared type `HashMap`
```

Please verify you didn't misspell the type/module's name or that you didn't
forget to import it:

```
use std::collections::HashMap; // HashMap has been imported.
let map: HashMap<u32, u32> = HashMap::new(); // So it can be used!
```

If you've expected to use a crate name:

```compile_fail
use ferris_wheel::BigO;
// error: failed to resolve: use of undeclared crate or module `ferris_wheel`
```

Make sure the crate has been added as a dependency in `Cargo.toml`.

To use a module from your current crate, add the `crate::` prefix to the path.