-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
RFC: Forbid pub and priv in positions where they do not change the default behavior #5495
Copy link
Copy link
Closed
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-grammarArea: The grammar of RustArea: The grammar of RustA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Metadata
Metadata
Assignees
Labels
A-frontendArea: Compiler frontend (errors, parsing and HIR)Area: Compiler frontend (errors, parsing and HIR)A-grammarArea: The grammar of RustArea: The grammar of RustA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.Call for participation: An issue has been fixed and does not reproduce, but no test has been added.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Right now structs are private-by-default and struct fields are public-by-default. And yet this is legal:
The
pubandprivdeclarations there are meaningless. Allowing them in those positions will increase confusion over what the defaults actually are. I propose that this be forbidden.