]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0254.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0254.md
1 Attempt was made to import an item whereas an extern crate with this name has
2 already been imported.
3
4 Erroneous code example:
5
6 ```compile_fail,E0254
7 extern crate core;
8
9 mod foo {
10     pub trait core {
11         fn do_something();
12     }
13 }
14
15 use foo::core;  // error: an extern crate named `core` has already
16                 //        been imported in this module
17
18 fn main() {}
19 ```
20
21 To fix this issue, you have to rename at least one of the two imports.
22 Example:
23
24 ```
25 extern crate core as libcore; // ok!
26
27 mod foo {
28     pub trait core {
29         fn do_something();
30     }
31 }
32
33 use foo::core;
34
35 fn main() {}
36 ```