Change E0259 to the new error format

Fixed E0259 unit test

Added name of conflict to E0259's note
This commit is contained in:
Eugene R Gonzalez 2016-08-17 21:02:53 -04:00
parent 7ac11cad3f
commit d4ca5613a0
2 changed files with 10 additions and 2 deletions

View File

@ -3366,7 +3366,11 @@ impl<'a> Resolver<'a> {
};
let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) {
(true, true) => struct_span_err!(self.session, span, E0259, "{}", msg),
(true, true) => {
let mut e = struct_span_err!(self.session, span, E0259, "{}", msg);
e.span_label(span, &format!("`{}` was already imported", name));
e
},
(true, _) | (_, true) if binding.is_import() || old_binding.is_import() => {
let mut e = struct_span_err!(self.session, span, E0254, "{}", msg);
e.span_label(span, &"already imported");

View File

@ -9,6 +9,10 @@
// except according to those terms.
extern crate collections;
extern crate libc as collections; //~ ERROR E0259
//~^ NOTE previous import of `collections` here
extern crate libc as collections;
//~^ ERROR E0259
//~| NOTE `collections` was already imported
fn main() {}