1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 #![allow(non_snake_case)]
13 // Error messages for EXXXX errors.
14 // Each message should start and end with a new line, and be wrapped to 80 characters.
15 // In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
16 register_long_diagnostics
! {
19 Imports (`use` statements) are not allowed after non-item statements, such as
20 variable declarations and expression statements.
22 Here is an example that demonstrates the error:
26 // Variable declaration before import
33 The solution is to declare the imports at the top of the block, function, or
36 Here is the previous example again, with the correct order:
46 See the Declaration Statements section of the reference for more information
47 about what constitutes an Item declaration and what does not:
49 http://doc.rust-lang.org/reference.html#statements
53 Two items of the same name cannot be imported without rebinding one of the
54 items under a new local name.
56 An example of this error:
60 use bar::*; // error, do `use foo::baz as quux` instead on the previous line
75 Two items of the same name cannot be imported without rebinding one of the
76 items under a new local name.
78 An example of this error:
82 use bar::baz; // error, do `use bar::baz as quux` instead
97 You can't import a value whose name is the same as another value defined in the
100 An example of this error:
103 use bar::foo; // error, do `use bar::foo as baz` instead
116 You can't import a type or module when the name of the item being imported is
117 the same as another type or submodule defined in the module.
119 An example of this error:
122 use foo::Bar; // error
135 The name chosen for an external crate conflicts with another external crate that
136 has been imported into the current module.
142 extern crate crate_a as a;
145 The solution is to choose a different name that doesn't conflict with any
146 external crate imported into the current module.
152 extern crate crate_a as other_name;
157 The name for an item declaration conflicts with an external crate's name.
167 There are two possible solutions:
169 Solution #1: Rename the item.
177 Solution #2: Import the crate with a different name.
180 extern crate abc as xyz;
185 See the Declaration Statements section of the reference for more information
186 about what constitutes an Item declaration and what does not:
188 http://doc.rust-lang.org/reference.html#statements
192 User-defined types or type parameters cannot shadow the primitive types.
193 This error indicates you tried to define a type, struct or enum with the same
194 name as an existing primitive type.
196 See the Types section of the reference for more information about the primitive
199 http://doc.rust-lang.org/reference.html#types
204 register_diagnostics
! {
207 E0253
, // not directly importable
208 E0254
, // import conflicts with imported crate in this module
211 E0364
, // item is private
212 E0365
// item is private