rustc incorrectly suggests a pub(crate)
on an enum variant or trait item is "unnecessary", implying it is permitted
#109822
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-visibility
Area: Visibility / privacy
D-incorrect
Diagnostics: A diagnostic that is giving misleading or incorrect information.
E-medium
Call for participation: Medium difficulty. Experience needed to fix: Intermediate.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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-
pub
visibility 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.)The text was updated successfully, but these errors were encountered: