Skip to content

Commit

Permalink
Rollup merge of rust-lang#35773 - EugeneGonzalez:master, r=jonathandt…
Browse files Browse the repository at this point in the history
…urner

Change E0259 to the new error format

Fixes rust-lang#35514 as part of rust-lang#35233.

Sorry about creating a new PR I was having a lot of troubles squashing the commit because I didn't properly branch the new feature.

r? @GuillaumeGomez
  • Loading branch information
Jonathan Turner authored Aug 31, 2016
2 parents 7a187c3 + d4ca561 commit c75fd78
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 @@ -3349,7 +3349,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 c75fd78

Please sign in to comment.