Skip to content

Commit d6fc2ba

Browse files
committed
Update E0260 to new error format
Updates #35515. Part of #35233. r? @jonathandturner
1 parent 86dde9b commit d6fc2ba

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/librustc_resolve/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -3354,7 +3354,11 @@ impl<'a> Resolver<'a> {
33543354
e.span_label(span, &"already imported");
33553355
e
33563356
},
3357-
(true, _) | (_, true) => struct_span_err!(self.session, span, E0260, "{}", msg),
3357+
(true, _) | (_, true) => {
3358+
let mut e = struct_span_err!(self.session, span, E0260, "{}", msg);
3359+
e.span_label(span, &format!("`{}` already imported", name));
3360+
e
3361+
},
33583362
_ => match (old_binding.is_import(), binding.is_import()) {
33593363
(false, false) => {
33603364
let mut e = struct_span_err!(self.session, span, E0428, "{}", msg);

src/test/compile-fail/E0260.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@
99
// except according to those terms.
1010

1111
extern crate collections;
12+
//~^ NOTE previous import of `collections` here
1213

13-
mod collections { //~ ERROR E0260
14+
mod collections {
15+
//~^ ERROR `collections` has already been imported in this module [E0260]
16+
//~| NOTE `collections` already imported
1417
pub trait MyTrait {
1518
fn do_something();
1619
}

0 commit comments

Comments
 (0)