about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-07-09 07:13:14 +0000
committerbors <bors@rust-lang.org>2015-07-09 07:13:14 +0000
commit9c3ba763891b0fe626adefc19ad7908b0862a41c (patch)
tree7d6aa9faf86894f3fee8cab3f32923aee119629a /src
parent66b9277b1364b130aed260ac219c1fe58eb02df2 (diff)
parenta89b3ea3fcf1cd4b24f86d223fcc8f09c0ea75a3 (diff)
downloadrust-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.rs10
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>;