mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-15 09:27:25 +00:00
388e6b7854
mistyped_literal_suffix: improve integer suggestions, avoid wrong float suggestions This PR fixes 2 things: - The known problem that integer types are always suggested as signed, by suggesting an unsigned suffix for literals that wouldnt fit in the signed type, and ignores any literals too big for the corresponding unsigned type too. - The lint would only look at the integer part of any floating point literals without an exponent, this causing #6129. This just ignores those literals. Examples: ```rust let _ = 2_32; // still 2_i32 let _ = 234_8; // would now suggest 234_u8 // these are now ignored let _ = 500_8; let _ = 123_32.123; ``` changelog: suggest correct integer types in [`mistyped_literal_suffix`], ignore float literals without an exponent fixes #6129 |
||
---|---|---|
.. | ||
test_utils | ||
ui | ||
ui-cargo | ||
ui-internal | ||
ui-toml | ||
workspace_test | ||
check-fmt.rs | ||
clippy.toml | ||
compile-test.rs | ||
dogfood.rs | ||
integration.rs | ||
lint_message_convention.rs | ||
missing-test-files.rs | ||
versioncheck.rs | ||
workspace.rs |