about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorMathijs van de Nes <git@mathijs.vd-nes.nl>2015-07-08 15:02:18 +0200
committerMathijs van de Nes <git@mathijs.vd-nes.nl>2015-07-08 15:02:18 +0200
commite333a57a1952bca66e8063f80d3b6915b90db06b (patch)
treeaef44f9ae4682a4df2dc303d4983bed44e67d96f /src/libcore
parentfd8e175c4e39537b16beb40c704a17fcf9796852 (diff)
downloadrust-e333a57a1952bca66e8063f80d3b6915b90db06b.tar.gz
rust-e333a57a1952bca66e8063f80d3b6915b90db06b.zip
Implement Div for Wrapping<T>
Resolves #26867
Diffstat (limited to 'src/libcore')
-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..1636a1e2703 100644
--- a/src/libcore/num/wrapping.rs
+++ b/src/libcore/num/wrapping.rs
@@ -119,6 +119,16 @@ macro_rules! wrapping_impl {
             }
         }
 
+        #[stable(feature = "rust1", 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 / other.0)
+            }
+        }
+
         #[stable(feature = "rust1", since = "1.0.0")]
         impl Not for Wrapping<$t> {
             type Output = Wrapping<$t>;