diff --git a/src/libcompiler_builtins/lib.rs b/src/libcompiler_builtins/lib.rs index 482d70895ff..fb42b915c76 100644 --- a/src/libcompiler_builtins/lib.rs +++ b/src/libcompiler_builtins/lib.rs @@ -402,15 +402,16 @@ pub extern "C" fn u128_mul(a: i128, b: i128) -> i128 { } trait AbsExt: Sized { - fn uabs(self) -> u128 { - self.iabs() as u128 - } + fn uabs(self) -> u128; fn iabs(self) -> i128; } impl AbsExt for i128 { + fn uabs(self) -> u128 { + self.iabs() as u128 + } fn iabs(self) -> i128 { - let s = self >> 127; + let s = self.wrapping_shr(127); ((self ^ s).wrapping_sub(s)) } }