Skip to content

Commit

Permalink
Rollup merge of rust-lang#35596 - crypto-universe:E0254_style_and_tes…
Browse files Browse the repository at this point in the history
…ts, r=jonathandturner

Add label to E0254

This issue rust-lang#35513 is a part of rust-lang#35233.
r? @jonathandturner
  • Loading branch information
Jonathan Turner committed Aug 13, 2016
2 parents d58a53d + c761184 commit 229b98d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3374,8 +3374,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) if binding.is_import() || old_binding.is_import() =>
struct_span_err!(self.session, span, E0254, "{}", msg),
(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");
e
},
(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),
Expand Down
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0254.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@
// except according to those terms.

extern crate collections;
//~^ NOTE previous import of `collections` here

mod foo {
pub trait collections {
fn do_something();
}
}

use foo::collections; //~ ERROR E0254
use foo::collections;
//~^ ERROR E0254
//~| NOTE already imported

fn main() {}

0 comments on commit 229b98d

Please sign in to comment.