Skip to content

Commit 9c3ba76

Browse files
committed
Auto merge of #26885 - mvdnes:wrapping_div, r=alexcrichton
Resolves #26867
2 parents 66b9277 + a89b3ea commit 9c3ba76

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/libcore/num/wrapping.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,16 @@ macro_rules! wrapping_impl {
119119
}
120120
}
121121

122+
#[stable(feature = "wrapping_div", since = "1.3.0")]
123+
impl Div for Wrapping<$t> {
124+
type Output = Wrapping<$t>;
125+
126+
#[inline(always)]
127+
fn div(self, other: Wrapping<$t>) -> Wrapping<$t> {
128+
Wrapping(self.0.wrapping_div(other.0))
129+
}
130+
}
131+
122132
#[stable(feature = "rust1", since = "1.0.0")]
123133
impl Not for Wrapping<$t> {
124134
type Output = Wrapping<$t>;

0 commit comments

Comments
 (0)