-
Notifications
You must be signed in to change notification settings - Fork 13.5k
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-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.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Given the following code:
mod a {
struct Foo;
}
mod b {
use crate::a::*;
type Bar = Foo;
}
The current output is:
error[E0412]: cannot find type `Foo` in this scope
--> src/lib.rs:7:16
|
7 | type Bar = Foo;
| ^^^ not found in this scope
|
help: consider importing this struct
|
6 | use crate::a::Foo;
|
warning: unused import: `crate::a::*`
--> src/lib.rs:6:9
|
6 | use crate::a::*;
| ^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
Ideally the output should look like:
error[E0412]: cannot find type `Foo` in this scope
--> src/lib.rs:7:16
|
7 | type Bar = Foo;
| ^^^ not found in this scope
|
Note: Foo imported [here], but cannot be imported as it is defined as private [here]
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-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.D-confusingDiagnostics: Confusing error or lint that should be reworked.Diagnostics: Confusing error or lint that should be reworked.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.