-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
rustc incorrectly suggests a pub(crate) on an enum variant or trait item is "unnecessary", implying it is permitted #109822
Copy link
Copy link
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-visibilityArea: Visibility / privacyArea: Visibility / privacyD-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-visibilityArea: Visibility / privacyArea: Visibility / privacyD-incorrectDiagnostics: A diagnostic that is giving misleading or incorrect information.Diagnostics: A diagnostic that is giving misleading or incorrect information.E-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
See https://godbolt.org/z/8bWh445hh
Given
I get
rustc correctly describes these as "unnecessary" when they are a plain
pub:rustc should instead state that non-
pubvisibility qualifiers are not permitted, rather than being unnecessary. I suggest a diagnostic like(There is a similar diagnostic bug around putting
pub(crate)orpub(self)on trait items.)