]> git.lizzy.rs Git - rust.git/commit
mistyped_literal_suffixes: improve suggestions for integer types
authorgoth-turtle <93494392+goth-turtle@users.noreply.github.com>
Sat, 23 Apr 2022 20:20:50 +0000 (22:20 +0200)
committergoth-turtle <93494392+goth-turtle@users.noreply.github.com>
Sun, 24 Apr 2022 13:28:36 +0000 (15:28 +0200)
commitf2902494614643509685c3bf974287ac9844b2fd
tree5a4d310f5f675276759ace66699c02d0383182c3
parentcef882cc9dfae7980a1712609f8d00bfaf78062c
mistyped_literal_suffixes: improve suggestions for integer types

Instead of just always suggesting signed suffixes regardless of size
of the value, it now suggests an unsigned suffix when the value wouldn't
fit into the corresponding signed type, and ignores the literal entirely
if it is too big for the unsigned type as well.
clippy_lints/src/literal_representation.rs
tests/ui/mistyped_literal_suffix.fixed
tests/ui/mistyped_literal_suffix.rs
tests/ui/mistyped_literal_suffix.stderr