-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
For this code:
mod foo {
pub struct B(());
}
mod bar {
use foo::B;
fn foo() {
B(());
}
}
You get the following error message:
error[E0423]: expected function, found struct `B`
--> <anon>:7:9
|
7 | B(());
| ^
| |
| did you mean `B { /* fields */ }`?
| constructor is not visible here due to private fields
|
help: possible better candidate is found in another module, you can import it into scope
| use foo::B;
The suggestion may be excused to be not 100% perfect, but here it suggests to add an use statement despite that same item being imported already. What I want is this exactly: that it removes stuff from the suggestion list that is already being imported.
Note that changing the glob import to a non glob one doesn't change anything.
estebank
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyArea: Name/path resolution done by `rustc_resolve` specificallyA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`Area: Suggestions generated by the compiler applied by `cargo fix`A-visibilityArea: Visibility / privacyArea: Visibility / privacyC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.