Lint integer variable fallback to i32 #6634
Labels
A-lint
Area: New lints
good-first-issue
These issues are a good way to get started with Clippy
T-middle
Type: Probably requires verifiying types
From https://stackoverflow.com/questions/65867874/how-to-deny-int-variable-without-explicit-type-annotation-in-rust?noredirect=1#comment116458771_65867874
Related: https://github.com/rust-lang/rfcs/blob/master/text/0212-restore-int-fallback.md
What it does
Reports integer variable fallback to i32, e.g.
The below code should also be accepted because the variable is inferred though it is not annotated:
Categories (optional)
maybe
pedantic
What is the advantage of the recommended code over the original code
I want this lint rule because it can cause overflow unintendedly:
Drawbacks
May feel tedious
Example
Could be written as:
The text was updated successfully, but these errors were encountered: