Euclidean operations combined with sign casting cannot result in loss of a sign #4818
Labels
C-bug
Category: Clippy is not doing the correct thing
C-enhancement
Category: Enhancement of lints, like adding more cases or adding help messages
good-first-issue
These issues are a good way to get started with Clippy
.rem_euclid
and.div_euclid
always results in a non-negative value, so casting to the same or larger size (except unsigned) should be allowed.There are also checked versions of these functions (
.checked_rem_euclid
and.checked_div_euclid
) which should also be handled.Version:
clippy 0.0.212 (c8e3cfb 2019-10-28)
Related: #4605 (
.abs
), #4743 (.checked_abs
)The text was updated successfully, but these errors were encountered: