From 11e92f37c13194ad5c1f82a980e7f7ee02345801 Mon Sep 17 00:00:00 2001 From: Tim Chevalier Date: Tue, 23 Oct 2012 11:11:23 -0700 Subject: [PATCH] Remove uses of binary move - <- - from tests and libraries --- src/fuzzer/ivec_fuzz.rs | 2 +- src/libcore/dvec.rs | 12 ++--- src/libcore/io.rs | 2 +- src/libcore/iter.rs | 2 +- src/libcore/option.rs | 2 +- src/libcore/pipes.rs | 6 +-- src/libcore/private.rs | 4 +- src/libcore/str.rs | 2 +- src/libcore/task/spawn.rs | 10 ++--- src/libcore/util.rs | 2 +- src/libcore/vec.rs | 22 +++++----- src/libstd/arc.rs | 12 ++--- src/libstd/map.rs | 2 +- src/libstd/sort.rs | 44 +++++++++---------- src/libstd/sync.rs | 2 +- src/test/bench/core-std.rs | 1 + src/test/bench/msgsend-pipes-shared.rs | 2 +- src/test/bench/msgsend-pipes.rs | 2 +- src/test/bench/msgsend-ring-mutex-arcs.rs | 4 +- src/test/bench/msgsend-ring-pipes.rs | 6 +-- src/test/bench/msgsend-ring-rw-arcs.rs | 4 +- src/test/bench/pingpong.rs | 2 +- .../bench/task-perf-word-count-generic.rs | 2 +- .../compile-fail/block-deinitializes-upvar.rs | 2 +- .../compile-fail/borrowck-issue-2657-1.rs | 2 +- .../compile-fail/borrowck-issue-2657-2.rs | 2 +- .../borrowck-move-from-unsafe-ptr.rs | 2 +- .../borrowck-no-cycle-in-exchange-heap.rs | 2 +- src/test/compile-fail/copy-a-resource.rs | 2 +- src/test/compile-fail/issue-2548.rs | 2 +- .../compile-fail/liveness-move-in-loop.rs | 5 ++- .../compile-fail/liveness-move-in-while.rs | 5 ++- .../compile-fail/liveness-use-after-move.rs | 2 +- src/test/compile-fail/noncopyable-class.rs | 2 +- src/test/compile-fail/obsolete-syntax.rs | 8 ++++ src/test/compile-fail/unique-pinned-nocopy.rs | 2 +- src/test/compile-fail/unique-vec-res.rs | 4 +- src/test/compile-fail/vec-res-add.rs | 4 +- src/test/run-fail/unwind-resource-fail.rs | 2 +- src/test/run-fail/unwind-resource-fail2.rs | 2 +- .../borrowck-move-from-unsafe-ptr-ok.rs | 2 +- src/test/run-pass/borrowck-mut-uniq.rs | 2 +- src/test/run-pass/import-glob-1.rs | 6 +-- src/test/run-pass/init-res-into-things.rs | 12 ++--- src/test/run-pass/issue-2185.rs | 4 +- src/test/run-pass/issue-2718.rs | 6 +-- src/test/run-pass/move-1-unique.rs | 2 +- src/test/run-pass/move-1.rs | 2 +- src/test/run-pass/move-2-unique.rs | 2 +- src/test/run-pass/move-2.rs | 2 +- src/test/run-pass/move-3-unique.rs | 2 +- src/test/run-pass/move-3.rs | 2 +- src/test/run-pass/move-4-unique.rs | 6 +-- src/test/run-pass/move-4.rs | 6 +-- src/test/run-pass/move-scalar.rs | 2 +- src/test/run-pass/pipe-bank-proto.rs | 2 +- src/test/run-pass/resource-destruct.rs | 2 +- src/test/run-pass/resource-generic.rs | 2 +- src/test/run-pass/unique-decl-move-temp.rs | 2 +- src/test/run-pass/unique-decl-move.rs | 2 +- src/test/run-pass/unique-move-drop.rs | 2 +- src/test/run-pass/unique-move-temp.rs | 2 +- src/test/run-pass/unique-move.rs | 2 +- src/test/run-pass/unreachable-code-1.rs | 2 +- src/test/run-pass/unreachable-code.rs | 2 +- src/test/run-pass/unwind-resource.rs | 2 +- src/test/run-pass/unwind-resource2.rs | 2 +- src/test/run-pass/weird-exprs.rs | 4 +- src/test/run-pass/while-loop-constraints-2.rs | 2 +- 69 files changed, 151 insertions(+), 136 deletions(-) diff --git a/src/fuzzer/ivec_fuzz.rs b/src/fuzzer/ivec_fuzz.rs index 49d34e76992..f6133b8f954 100644 --- a/src/fuzzer/ivec_fuzz.rs +++ b/src/fuzzer/ivec_fuzz.rs @@ -2,7 +2,7 @@ Idea: provide functions for 'exhaustive' and 'random' modification of vecs. - two functions, "return all edits" and "return a random edit" <-- + two functions, "return all edits" and "return a random edit" = move- leaning toward this model or two functions, "return the number of possible edits" and "return edit #n" diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs index 1b6a7522864..e01e3fea3e1 100644 --- a/src/libcore/dvec.rs +++ b/src/libcore/dvec.rs @@ -72,7 +72,7 @@ pub fn from_vec(v: ~[A]) -> DVec { /// Consumes the vector and returns its contents pub fn unwrap(d: DVec) -> ~[A] { - let DVec_({data: v}) <- d; + let DVec_({data: v}) = move d; move v } @@ -150,13 +150,13 @@ impl DVec { /// Overwrite the current contents fn set(w: ~[A]) { self.check_not_borrowed(); - self.data <- w; + self.data = move w; } /// Remove and return the last element fn pop() -> A { do self.check_out |v| { - let mut v <- v; + let mut v = move v; let result = v.pop(); self.give_back(move v); move result @@ -171,7 +171,7 @@ impl DVec { let data_ptr: *() = cast::reinterpret_cast(&data); if data_ptr.is_null() { fail ~"Recursive use of dvec"; } log(error, ~"a"); - self.data <- ~[move t]; + self.data = move ~[move t]; self.data.push_all_move(move data); log(error, ~"b"); } @@ -235,7 +235,7 @@ impl DVec { /// Appends elements from `from_idx` to `to_idx` (exclusive) fn push_slice(ts: &[const A], from_idx: uint, to_idx: uint) { do self.swap |v| { - let mut v <- v; + let mut v = move v; let new_len = vec::len(v) + to_idx - from_idx; vec::reserve(&mut v, new_len); let mut i = from_idx; @@ -260,7 +260,7 @@ impl DVec { none { v } Some(h) { let len = v.len() + h; - let mut v <- v; + let mut v = move v; vec::reserve(v, len); v } diff --git a/src/libcore/io.rs b/src/libcore/io.rs index 77f7b5023df..77074a473e2 100644 --- a/src/libcore/io.rs +++ b/src/libcore/io.rs @@ -698,7 +698,7 @@ pub struct BytesWriter { impl BytesWriter: Writer { fn write(v: &[const u8]) { do self.bytes.swap |bytes| { - let mut bytes <- bytes; + let mut bytes = move bytes; let v_len = v.len(); let bytes_len = bytes.len(); diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 322012db135..f79a2e8f17b 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -128,7 +128,7 @@ pub pure fn flat_map_to_vec,IB:BaseIter>( pub pure fn foldl>(self: &IA, b0: B, blk: fn(&B, &A) -> B) -> B { - let mut b <- b0; + let mut b = move b0; for self.each |a| { b = blk(&b, a); } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index baabc35b428..3b1d2079800 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -149,7 +149,7 @@ pub pure fn or(opta: Option, optb: Option) -> Option { pub pure fn while_some(x: Option, blk: fn(v: T) -> Option) { //! Applies a function zero or more times until the result is none. - let mut opt <- x; + let mut opt = move x; while opt.is_some() { opt = blk(unwrap(move opt)); } diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index 3f8de19498f..2c2cd6a528a 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -86,7 +86,7 @@ use option::unwrap; const SPIN_COUNT: uint = 0; macro_rules! move_it ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) #[doc(hidden)] @@ -363,7 +363,7 @@ pub fn send(p: SendPacketBuffered, let p = unsafe { &*p_ }; assert ptr::addr_of(&(p.header)) == header; assert p.payload.is_none(); - p.payload <- Some(move payload); + p.payload = move Some(move payload); let old_state = swap_state_rel(&mut p.header.state, Full); match old_state { Empty => { @@ -708,7 +708,7 @@ pub fn select(endpoints: ~[RecvPacketBuffered]) -> (uint, Option, ~[RecvPacketBuffered]) { let ready = wait_many(endpoints.map(|p| p.header())); - let mut remaining <- endpoints; + let mut remaining = move endpoints; let port = remaining.swap_remove(ready); let result = try_recv(move port); (ready, move result, move remaining) diff --git a/src/libcore/private.rs b/src/libcore/private.rs index 8e89a3de6a8..c4298d572b6 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -562,9 +562,9 @@ impl Exclusive { // FIXME(#3724) make this a by-move method on the exclusive pub fn unwrap_exclusive(arc: Exclusive) -> T { - let Exclusive { x: x } <- arc; + let Exclusive { x: x } = move arc; let inner = unsafe { unwrap_shared_mutable_state(move x) }; - let ExData { data: data, _ } <- inner; + let ExData { data: data, _ } = move inner; move data } diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 0c722c437ee..8031a464315 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -176,7 +176,7 @@ pub fn push_str(lhs: &mut ~str, rhs: &str) { /// Concatenate two strings together #[inline(always)] pub pure fn append(lhs: ~str, rhs: &str) -> ~str { - let mut v <- lhs; + let mut v = move lhs; unsafe { push_str_no_overallocate(&mut v, rhs); } diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index 533e9851492..6fbb572df41 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -67,7 +67,7 @@ use rt::rust_task; use rt::rust_closure; macro_rules! move_it ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) type TaskSet = send_map::linear::LinearMap<*rust_task,()>; @@ -168,10 +168,10 @@ fn each_ancestor(list: &mut AncestorList, if coalesce_this.is_some() { // Needed coalesce. Our next ancestor becomes our old // ancestor's next ancestor. ("next = old_next->next;") - *list <- option::unwrap(move coalesce_this); + *list = move option::unwrap(move coalesce_this); } else { // No coalesce; restore from tmp. ("next = old_next;") - *list <- tmp_list; + *list = move tmp_list; } return early_break; } @@ -265,7 +265,7 @@ fn each_ancestor(list: &mut AncestorList, // If this trips, more likely the problem is 'blk' failed inside. let tmp_arc = option::swap_unwrap(parent_group); let result = do access_group(&tmp_arc) |tg_opt| { blk(tg_opt) }; - *parent_group <- Some(move tmp_arc); + *parent_group = move Some(move tmp_arc); move result } } @@ -480,7 +480,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool) if tmp.is_some() { let ancestor_arc = option::unwrap(move tmp); let result = ancestor_arc.clone(); - **ancestors <- Some(move ancestor_arc); + **ancestors = move Some(move ancestor_arc); AncestorList(Some(move result)) } else { AncestorList(None) diff --git a/src/libcore/util.rs b/src/libcore/util.rs index 8380cbf6b63..9e20653f4da 100644 --- a/src/libcore/util.rs +++ b/src/libcore/util.rs @@ -51,7 +51,7 @@ pub fn swap(x: &mut T, y: &mut T) { */ #[inline(always)] pub fn replace(dest: &mut T, src: T) -> T { - let mut tmp <- src; + let mut tmp = move src; swap(dest, &mut tmp); move tmp } diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 2e91c4b22c4..efed497651e 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -399,10 +399,10 @@ pub fn shift(v: &mut ~[T]) -> T { let mut rr; { let vv = raw::to_ptr(vv); - rr <- *vv; + rr = move *vv; for uint::range(1, ln) |i| { - let r <- *ptr::offset(vv, i); + let r = move *ptr::offset(vv, i); v.push(move r); } } @@ -424,7 +424,7 @@ pub fn consume(v: ~[T], f: fn(uint, v: T)) unsafe { do as_imm_buf(v) |p, ln| { for uint::range(0, ln) |i| { - let x <- *ptr::offset(p, i); + let x = move *ptr::offset(p, i); f(i, move x); } } @@ -515,7 +515,7 @@ pub fn push_all_move(v: &mut ~[T], rhs: ~[T]) { unsafe { do as_imm_buf(rhs) |p, len| { for uint::range(0, len) |i| { - let x <- *ptr::offset(p, i); + let x = move *ptr::offset(p, i); push(v, move x); } } @@ -530,7 +530,7 @@ pub fn truncate(v: &mut ~[T], newlen: uint) { unsafe { // This loop is optimized out for non-drop types. for uint::range(newlen, oldlen) |i| { - let _dropped <- *ptr::offset(p, i); + let _dropped = move *ptr::offset(p, i); } raw::set_len(v, newlen); } @@ -553,12 +553,12 @@ pub fn dedup(v: &mut ~[T]) unsafe { // last_written < next_to_read < ln if *ptr::mut_offset(p, next_to_read) == *ptr::mut_offset(p, last_written) { - let _dropped <- *ptr::mut_offset(p, next_to_read); + let _dropped = move *ptr::mut_offset(p, next_to_read); } else { last_written += 1; // last_written <= next_to_read < ln if next_to_read != last_written { - *ptr::mut_offset(p, last_written) <- + *ptr::mut_offset(p, last_written) = move *ptr::mut_offset(p, next_to_read); } } @@ -575,7 +575,7 @@ pub fn dedup(v: &mut ~[T]) unsafe { // Appending #[inline(always)] pub pure fn append(lhs: ~[T], rhs: &[const T]) -> ~[T] { - let mut v <- lhs; + let mut v = move lhs; unsafe { v.push_all(rhs); } @@ -584,7 +584,7 @@ pub pure fn append(lhs: ~[T], rhs: &[const T]) -> ~[T] { #[inline(always)] pub pure fn append_one(lhs: ~[T], x: T) -> ~[T] { - let mut v <- lhs; + let mut v = move lhs; unsafe { v.push(move x); } move v } @@ -1052,9 +1052,9 @@ pub fn swap(v: &[mut T], a: uint, b: uint) { /// Reverse the order of elements in a vector, in place pub fn reverse(v: &[mut T]) { - let mut i: uint = 0u; + let mut i: uint = 0; let ln = len::(v); - while i < ln / 2u { v[i] <-> v[ln - i - 1u]; i += 1u; } + while i < ln / 2 { v[i] <-> v[ln - i - 1]; i += 1; } } /// Returns a vector with the order of elements reversed 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(rc: &ARC) -> ARC { * guaranteed to deadlock. */ fn unwrap(rc: ARC) -> T { - let ARC { x: x } <- rc; + let ARC { x: x } = move rc; unsafe { unwrap_shared_mutable_state(move x) } } @@ -192,9 +192,9 @@ impl &MutexARC { */ // FIXME(#3724) make this a by-move method on the arc pub fn unwrap_mutex_arc(arc: MutexARC) -> 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 &RWARC { fn downgrade(token: RWWriteMode/&a) -> RWReadMode/&a { // 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 &RWARC { */ // FIXME(#3724) make this a by-move method on the arc pub fn unwrap_rw_arc(arc: RWARC) -> 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) -> 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 = pure fn(v1: &T, v2: &T) -> bool; pub fn merge_sort(le: Le, 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_(le: Le, v: &[const T], slice: Slice) -> ~[T] { @@ -23,10 +23,10 @@ pub fn merge_sort(le: Le, 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(le: Le, v: &[const T]) -> ~[T] { fn merge(le: Le, 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(compare_func: Le, 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(compare_func: Le, arr: &[mut T], left: uint, fn qsort(compare_func: Le, arr: &[mut T], left: uint, right: uint) { if right > left { - let pivot = (left + right) / 2u; + let pivot = (left + right) / 2; let new_pivot = part::(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::(compare_func, arr, left, new_pivot - 1u); + qsort::(compare_func, arr, left, new_pivot - 1); } - qsort::(compare_func, arr, new_pivot + 1u, right); + qsort::(compare_func, arr, new_pivot + 1, right); } } @@ -87,8 +87,8 @@ fn qsort(compare_func: Le, arr: &[mut T], left: uint, * This is an unstable sort. */ pub fn quick_sort(compare_func: Le, arr: &[mut T]) { - if len::(arr) == 0u { return; } - qsort::(compare_func, arr, 0u, len::(arr) - 1u); + if len::(arr) == 0 { return; } + qsort::(compare_func, arr, 0, len::(arr) - 1); } fn qsort3(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::(v1); quick_sort3::(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::(v1); pure fn leual(a: &int, b: &int) -> bool { *a <= *b } quick_sort::(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::(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(); diff --git a/src/test/bench/core-std.rs b/src/test/bench/core-std.rs index 6f90a2c99e8..550da39cb11 100644 --- a/src/test/bench/core-std.rs +++ b/src/test/bench/core-std.rs @@ -1,3 +1,4 @@ +// xfail-pretty // Microbenchmarks for various functions in core and std extern mod std; diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 88ca0d3e0c2..da891b376e3 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -19,7 +19,7 @@ use io::WriterUtil; use pipes::{Port, Chan, SharedChan}; macro_rules! move_out ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) enum request { diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index ce3fd5134ac..041094adcd5 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -15,7 +15,7 @@ use io::WriterUtil; use pipes::{Port, PortSet, Chan}; macro_rules! move_out ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) enum request { diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index 3ec89567d20..ac0043b7309 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -41,8 +41,8 @@ fn thread_ring(i: uint, count: uint, +num_chan: pipe, +num_port: pipe) { - let mut num_chan <- Some(move num_chan); - let mut num_port <- Some(move num_port); + let mut num_chan = move Some(move num_chan); + let mut num_port = move Some(move num_port); // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index 68429ee01bb..85e46bfcaec 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -24,7 +24,7 @@ proto! ring ( fn macros() { #macro[ [#move_out[x], - unsafe { let y <- *ptr::addr_of(&x); move y }] + unsafe { let y = move *ptr::addr_of(&x); move y }] ]; } @@ -32,8 +32,8 @@ fn thread_ring(i: uint, count: uint, +num_chan: ring::client::num, +num_port: ring::server::num) { - let mut num_chan <- Some(move num_chan); - let mut num_port <- Some(move num_port); + let mut num_chan = move Some(move num_chan); + let mut num_port = move Some(move num_port); // Send/Receive lots of messages. for uint::range(0, count) |j| { //error!("task %?, iter %?", i, j); diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index 5e3d2f7d3e0..f5c6a49a364 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -41,8 +41,8 @@ fn thread_ring(i: uint, count: uint, +num_chan: pipe, +num_port: pipe) { - let mut num_chan <- Some(move num_chan); - let mut num_port <- Some(move num_port); + let mut num_chan = move Some(move num_chan); + let mut num_port = move Some(move num_port); // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index e7f9312ce38..fc202551194 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -33,7 +33,7 @@ proto! pingpong_unbounded ( // This stuff should go in libcore::pipes macro_rules! move_it ( - { $x:expr } => { let t <- *ptr::addr_of(&($x)); move t } + { $x:expr } => { let t = move *ptr::addr_of(&($x)); move t } ) macro_rules! follow ( diff --git a/src/test/bench/task-perf-word-count-generic.rs b/src/test/bench/task-perf-word-count-generic.rs index 3fe192ed363..383bc9bd79b 100644 --- a/src/test/bench/task-perf-word-count-generic.rs +++ b/src/test/bench/task-perf-word-count-generic.rs @@ -30,7 +30,7 @@ use cmp::Eq; use to_bytes::IterBytes; macro_rules! move_out ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) trait word_reader { diff --git a/src/test/compile-fail/block-deinitializes-upvar.rs b/src/test/compile-fail/block-deinitializes-upvar.rs index cfcf2bffb34..5d0ee52e64a 100644 --- a/src/test/compile-fail/block-deinitializes-upvar.rs +++ b/src/test/compile-fail/block-deinitializes-upvar.rs @@ -4,5 +4,5 @@ fn main() { let mut x = @{x: 17, y: 2}; let y = @{x: 5, y: 5}; - force(|| x <- y ); + force(|| x = move y ); } diff --git a/src/test/compile-fail/borrowck-issue-2657-1.rs b/src/test/compile-fail/borrowck-issue-2657-1.rs index 98947fbd1a2..a7b78317e44 100644 --- a/src/test/compile-fail/borrowck-issue-2657-1.rs +++ b/src/test/compile-fail/borrowck-issue-2657-1.rs @@ -2,7 +2,7 @@ fn main() { let x = Some(~1); match x { //~ NOTE loan of immutable local variable granted here Some(ref _y) => { - let _a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan + let _a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan } _ => {} } diff --git a/src/test/compile-fail/borrowck-issue-2657-2.rs b/src/test/compile-fail/borrowck-issue-2657-2.rs index f04c323afba..019ae316098 100644 --- a/src/test/compile-fail/borrowck-issue-2657-2.rs +++ b/src/test/compile-fail/borrowck-issue-2657-2.rs @@ -2,7 +2,7 @@ fn main() { let x = Some(~1); match x { Some(ref y) => { - let _b <- *y; //~ ERROR moving out of dereference of immutable & pointer + let _b = move *y; //~ ERROR moving out of dereference of immutable & pointer } _ => {} } diff --git a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs index 71bba89fb77..ce500492aea 100644 --- a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs +++ b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs @@ -1,5 +1,5 @@ fn foo(x: *~int) -> ~int { - let y <- *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block + let y = move *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block return y; } diff --git a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs index beab4d3409e..c91c4819661 100644 --- a/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs +++ b/src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs @@ -7,7 +7,7 @@ fn main() { // Create a cycle! match *x { //~ NOTE loan of immutable local variable granted here node(ref y) => { - y.a <- x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan + y.a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan } empty => {} }; diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/compile-fail/copy-a-resource.rs index 3bfdaa85666..dc9237e6318 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/compile-fail/copy-a-resource.rs @@ -11,4 +11,4 @@ fn foo(i:int) -> foo { } } -fn main() { let x <- foo(10); let y = x; log(error, x); } +fn main() { let x = move foo(10); let y = x; log(error, x); } diff --git a/src/test/compile-fail/issue-2548.rs b/src/test/compile-fail/issue-2548.rs index 0d491fc8834..33886b28934 100644 --- a/src/test/compile-fail/issue-2548.rs +++ b/src/test/compile-fail/issue-2548.rs @@ -21,7 +21,7 @@ fn main() { let mut res = foo(x); let mut v = ~[mut]; - v <- ~[mut (move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `owned`, missing `copy`) + v = move ~[mut (move res)] + v; //~ ERROR instantiating a type parameter with an incompatible type (needs `copy`, got `owned`, missing `copy`) assert (v.len() == 2); } diff --git a/src/test/compile-fail/liveness-move-in-loop.rs b/src/test/compile-fail/liveness-move-in-loop.rs index d9233e41e38..091112a3150 100644 --- a/src/test/compile-fail/liveness-move-in-loop.rs +++ b/src/test/compile-fail/liveness-move-in-loop.rs @@ -7,8 +7,11 @@ fn main() { loop { loop { loop { - x <- y; //~ ERROR use of moved variable +// tjc: Not sure why it prints the same error twice + x = move y; //~ ERROR use of moved variable //~^ NOTE move of variable occurred here + //~^^ ERROR use of moved variable + //~^^^ NOTE move of variable occurred here copy x; } diff --git a/src/test/compile-fail/liveness-move-in-while.rs b/src/test/compile-fail/liveness-move-in-while.rs index 261eb310890..66ca21534b3 100644 --- a/src/test/compile-fail/liveness-move-in-while.rs +++ b/src/test/compile-fail/liveness-move-in-while.rs @@ -4,8 +4,11 @@ fn main() { let mut x: int; loop { log(debug, y); - while true { while true { while true { x <- y; copy x; } } } +// tjc: not sure why it prints the same error twice + while true { while true { while true { x = move y; copy x; } } } //~^ ERROR use of moved variable: `y` //~^^ NOTE move of variable occurred here + //~^^^ ERROR use of moved variable: `y` + //~^^^^ NOTE move of variable occurred here } } diff --git a/src/test/compile-fail/liveness-use-after-move.rs b/src/test/compile-fail/liveness-use-after-move.rs index f060fe8307f..39068635a06 100644 --- a/src/test/compile-fail/liveness-use-after-move.rs +++ b/src/test/compile-fail/liveness-use-after-move.rs @@ -1,6 +1,6 @@ fn main() { let x = @5; - let y <- x; //~ NOTE move of variable occurred here + let y = move x; //~ NOTE move of variable occurred here log(debug, *x); //~ ERROR use of moved variable: `x` copy y; } diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs index 33aef1c0a72..af43fe66b4b 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/compile-fail/noncopyable-class.rs @@ -25,4 +25,4 @@ fn foo(i:int) -> foo { } } -fn main() { let x <- foo(10); let y = x; log(error, x); } +fn main() { let x = move foo(10); let y = x; log(error, x); } diff --git a/src/test/compile-fail/obsolete-syntax.rs b/src/test/compile-fail/obsolete-syntax.rs index c8a8bd85961..4be54708428 100644 --- a/src/test/compile-fail/obsolete-syntax.rs +++ b/src/test/compile-fail/obsolete-syntax.rs @@ -67,4 +67,12 @@ fn obsolete_fixed_length_vec() { //~^ ERROR obsolete syntax: fixed-length vector } +fn obsolete_moves() { + let mut x = 0; + let y <- x; + //~^ ERROR obsolete syntax: initializer-by-move + y <- x; + //~^ ERROR obsolete syntax: binary move +} + fn main() { } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 1a6680af381..83d1b8393e8 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -6,7 +6,7 @@ struct r { } fn main() { - let i <- ~r { b: true }; + let i = move ~r { b: true }; let j = i; log(debug, i); } \ No newline at end of file diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index d5211906f89..c89a61f1220 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -12,8 +12,8 @@ fn f(+i: ~[T], +j: ~[T]) { fn main() { let i1 = @mut 0; let i2 = @mut 1; - let r1 <- ~[~r { i: i1 }]; - let r2 <- ~[~r { i: i2 }]; + let r1 = move ~[~r { i: i1 }]; + let r2 = move ~[~r { i: i2 }]; f(r1, r2); log(debug, (r2, *i1)); log(debug, (r1, *i2)); diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs index 4b558d7fe8f..737f0382b62 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/compile-fail/vec-res-add.rs @@ -9,8 +9,8 @@ struct r { fn main() { // This can't make sense as it would copy the classes - let i <- ~[r(0)]; - let j <- ~[r(1)]; + let i = move ~[r(0)]; + let j = move ~[r(1)]; let k = i + j; log(debug, j); } diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index 9e24c1598c6..076f1280f96 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -8,5 +8,5 @@ class r { fn main() { @0; - let r <- r(0); + let r = move r(0); } \ No newline at end of file diff --git a/src/test/run-fail/unwind-resource-fail2.rs b/src/test/run-fail/unwind-resource-fail2.rs index a29f83bf49a..5f89f4cd985 100644 --- a/src/test/run-fail/unwind-resource-fail2.rs +++ b/src/test/run-fail/unwind-resource-fail2.rs @@ -8,6 +8,6 @@ class r { fn main() { @0; - let r <- r(0); + let r = move r(0); fail; } \ No newline at end of file diff --git a/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs b/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs index 7ef868dbac2..0bcfba6c4a8 100644 --- a/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs +++ b/src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs @@ -2,7 +2,7 @@ fn bar(x: *~int) -> ~int { unsafe { - let y <- *x; + let y = move *x; return y; } } diff --git a/src/test/run-pass/borrowck-mut-uniq.rs b/src/test/run-pass/borrowck-mut-uniq.rs index 2d1833c0736..2fb9afceb3d 100644 --- a/src/test/run-pass/borrowck-mut-uniq.rs +++ b/src/test/run-pass/borrowck-mut-uniq.rs @@ -5,7 +5,7 @@ fn add_int(x: &mut ints, v: int) { let mut values = ~[]; x.values <-> values; values.push(v); - x.values <- values; + x.values <-> values; } fn iter_ints(x: &ints, f: fn(x: &int) -> bool) { diff --git a/src/test/run-pass/import-glob-1.rs b/src/test/run-pass/import-glob-1.rs index 5039a7344df..f881ed61671 100644 --- a/src/test/run-pass/import-glob-1.rs +++ b/src/test/run-pass/import-glob-1.rs @@ -7,7 +7,7 @@ mod a1 { #[legacy_exports]; // use a2::b1::*; - // <-\ + // = move\ export word_traveler; // | } // | @@ -15,7 +15,7 @@ mod a1 { #[legacy_exports]; // | use a2::b2::*; - // <-\ -\ | + // = move\ -\ | export word_traveler; // | | | } // | | | } @@ -30,7 +30,7 @@ mod a2 { #[legacy_exports]; // | | | use a1::b2::*; - // | <-/ -/ + // | = move/ -/ export word_traveler; // | } // | diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 5b317d9b26d..ca03c0736a2 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -15,7 +15,7 @@ fn r(i: @mut int) -> r { fn test_box() { let i = @mut 0; { - let a <- @r(i); + let a = move @r(i); } assert *i == 1; } @@ -23,7 +23,7 @@ fn test_box() { fn test_rec() { let i = @mut 0; { - let a <- {x: r(i)}; + let a = move {x: r(i)}; } assert *i == 1; } @@ -35,7 +35,7 @@ fn test_tag() { let i = @mut 0; { - let a <- t0(r(i)); + let a = move t0(r(i)); } assert *i == 1; } @@ -43,7 +43,7 @@ fn test_tag() { fn test_tup() { let i = @mut 0; { - let a <- (r(i), 0); + let a = move (r(i), 0); } assert *i == 1; } @@ -51,7 +51,7 @@ fn test_tup() { fn test_unique() { let i = @mut 0; { - let a <- ~r(i); + let a = move ~r(i); } assert *i == 1; } @@ -59,7 +59,7 @@ fn test_unique() { fn test_box_rec() { let i = @mut 0; { - let a <- @{ + let a = move @{ x: r(i) }; } diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index cda85fb166a..8913ac3d304 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -24,9 +24,9 @@ fn filter>(self: IA, prd: fn@(A) -> bool, blk: fn(A)) { } fn foldl>(self: IA, +b0: B, blk: fn(B, A) -> B) -> B { - let mut b <- b0; + let mut b = move b0; do self.iter |a| { - b <- blk(b, a); + b = move blk(b, a); } move b } diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index e91194b009a..7b8ff9b86b0 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -63,7 +63,7 @@ mod pipes { let p = p.unwrap(); let p = unsafe { uniquify(p) }; assert (*p).payload.is_none(); - (*p).payload <- Some(move payload); + (*p).payload = move Some(move payload); let old_state = swap_state_rel(&mut (*p).state, full); match old_state { empty => { @@ -205,7 +205,7 @@ mod pingpong { let addr : *pipes::send_packet = match p { ping(x) => { cast::transmute(ptr::addr_of(&x)) } }; - let liberated_value <- *addr; + let liberated_value = move *addr; cast::forget(move p); move liberated_value } @@ -214,7 +214,7 @@ mod pingpong { let addr : *pipes::send_packet = match p { pong(x) => { cast::transmute(ptr::addr_of(&x)) } }; - let liberated_value <- *addr; + let liberated_value = move *addr; cast::forget(move p); move liberated_value } diff --git a/src/test/run-pass/move-1-unique.rs b/src/test/run-pass/move-1-unique.rs index ec37e14c47c..f485a8c6ec2 100644 --- a/src/test/run-pass/move-1-unique.rs +++ b/src/test/run-pass/move-1-unique.rs @@ -2,7 +2,7 @@ fn test(x: bool, foo: ~{x: int, y: int, z: int}) -> int { let bar = foo; let mut y: ~{x: int, y: int, z: int}; - if x { y <- bar; } else { y = ~{x: 4, y: 5, z: 6}; } + if x { y = move bar; } else { y = ~{x: 4, y: 5, z: 6}; } return y.y; } diff --git a/src/test/run-pass/move-1.rs b/src/test/run-pass/move-1.rs index c510626a08c..6a1576dd878 100644 --- a/src/test/run-pass/move-1.rs +++ b/src/test/run-pass/move-1.rs @@ -1,7 +1,7 @@ fn test(x: bool, foo: @{x: int, y: int, z: int}) -> int { let bar = foo; let mut y: @{x: int, y: int, z: int}; - if x { y <- bar; } else { y = @{x: 4, y: 5, z: 6}; } + if x { y = move bar; } else { y = @{x: 4, y: 5, z: 6}; } return y.y; } diff --git a/src/test/run-pass/move-2-unique.rs b/src/test/run-pass/move-2-unique.rs index 9d414aceb43..30e47677c94 100644 --- a/src/test/run-pass/move-2-unique.rs +++ b/src/test/run-pass/move-2-unique.rs @@ -1,3 +1,3 @@ -fn main() { let x = ~{x: 1, y: 2, z: 3}; let y <- x; assert (y.y == 2); } +fn main() { let x = ~{x: 1, y: 2, z: 3}; let y = move x; assert (y.y == 2); } diff --git a/src/test/run-pass/move-2.rs b/src/test/run-pass/move-2.rs index 9309d718b15..58cd2e66612 100644 --- a/src/test/run-pass/move-2.rs +++ b/src/test/run-pass/move-2.rs @@ -1,3 +1,3 @@ -fn main() { let x = @{x: 1, y: 2, z: 3}; let y <- x; assert (y.y == 2); } +fn main() { let x = @{x: 1, y: 2, z: 3}; let y = move x; assert (y.y == 2); } diff --git a/src/test/run-pass/move-3-unique.rs b/src/test/run-pass/move-3-unique.rs index 5353ba191cd..08dbee53637 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -3,7 +3,7 @@ extern mod std; fn test(x: bool, foo: ~{x: int, y: int, z: int}) -> int { let bar = foo; let mut y: ~{x: int, y: int, z: int}; - if x { y <- bar; } else { y = ~{x: 4, y: 5, z: 6}; } + if x { y = move bar; } else { y = ~{x: 4, y: 5, z: 6}; } return y.y; } diff --git a/src/test/run-pass/move-3.rs b/src/test/run-pass/move-3.rs index 784fa068d4d..26fd010b549 100644 --- a/src/test/run-pass/move-3.rs +++ b/src/test/run-pass/move-3.rs @@ -3,7 +3,7 @@ extern mod std; fn test(x: bool, foo: @{x: int, y: int, z: int}) -> int { let bar = foo; let mut y: @{x: int, y: int, z: int}; - if x { y <- bar; } else { y = @{x: 4, y: 5, z: 6}; } + if x { y = move bar; } else { y = @{x: 4, y: 5, z: 6}; } return y.y; } diff --git a/src/test/run-pass/move-4-unique.rs b/src/test/run-pass/move-4-unique.rs index 5bea6f8134d..c4c84c8e10c 100644 --- a/src/test/run-pass/move-4-unique.rs +++ b/src/test/run-pass/move-4-unique.rs @@ -2,9 +2,9 @@ extern mod std; fn test(foo: ~{a: int, b: int, c: int}) -> ~{a: int, b: int, c: int} { let foo = foo; - let bar <- foo; - let baz <- bar; - let quux <- baz; + let bar = move foo; + let baz = move bar; + let quux = move baz; return quux; } diff --git a/src/test/run-pass/move-4.rs b/src/test/run-pass/move-4.rs index 987d5e299d2..6eaa2bf2a44 100644 --- a/src/test/run-pass/move-4.rs +++ b/src/test/run-pass/move-4.rs @@ -3,9 +3,9 @@ extern mod std; fn test(foo: @{a: int, b: int, c: int}) -> @{a: int, b: int, c: int} { let foo = foo; - let bar <- foo; - let baz <- bar; - let quux <- baz; + let bar = move foo; + let baz = move bar; + let quux = move baz; return quux; } diff --git a/src/test/run-pass/move-scalar.rs b/src/test/run-pass/move-scalar.rs index 3930d537131..eef51c81cf4 100644 --- a/src/test/run-pass/move-scalar.rs +++ b/src/test/run-pass/move-scalar.rs @@ -2,6 +2,6 @@ fn main() { let y: int = 42; let mut x: int; - x <- y; + x = move y; assert (x == 42); } diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index e59634ad089..7d7de6d120d 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -33,7 +33,7 @@ proto! bank ( ) macro_rules! move_it ( - { $x:expr } => { unsafe { let y <- *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } ) fn switch(+endp: pipes::RecvPacket, diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 3f3417fd703..2d3110c4518 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -15,7 +15,7 @@ fn shrinky_pointer(i: @@mut int) -> shrinky_pointer { fn main() { let my_total = @@mut 10; - { let pt <- shrinky_pointer(my_total); assert (pt.look_at() == 10); } + { let pt = move shrinky_pointer(my_total); assert (pt.look_at() == 10); } log(error, fmt!("my_total = %d", **my_total)); assert (**my_total == 9); } diff --git a/src/test/run-pass/resource-generic.rs b/src/test/run-pass/resource-generic.rs index e653e94ac7a..f109775dd7b 100644 --- a/src/test/run-pass/resource-generic.rs +++ b/src/test/run-pass/resource-generic.rs @@ -16,6 +16,6 @@ fn main() { let box = @mut 10; fn dec_box(&&i: @mut int) { *i -= 1; } - { let _i <- finish({val: box, fin: dec_box}); } + { let _i = move finish({val: box, fin: dec_box}); } assert (*box == 9); } diff --git a/src/test/run-pass/unique-decl-move-temp.rs b/src/test/run-pass/unique-decl-move-temp.rs index 0261bbc3d5f..cde412a1143 100644 --- a/src/test/run-pass/unique-decl-move-temp.rs +++ b/src/test/run-pass/unique-decl-move-temp.rs @@ -1,4 +1,4 @@ fn main() { - let i <- ~100; + let i = move ~100; assert *i == 100; } \ No newline at end of file diff --git a/src/test/run-pass/unique-decl-move.rs b/src/test/run-pass/unique-decl-move.rs index 9a8d418f757..e4a46fb06af 100644 --- a/src/test/run-pass/unique-decl-move.rs +++ b/src/test/run-pass/unique-decl-move.rs @@ -1,5 +1,5 @@ fn main() { let i = ~100; - let j <- i; + let j = move i; assert *j == 100; } \ No newline at end of file diff --git a/src/test/run-pass/unique-move-drop.rs b/src/test/run-pass/unique-move-drop.rs index c4031f41006..8ef1af7bb10 100644 --- a/src/test/run-pass/unique-move-drop.rs +++ b/src/test/run-pass/unique-move-drop.rs @@ -1,6 +1,6 @@ fn main() { let i = ~100; let j = ~200; - let j <- i; + let j = move i; assert *j == 100; } \ No newline at end of file diff --git a/src/test/run-pass/unique-move-temp.rs b/src/test/run-pass/unique-move-temp.rs index 677a2829372..ca4409ac2ab 100644 --- a/src/test/run-pass/unique-move-temp.rs +++ b/src/test/run-pass/unique-move-temp.rs @@ -1,5 +1,5 @@ fn main() { let mut i; - i <- ~100; + i = move ~100; assert *i == 100; } \ No newline at end of file diff --git a/src/test/run-pass/unique-move.rs b/src/test/run-pass/unique-move.rs index 5dde8eff44e..b81338a4d25 100644 --- a/src/test/run-pass/unique-move.rs +++ b/src/test/run-pass/unique-move.rs @@ -1,6 +1,6 @@ fn main() { let i = ~100; let mut j; - j <- i; + j = move i; assert *j == 100; } \ No newline at end of file diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 75fe81e5cd7..11cf1fe85f9 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -3,7 +3,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c <- fail; + let c = move fail; id(c); //~ WARNING unreachable statement } diff --git a/src/test/run-pass/unreachable-code.rs b/src/test/run-pass/unreachable-code.rs index d2b6b178407..9d34e7a8dc6 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -3,7 +3,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c <- fail; + let c = move fail; id(c); } diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index a602a271602..a03564d0801 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -16,7 +16,7 @@ fn complainer(c: comm::Chan) -> complainer { } fn f(c: comm::Chan) { - let _c <- complainer(c); + let _c = move complainer(c); fail; } diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index bd73825a4eb..1470d7d7169 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -13,7 +13,7 @@ fn complainer(c: @int) -> complainer { } fn f() { - let c <- complainer(@0); + let c = move complainer(@0); fail; } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index f339e826666..679ed99d162 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -40,7 +40,7 @@ fn zombiejesus() { fn notsure() { let mut _x; let mut _y = (_x = 0) == (_x = 0); - let mut _z = (_x <- 0) < (_x = 0); + let mut _z = (_x = move 0) < (_x = 0); let _a = (_x += 0) == (_x = 0); let _b = (_y <-> _z) == (_y <-> _z); } @@ -63,7 +63,7 @@ fn angrydome() { break; } } -fn evil_lincoln() { let evil <- debug!("lincoln"); } +fn evil_lincoln() { let evil = move debug!("lincoln"); } fn main() { strange(); diff --git a/src/test/run-pass/while-loop-constraints-2.rs b/src/test/run-pass/while-loop-constraints-2.rs index 2293724739a..83f49b960c0 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -5,7 +5,7 @@ fn main() { let mut x: int; while z < 50 { z += 1; - while false { x <- y; y = z; } + while false { x = move y; y = z; } log(debug, y); } assert (y == 42 && z == 50);