diff --git a/library/compiler-builtins/src/int/mod.rs b/library/compiler-builtins/src/int/mod.rs index a94a070ca062..768b6b4c18f7 100755 --- a/library/compiler-builtins/src/int/mod.rs +++ b/library/compiler-builtins/src/int/mod.rs @@ -63,7 +63,7 @@ macro_rules! int_impl { fn extract_sign(self) -> (bool, $uty) { if self < 0 { - (true, !(self as $uty) + 1) + (true, (!(self as $uty)).wrapping_add(1)) } else { (false, self as $uty) }