about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarijn Schouten <mhkbst@gmail.com>2025-07-03 09:20:57 +0000
committerMarijn Schouten <mhkbst@gmail.com>2025-07-03 09:20:57 +0000
commitd9505f0b321e85c47a6f12ee97cd86e0750d4174 (patch)
tree633e757d16010d2f4b60389fd17f117d7b8069c0
parentf51c9870bab634afb9e7a262b6ca7816bb9e940d (diff)
downloadrust-d9505f0b321e85c47a6f12ee97cd86e0750d4174.tar.gz
rust-d9505f0b321e85c47a6f12ee97cd86e0750d4174.zip
use unsigned_abs instead of `abs` on signed int to silence clippy
-rw-r--r--library/core/src/num/uint_macros.rs2
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