about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-23 11:11:23 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-23 12:10:03 -0700
commit11e92f37c13194ad5c1f82a980e7f7ee02345801 (patch)
treea9fbae3cf8682a6f7cdd92e2b6aba65856be82b4 /src/libstd
parent804c608f0166c90dcf04e5d00b48cc4d5c9e9d3c (diff)
Remove uses of binary move - <- - from tests and libraries
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/arc.rs12
-rw-r--r--src/libstd/map.rs2
-rw-r--r--src/libstd/sort.rs44
-rw-r--r--src/libstd/sync.rs2
4 files changed, 30 insertions, 30 deletions
diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs
index 9c793028a52..2f4c9a4eb06 100644
--- a/src/libstd/arc.rs
+++ b/src/libstd/arc.rs
@@ -99,7 +99,7 @@ pub fn clone<T: Const Send>(rc: &ARC<T>) -> ARC<T> {
  * guaranteed to deadlock.
  */
 fn unwrap<T: Const Send>(rc: ARC<T>) -> T {
-    let ARC { x: x } <- rc;
+    let ARC { x: x } = move rc;
     unsafe { unwrap_shared_mutable_state(move x) }
 }
 
@@ -192,9 +192,9 @@ impl<T: Send> &MutexARC<T> {
  */
 // FIXME(#3724) make this a by-move method on the arc
 pub fn unwrap_mutex_arc<T: Send>(arc: MutexARC<T>) -> T {
-    let MutexARC { x: x } <- arc;
+    let MutexARC { x: x } = move arc;
     let inner = unsafe { unwrap_shared_mutable_state(move x) };
-    let MutexARCInner { failed: failed, data: data, _ } <- inner;
+    let MutexARCInner { failed: failed, data: data, _ } = move inner;
     if failed {
         fail ~"Can't unwrap poisoned MutexARC - another task failed inside!"
     }
@@ -347,7 +347,7 @@ impl<T: Const Send> &RWARC<T> {
     fn downgrade(token: RWWriteMode/&a<T>) -> RWReadMode/&a<T> {
         // The rwlock should assert that the token belongs to us for us.
         let state = unsafe { get_shared_immutable_state(&self.x) };
-        let RWWriteMode((data, t, _poison)) <- token;
+        let RWWriteMode((data, t, _poison)) = move token;
         // Let readers in
         let new_token = (&state.lock).downgrade(move t);
         // Whatever region the input reference had, it will be safe to use
@@ -370,9 +370,9 @@ impl<T: Const Send> &RWARC<T> {
  */
 // FIXME(#3724) make this a by-move method on the arc
 pub fn unwrap_rw_arc<T: Const Send>(arc: RWARC<T>) -> T {
-    let RWARC { x: x, _ } <- arc;
+    let RWARC { x: x, _ } = move arc;
     let inner = unsafe { unwrap_shared_mutable_state(move x) };
-    let RWARCInner { failed: failed, data: data, _ } <- inner;
+    let RWARCInner { failed: failed, data: data, _ } = move inner;
     if failed {
         fail ~"Can't unwrap poisoned RWARC - another task failed inside!"
     }
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index e49f1abd02b..0ee7cb6fcf9 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -173,7 +173,7 @@ pub mod chained {
                 entry.next = new_chains[idx];
                 new_chains[idx] = Some(entry);
             }
-            self.chains <- new_chains;
+            self.chains = move new_chains;
         }
 
         pure fn each_entry(blk: fn(@Entry<K,V>) -> bool) {
diff --git a/src/libstd/sort.rs b/src/libstd/sort.rs
index 0b00da9f81d..8c8971b7eb7 100644
--- a/src/libstd/sort.rs
+++ b/src/libstd/sort.rs
@@ -15,7 +15,7 @@ type Le<T> = pure fn(v1: &T, v2: &T) -> bool;
 pub fn merge_sort<T: Copy>(le: Le<T>, v: &[const T]) -> ~[T] {
     type Slice = (uint, uint);
 
-    return merge_sort_(le, v, (0u, len(v)));
+    return merge_sort_(le, v, (0, len(v)));
 
     fn merge_sort_<T: Copy>(le: Le<T>, v: &[const T], slice: Slice)
         -> ~[T] {
@@ -23,10 +23,10 @@ pub fn merge_sort<T: Copy>(le: Le<T>, v: &[const T]) -> ~[T] {
         let end = slice.second();
 
         let v_len = end - begin;
-        if v_len == 0u { return ~[]; }
-        if v_len == 1u { return ~[v[begin]]; }
+        if v_len == 0 { return ~[]; }
+        if v_len == 1 { return ~[v[begin]]; }
 
-        let mid = v_len / 2u + begin;
+        let mid = v_len / 2 + begin;
         let a = (begin, mid);
         let b = (mid, end);
         return merge(le, merge_sort_(le, v, a), merge_sort_(le, v, b));
@@ -35,14 +35,14 @@ pub fn merge_sort<T: Copy>(le: Le<T>, v: &[const T]) -> ~[T] {
     fn merge<T: Copy>(le: Le<T>, a: &[T], b: &[T]) -> ~[T] {
         let mut rs = vec::with_capacity(len(a) + len(b));
         let a_len = len(a);
-        let mut a_ix = 0u;
+        let mut a_ix = 0;
         let b_len = len(b);
-        let mut b_ix = 0u;
+        let mut b_ix = 0;
         while a_ix < a_len && b_ix < b_len {
             if le(&a[a_ix], &b[b_ix]) {
                 rs.push(a[a_ix]);
-                a_ix += 1u;
-            } else { rs.push(b[b_ix]); b_ix += 1u; }
+                a_ix += 1;
+            } else { rs.push(b[b_ix]); b_ix += 1; }
         }
         rs = vec::append(rs, vec::slice(a, a_ix, a_len));
         rs = vec::append(rs, vec::slice(b, b_ix, b_len));
@@ -59,9 +59,9 @@ fn part<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
     while i < right {
         if compare_func(&arr[i], &pivot_value) {
             arr[i] <-> arr[storage_index];
-            storage_index += 1u;
+            storage_index += 1;
         }
-        i += 1u;
+        i += 1;
     }
     arr[storage_index] <-> arr[right];
     return storage_index;
@@ -70,13 +70,13 @@ fn part<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
 fn qsort<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
              right: uint) {
     if right > left {
-        let pivot = (left + right) / 2u;
+        let pivot = (left + right) / 2;
         let new_pivot = part::<T>(compare_func, arr, left, right, pivot);
-        if new_pivot != 0u {
+        if new_pivot != 0 {
             // Need to do this check before recursing due to overflow
-            qsort::<T>(compare_func, arr, left, new_pivot - 1u);
+            qsort::<T>(compare_func, arr, left, new_pivot - 1);
         }
-        qsort::<T>(compare_func, arr, new_pivot + 1u, right);
+        qsort::<T>(compare_func, arr, new_pivot + 1, right);
     }
 }
 
@@ -87,8 +87,8 @@ fn qsort<T: Copy>(compare_func: Le<T>, arr: &[mut T], left: uint,
  * This is an unstable sort.
  */
 pub fn quick_sort<T: Copy>(compare_func: Le<T>, arr: &[mut T]) {
-    if len::<T>(arr) == 0u { return; }
-    qsort::<T>(compare_func, arr, 0u, len::<T>(arr) - 1u);
+    if len::<T>(arr) == 0 { return; }
+    qsort::<T>(compare_func, arr, 0, len::<T>(arr) - 1);
 }
 
 fn qsort3<T: Copy Ord Eq>(arr: &[mut T], left: int, right: int) {
@@ -167,11 +167,11 @@ mod test_qsort3 {
     fn check_sort(v1: &[mut int], v2: &[mut int]) {
         let len = vec::len::<int>(v1);
         quick_sort3::<int>(v1);
-        let mut i = 0u;
+        let mut i = 0;
         while i < len {
             log(debug, v2[i]);
             assert (v2[i] == v1[i]);
-            i += 1u;
+            i += 1;
         }
     }
 
@@ -208,11 +208,11 @@ mod test_qsort {
         let len = vec::len::<int>(v1);
         pure fn leual(a: &int, b: &int) -> bool { *a <= *b }
         quick_sort::<int>(leual, v1);
-        let mut i = 0u;
+        let mut i = 0;
         while i < len {
             log(debug, v2[i]);
             assert (v2[i] == v1[i]);
-            i += 1u;
+            i += 1;
         }
     }
 
@@ -270,11 +270,11 @@ mod tests {
         pub pure fn le(a: &int, b: &int) -> bool { *a <= *b }
         let f = le;
         let v3 = merge_sort::<int>(f, v1);
-        let mut i = 0u;
+        let mut i = 0;
         while i < len {
             log(debug, v3[i]);
             assert (v3[i] == v2[i]);
-            i += 1u;
+            i += 1;
         }
     }
 
diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs
index 73fc78a091a..43d1c9664a5 100644
--- a/src/libstd/sync.rs
+++ b/src/libstd/sync.rs
@@ -768,7 +768,7 @@ mod tests {
     #[test]
     fn test_mutex_lock() {
         // Unsafely achieve shared state, and do the textbook
-        // "load tmp <- ptr; inc tmp; store ptr <- tmp" dance.
+        // "load tmp = move ptr; inc tmp; store ptr <- tmp" dance.
         let (c,p) = pipes::stream();
         let m = ~Mutex();
         let m2 = ~m.clone();