From e8d90fbe7467575a798551ef031840b7b990f585 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Sat, 4 Mar 2017 12:33:40 +0200 Subject: [PATCH] Beta backport of #40254 --- src/libcompiler_builtins/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libcompiler_builtins/lib.rs b/src/libcompiler_builtins/lib.rs index 662d7422f5f00..69ec99bb83f4e 100644 --- a/src/libcompiler_builtins/lib.rs +++ b/src/libcompiler_builtins/lib.rs @@ -468,14 +468,15 @@ pub mod reimpls { } trait AbsExt: Sized { - fn uabs(self) -> u128_ { - self.iabs() as u128_ - } + fn uabs(self) -> u128_; fn iabs(self) -> i128_; } #[cfg(stage0)] impl AbsExt for i128_ { + fn uabs(self) -> u128_ { + self.iabs() as u128_ + } fn iabs(self) -> i128_ { let s = self >> 63; ((self ^ s).wrapping_sub(s)) @@ -484,6 +485,9 @@ pub mod reimpls { #[cfg(not(stage0))] impl AbsExt for i128_ { + fn uabs(self) -> u128_ { + self.iabs() as u128_ + } fn iabs(self) -> i128_ { let s = self >> 127; ((self ^ s).wrapping_sub(s))