diff options
author | Robin Kruppe <robin.kruppe@gmail.com> | 2017-10-15 20:10:42 +0200 |
---|---|---|
committer | Robin Kruppe <robin.kruppe@gmail.com> | 2017-11-07 20:13:19 +0100 |
commit | 964ba2a6e731f79d99248d1f0e67eac17e69e368 (patch) | |
tree | 8e9d2ff0223ddf9bcb37e1e9b63fefbb78c0e965 /src/librustc_apfloat | |
parent | 0d6b52c2f3d442d3edfea31bcc439127a4757e5e (diff) | |
download | rust-964ba2a6e731f79d99248d1f0e67eac17e69e368.tar.gz |
Fix bug in rustc_apfloat
Diffstat (limited to 'src/librustc_apfloat')
-rw-r--r-- | src/librustc_apfloat/lib.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_apfloat/lib.rs b/src/librustc_apfloat/lib.rs index 9e348f62223..2048127222b 100644 --- a/src/librustc_apfloat/lib.rs +++ b/src/librustc_apfloat/lib.rs @@ -378,7 +378,7 @@ pub trait Float fn from_bits(input: u128) -> Self; fn from_i128_r(input: i128, round: Round) -> StatusAnd<Self> { if input < 0 { - Self::from_u128_r(-input as u128, -round).map(|r| -r) + Self::from_u128_r(input.wrapping_neg() as u128, -round).map(|r| -r) } else { Self::from_u128_r(input as u128, round) } |