Fix bug in wrapping_div
See discussion, albeit one-sided, in: https://github.com/rust-lang/rfcs/issues/964
This commit is contained in:
parent
4991c7acad
commit
d8122ee87d
1 changed files with 1 additions and 1 deletions
|
@ -232,7 +232,7 @@ macro_rules! signed_overflowing_impl {
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn overflowing_div(self, rhs: $t) -> ($t, bool) {
|
fn overflowing_div(self, rhs: $t) -> ($t, bool) {
|
||||||
if self == $t::MIN && rhs == -1 {
|
if self == $t::MIN && rhs == -1 {
|
||||||
(1, true)
|
(self, true)
|
||||||
} else {
|
} else {
|
||||||
(self/rhs, false)
|
(self/rhs, false)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue