diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-07-04 05:47:25 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-04 05:47:25 +0200 |
| commit | 7c68a8db3e069907d3c93bb7e6cee0cafb003d4f (patch) | |
| tree | 5727ef9b33dd2eb48c41c1939a5565be8da7dd3f | |
| parent | 25eb32598942a8fbd3b7cb67e8651ed4fa09d163 (diff) | |
| parent | d9505f0b321e85c47a6f12ee97cd86e0750d4174 (diff) | |
| download | rust-7c68a8db3e069907d3c93bb7e6cee0cafb003d4f.tar.gz rust-7c68a8db3e069907d3c93bb7e6cee0cafb003d4f.zip | |
Rollup merge of #143356 - hkBst:clippy-fix-2, r=scottmcm
use unsigned_abs instead of `abs` on signed int to silence clippy Use `unsigned_abs` instead of `abs` on signed int to silence clippy. Alternatively we could allow the lint, but if codegen is not affected, then this seems preferable.
| -rw-r--r-- | library/core/src/num/uint_macros.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs index 079032f2f96..9cadbd47ab6 100644 --- a/library/core/src/num/uint_macros.rs +++ b/library/core/src/num/uint_macros.rs @@ -2572,7 +2572,7 @@ macro_rules! uint_impl { if size_of::<Self>() == 1 { // Trick LLVM into generating the psadbw instruction when SSE2 // is available and this function is autovectorized for u8's. - (self as i32).wrapping_sub(other as i32).abs() as Self + (self as i32).wrapping_sub(other as i32).unsigned_abs() as Self } else { if self < other { other - self |
