Skip to content

Commit f4083c6

Browse files
committed
Add the "consider importing it directly" label to public imports as well
1 parent 580c6a2 commit f4083c6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/librustc_resolve/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ impl<'a> Resolver<'a> {
987987
);
988988
let def_span = self.session.source_map().def_span(binding.span);
989989
let mut note_span = MultiSpan::from_span(def_span);
990-
if !first && next_binding.is_none() && binding.vis == ty::Visibility::Public {
990+
if !first && binding.vis == ty::Visibility::Public {
991991
note_span.push_span_label(def_span, "consider importing it directly".into());
992992
}
993993
err.span_note(note_span, &msg);

src/test/ui/imports/issue-55884-2.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ note: ...and refers to the struct import `ParseOptions` which is defined here...
1313
--> $DIR/issue-55884-2.rs:12:9
1414
|
1515
LL | pub use parser::ParseOptions;
16-
| ^^^^^^^^^^^^^^^^^^^^
16+
| ^^^^^^^^^^^^^^^^^^^^ consider importing it directly
1717
note: ...and refers to the struct import `ParseOptions` which is defined here...
1818
--> $DIR/issue-55884-2.rs:6:13
1919
|
2020
LL | pub use options::*;
21-
| ^^^^^^^^^^
21+
| ^^^^^^^^^^ consider importing it directly
2222
note: ...and refers to the struct `ParseOptions` which is defined here
2323
--> $DIR/issue-55884-2.rs:2:5
2424
|

0 commit comments

Comments
 (0)