Skip to content

Commit

Permalink
Rollup merge of rust-lang#36100 - 0xmohit:pr/error-code-E0260, r=jona…
Browse files Browse the repository at this point in the history
…thandturner

Update E0260 to new error format

Updates rust-lang#35515.
Part of rust-lang#35233.

r? @jonathandturner
  • Loading branch information
GuillaumeGomez committed Aug 30, 2016
2 parents 1a61371 + d6fc2ba commit 282f111
Show file tree
Hide file tree
Showing 2 changed files with 9 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 @@ -3354,7 +3354,11 @@ impl<'a> Resolver<'a> {
e.span_label(span, &"already imported");
e
},
(true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg),
(true, _) | (_, true) => {
let mut e = struct_span_err!(self.session, span, E0260, "{}", msg);
e.span_label(span, &format!("`{}` already imported", name));
e
},
_ => match (old_binding.is_import(), binding.is_import()) {
(false, false) => {
let mut e = struct_span_err!(self.session, span, E0428, "{}", msg);
Expand Down
5 changes: 4 additions & 1 deletion src/test/compile-fail/E0260.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@
// except according to those terms.

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

mod collections { //~ ERROR E0260
mod collections {
//~^ ERROR `collections` has already been imported in this module [E0260]
//~| NOTE `collections` already imported
pub trait MyTrait {
fn do_something();
}
Expand Down

0 comments on commit 282f111

Please sign in to comment.