Closed
Description
cargo clippy -V
clippy 0.0.212 (52cebb1 2019-10-15)
Example code
#![warn(clippy::cast_sign_loss)]
fn main() {
let value = i64::min_value().checked_abs().unwrap_or(0) as u64;
assert_eq!(value, 0);
}
Problem
Clippy does warn, that the sign could be lost implicitly, even though it is done explicitly with checked_abs
, which either returns Some(positive i64)
or None
.
Expected behavior
Clippy should ignore this case.