-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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.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
mod foo {
use bar::A;
mod bar {
pub struct A {}
}
}
use foo::A;
fn main() {}
Produces the error:
error[E0603]: struct `A` is private
--> src/main.rs:9:10
|
9 | use foo::A;
| ^
It would be great if the error message said why the pub struct 'A' is private.
For example something like this:
error[E0603]: struct `A` is private because it is not exported by module foo
This would remove the head scratching time as one looks at the definition of the struct and sees the pub
visibility modifier.
kornelski
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-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.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.