diff --git a/src/librustc_resolve/diagnostics.rs b/src/librustc_resolve/diagnostics.rs index 3e860150a35..af830d92074 100644 --- a/src/librustc_resolve/diagnostics.rs +++ b/src/librustc_resolve/diagnostics.rs @@ -153,6 +153,45 @@ fn main() {} It's invalid to directly import methods belonging to a trait or concrete type. "##, +E0254: r##" +Attempt was made to import an item whereas an extern crate with this name has +already been imported. + +Erroneous code example: + +```compile_fail,E0254 +extern crate collections; + +mod foo { + pub trait collections { + fn do_something(); + } +} + +use foo::collections; // error: an extern crate named `collections` has already + // been imported in this module + +fn main() {} +``` + +To fix issue issue, you have to rename at least one of the two imports. +Example: + +```ignore +extern crate collections as libcollections; // ok! + +mod foo { + pub trait collections { + fn do_something(); + } +} + +use foo::collections; + +fn main() {} +``` +"##, + E0255: r##" You can't import a value whose name is the same as another value defined in the module. @@ -1237,7 +1276,6 @@ impl Foo for i32 {} register_diagnostics! { // E0153, unused error code // E0157, unused error code - E0254, // import conflicts with imported crate in this module // E0257, // E0258, E0402, // cannot use an outer type parameter in this context