1
Fork 0

Add the "consider importing it directly" label to public imports as well

This commit is contained in:
Vadim Petrochenkov 2020-03-11 21:17:23 +03:00
parent 580c6a29d4
commit f4083c6455
2 changed files with 3 additions and 3 deletions

View file

@ -987,7 +987,7 @@ impl<'a> Resolver<'a> {
);
let def_span = self.session.source_map().def_span(binding.span);
let mut note_span = MultiSpan::from_span(def_span);
if !first && next_binding.is_none() && binding.vis == ty::Visibility::Public {
if !first && binding.vis == ty::Visibility::Public {
note_span.push_span_label(def_span, "consider importing it directly".into());
}
err.span_note(note_span, &msg);

View file

@ -13,12 +13,12 @@ note: ...and refers to the struct import `ParseOptions` which is defined here...
--> $DIR/issue-55884-2.rs:12:9
|
LL | pub use parser::ParseOptions;
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^ consider importing it directly
note: ...and refers to the struct import `ParseOptions` which is defined here...
--> $DIR/issue-55884-2.rs:6:13
|
LL | pub use options::*;
| ^^^^^^^^^^
| ^^^^^^^^^^ consider importing it directly
note: ...and refers to the struct `ParseOptions` which is defined here
--> $DIR/issue-55884-2.rs:2:5
|