Skip to content

Commit d4ca561

Browse files
author
Eugene R Gonzalez
committed
Change E0259 to the new error format
Fixed E0259 unit test Added name of conflict to E0259's note
1 parent 7ac11ca commit d4ca561

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/librustc_resolve/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3366,7 +3366,11 @@ impl<'a> Resolver<'a> {
33663366
};
33673367

33683368
let mut err = match (old_binding.is_extern_crate(), binding.is_extern_crate()) {
3369-
(true, true) => struct_span_err!(self.session, span, E0259, "{}", msg),
3369+
(true, true) => {
3370+
let mut e = struct_span_err!(self.session, span, E0259, "{}", msg);
3371+
e.span_label(span, &format!("`{}` was already imported", name));
3372+
e
3373+
},
33703374
(true, _) | (_, true) if binding.is_import() || old_binding.is_import() => {
33713375
let mut e = struct_span_err!(self.session, span, E0254, "{}", msg);
33723376
e.span_label(span, &"already imported");

src/test/compile-fail/E0259.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
// except according to those terms.
1010

1111
extern crate collections;
12-
extern crate libc as collections; //~ ERROR E0259
12+
//~^ NOTE previous import of `collections` here
13+
14+
extern crate libc as collections;
15+
//~^ ERROR E0259
16+
//~| NOTE `collections` was already imported
1317

1418
fn main() {}

0 commit comments

Comments
 (0)