]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0432.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0432.md
1 An import was unresolved.
2
3 Erroneous code example:
4
5 ```compile_fail,E0432
6 use something::Foo; // error: unresolved import `something::Foo`.
7 ```
8
9 Paths in `use` statements are relative to the crate root. To import items
10 relative to the current and parent modules, use the `self::` and `super::`
11 prefixes, respectively. Also verify that you didn't misspell the import
12 name and that the import exists in the module from where you tried to
13 import it. Example:
14
15 ```
16 use self::something::Foo; // ok!
17
18 mod something {
19 pub struct Foo;
20 }
21 # fn main() {}
22 ```
23
24 Or, if you tried to use a module from an external crate, you may have missed
25 the `extern crate` declaration (which is usually placed in the crate root):
26
27 ```
28 extern crate core; // Required to use the `core` crate
29
30 use core::any;
31 # fn main() {}
32 ```