From d8122ee87d48f0422adf96e568912fe93da27ac7 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Tue, 14 Apr 2015 18:44:14 +0200 Subject: [PATCH] Fix bug in `wrapping_div` See discussion, albeit one-sided, in: https://github.com/rust-lang/rfcs/issues/964 --- src/libcore/num/wrapping.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index 3ce2851f8e2f4..aa84708816b87 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -232,7 +232,7 @@ macro_rules! signed_overflowing_impl { #[inline(always)] fn overflowing_div(self, rhs: $t) -> ($t, bool) { if self == $t::MIN && rhs == -1 { - (1, true) + (self, true) } else { (self/rhs, false) }