-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Lint against leading 0 in integer literals #33448
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.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.
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.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.
Type
Fields
Give feedbackNo fields configured for issues without a type.
A literal like
0111looks like an octal literal in C, but is actually decimal in Rust (octal would be0o111). This is a footgun, and so seems like something that could be trivially checked for.(I suppose this could be a "clippy" lint, but that seems like it would lose most of the benefit: it seems to me that most people who encounter this will be just starting out, not invested in running external, third-party commands using nightly.)