Skip to content

Commit

Permalink
Change E0259 to the new error format
Browse files Browse the repository at this point in the history
Fixed E0259 unit test

Added name of conflict to E0259's note
  • Loading branch information
Eugene R Gonzalez committed Aug 31, 2016
1 parent 7ac11ca commit d4ca561
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
6 changes: 5 additions & 1 deletion src/test/compile-fail/E0259.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {}

0 comments on commit d4ca561

Please sign in to comment.