Skip to content

Commit

Permalink
Rollup merge of rust-lang#35831 - trixnz:error-428, r=jonathandturner
Browse files Browse the repository at this point in the history
Update E0428 to new format

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

r? @jonathandturner
  • Loading branch information
Jonathan Turner committed Aug 19, 2016
2 parents 2afa054 + 3b64cf6 commit 7f75382
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3382,7 +3382,11 @@ impl<'a> Resolver<'a> {
},
(true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg),
_ => match (old_binding.is_import(), binding.is_import()) {
(false, false) => struct_span_err!(self.session, span, E0428, "{}", msg),
(false, false) => {
let mut e = struct_span_err!(self.session, span, E0428, "{}", msg);
e.span_label(span, &format!("already defined"));
e
},
(true, true) => {
let mut e = struct_span_err!(self.session, span, E0252, "{}", msg);
e.span_label(span, &format!("already imported"));
Expand Down
7 changes: 5 additions & 2 deletions src/test/compile-fail/E0428.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

struct Bar;
struct Bar; //~ previous definition of `Bar` here
//~| previous definition of `Bar` here
struct Bar; //~ ERROR E0428
//~^ ERROR E0428
//~| NOTE already defined
//~| ERROR E0428
//~| NOTE already defined

fn main () {
}

0 comments on commit 7f75382

Please sign in to comment.