]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0260.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0260.md
1 The name for an item declaration conflicts with an external crate's name.
2
3 Erroneous code example:
4
5 ```compile_fail,E0260
6 extern crate core;
7
8 struct core;
9
10 fn main() {}
11 ```
12
13 There are two possible solutions:
14
15 Solution #1: Rename the item.
16
17 ```
18 extern crate core;
19
20 struct xyz;
21 ```
22
23 Solution #2: Import the crate with a different name.
24
25 ```
26 extern crate core as xyz;
27
28 struct abc;
29 ```
30
31 See the [Declaration Statements][declaration-statements] section of the
32 reference for more information about what constitutes an item declaration
33 and what does not.
34
35 [declaration-statements]: https://doc.rust-lang.org/reference/statements.html#declaration-statements