Skip to content

Commit

Permalink
Add the "consider importing it directly" label to public imports as well
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Mar 11, 2020
1 parent 580c6a2 commit f4083c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/imports/issue-55884-2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
Expand Down

0 comments on commit f4083c6

Please sign in to comment.