Rollup merge of #35596 - crypto-universe:E0254_style_and_tests, r=jonathandturner
Add label to E0254 This issue #35513 is a part of #35233. r? @jonathandturner
This commit is contained in:
commit
812a8c1e33
@ -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),
|
||||
|
@ -9,6 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
extern crate collections;
|
||||
//~^ NOTE previous import of `collections` here
|
||||
|
||||
mod foo {
|
||||
pub trait collections {
|
||||
@ -16,6 +17,8 @@ mod foo {
|
||||
}
|
||||
}
|
||||
|
||||
use foo::collections; //~ ERROR E0254
|
||||
use foo::collections;
|
||||
//~^ ERROR E0254
|
||||
//~| NOTE already imported
|
||||
|
||||
fn main() {}
|
||||
|
Loading…
Reference in New Issue
Block a user