Skip to content

Lint against leading 0 in integer literals #33448

@huonw

Description

@huonw

A literal like 0111 looks 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.)

Metadata

Metadata

Assignees

Labels

A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-feature-requestCategory: A feature request, i.e: not implemented / a PR.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions