Skip to content

Commit c536e17

Browse files
pnkfelixalexcrichton
authored andcommitted
Fix bug in wrapping_div
See discussion, albeit one-sided, in: rust-lang/rfcs#964
1 parent 143cf37 commit c536e17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libcore/num/wrapping.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ macro_rules! signed_overflowing_impl {
232232
#[inline(always)]
233233
fn overflowing_div(self, rhs: $t) -> ($t, bool) {
234234
if self == $t::MIN && rhs == -1 {
235-
(1, true)
235+
(self, true)
236236
} else {
237237
(self/rhs, false)
238238
}

0 commit comments

Comments
 (0)