-
-
Notifications
You must be signed in to change notification settings - Fork 17.3k
type parameters expect camel case, but shouting case is also common #60570
Copy link
Copy link
Open
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.T-langRelevant to the language teamRelevant to the language team
Description
Activity
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.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.T-langRelevant to the language teamRelevant to the language team
I am not sure why type parameters are checked to be upper camel case.
Type parameter names are not part of public API. Shouting case for type parameters is a convention followed by such popular crates as rayon, and it is the only way I know of to make something like the following not look confusing:
Furthermore, due to limitations of the check for upper camel case, you could write a whole crate using shouting case and not even know about the lint, because it will only hit you when you write an underscore:
Given how rarely underscores should be needed, it's tempting to just change this to
INTEGER1so that it slips by unnoticed like the rest of the crate.