diff options
| author | bors <bors@rust-lang.org> | 2015-07-09 07:13:14 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-07-09 07:13:14 +0000 |
| commit | 9c3ba763891b0fe626adefc19ad7908b0862a41c (patch) | |
| tree | 7d6aa9faf86894f3fee8cab3f32923aee119629a /src | |
| parent | 66b9277b1364b130aed260ac219c1fe58eb02df2 (diff) | |
| parent | a89b3ea3fcf1cd4b24f86d223fcc8f09c0ea75a3 (diff) | |
| download | rust-9c3ba763891b0fe626adefc19ad7908b0862a41c.tar.gz rust-9c3ba763891b0fe626adefc19ad7908b0862a41c.zip | |
Auto merge of #26885 - mvdnes:wrapping_div, r=alexcrichton
Resolves #26867
Diffstat (limited to 'src')
| -rw-r--r-- | src/libcore/num/wrapping.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/num/wrapping.rs b/src/libcore/num/wrapping.rs index 748ed29e3a3..2e3b34af513 100644 --- a/src/libcore/num/wrapping.rs +++ b/src/libcore/num/wrapping.rs @@ -119,6 +119,16 @@ macro_rules! wrapping_impl { } } + #[stable(feature = "wrapping_div", since = "1.3.0")] + impl Div for Wrapping<$t> { + type Output = Wrapping<$t>; + + #[inline(always)] + fn div(self, other: Wrapping<$t>) -> Wrapping<$t> { + Wrapping(self.0.wrapping_div(other.0)) + } + } + #[stable(feature = "rust1", since = "1.0.0")] impl Not for Wrapping<$t> { type Output = Wrapping<$t>; |
