about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <japaricious@gmail.com>2014-12-01 15:52:17 -0500
committerJorge Aparicio <japaricious@gmail.com>2014-12-13 20:15:38 -0500
commit65d3a40c07d1efae8039d3341a07ac748063fc79 (patch)
treeb51bce955970cc70c538c1e8180ca751b3f880c1
parentc73259a269c11ba9cb2917f9459204b7dcaa9646 (diff)
downloadrust-65d3a40c07d1efae8039d3341a07ac748063fc79.tar.gz
rust-65d3a40c07d1efae8039d3341a07ac748063fc79.zip
libcore: fix move semantics fallout
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/num/mod.rs4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index 8ee2a8874bb..5405c7aa3b7 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -2166,7 +2166,7 @@ impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
     #[inline]
     fn next(&mut self) -> Option<A> {
         let result = self.state.clone();
-        self.state = self.state + self.step;
+        self.state = self.state.clone() + self.step.clone();
         Some(result)
     }
 
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs
index 3c9b68b350b..2416cf5bcc7 100644
--- a/src/libcore/num/mod.rs
+++ b/src/libcore/num/mod.rs
@@ -37,8 +37,8 @@ use str::{FromStr, from_str, StrPrelude};
 /// Simultaneous division and remainder
 #[inline]
 #[deprecated = "use division and remainder directly"]
-pub fn div_rem<T: Div<T, T> + Rem<T, T>>(x: T, y: T) -> (T, T) {
-    (x / y, x % y)
+pub fn div_rem<T: Clone + Div<T, T> + Rem<T, T>>(x: T, y: T) -> (T, T) {
+    (x.clone() / y.clone(), x % y)
 }
 
 /// Raises a `base` to the power of `exp`, using exponentiation by squaring.