From 178882c98feb4d19a88ce950b035bc40ffda2650 Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Fri, 15 Feb 2013 02:44:18 -0800 Subject: [PATCH] tests/tutorials: Get rid of `move`. --- doc/rust.md | 2 +- doc/tutorial-borrowed-ptr.md | 2 +- doc/tutorial-tasks.md | 20 +++--- doc/tutorial.md | 2 +- src/librustc/metadata/encoder.rs | 2 +- src/test/auxiliary/cci_class_6.rs | 2 +- src/test/bench/core-vec-append.rs | 2 +- src/test/bench/graph500-bfs.rs | 4 +- src/test/bench/msgsend-pipes-shared.rs | 10 +-- src/test/bench/msgsend-pipes.rs | 12 ++-- src/test/bench/msgsend-ring-mutex-arcs.rs | 28 ++++---- src/test/bench/msgsend-ring-pipes.rs | 29 ++++---- src/test/bench/msgsend-ring-rw-arcs.rs | 27 ++++---- src/test/bench/noise.rs | 4 +- src/test/bench/pingpong.rs | 44 ++++++------- src/test/bench/shootout-chameneos-redux.rs | 2 +- src/test/bench/shootout-k-nucleotide-pipes.rs | 12 ++-- src/test/bench/shootout-mandelbrot.rs | 2 +- src/test/bench/shootout-pfib.rs | 8 +-- src/test/bench/task-perf-alloc-unwind.rs | 2 +- .../bench/task-perf-jargon-metal-smoke.rs | 8 +-- src/test/bench/task-perf-linked-failure.rs | 4 +- ...her-can-live-while-the-other-survives-1.rs | 4 +- ...her-can-live-while-the-other-survives-2.rs | 4 +- ...her-can-live-while-the-other-survives-3.rs | 4 +- ...her-can-live-while-the-other-survives-4.rs | 4 +- .../compile-fail/bind-by-move-no-guards.rs | 6 +- .../compile-fail/bind-by-move-no-lvalues-1.rs | 2 +- .../compile-fail/bind-by-move-no-lvalues-2.rs | 2 +- .../bind-by-move-no-sub-bindings.rs | 4 +- .../borrowck-loan-in-overloaded-op.rs | 2 +- .../borrowck-move-from-unsafe-ptr.rs | 2 +- .../borrowck-vec-pattern-element-loan.rs | 2 +- .../borrowck-vec-pattern-tail-element-loan.rs | 2 +- src/test/compile-fail/copy-a-resource.rs | 2 +- src/test/compile-fail/issue-2548.rs | 2 +- .../compile-fail/issue-3177-mutable-struct.rs | 2 +- src/test/compile-fail/kindck-nonsendable-1.rs | 2 +- src/test/compile-fail/liveness-unused.rs | 2 +- src/test/compile-fail/noncopyable-class.rs | 2 +- src/test/compile-fail/unique-pinned-nocopy.rs | 2 +- src/test/compile-fail/unique-unique-kind.rs | 2 +- src/test/compile-fail/unique-vec-res.rs | 4 +- src/test/compile-fail/unsendable-class.rs | 2 +- src/test/compile-fail/vec-res-add.rs | 4 +- src/test/run-fail/out-of-stack-managed-box.rs | 4 +- src/test/run-fail/out-of-stack-owned-box.rs | 4 +- src/test/run-fail/unwind-box-res.rs | 2 +- src/test/run-fail/unwind-closure.rs | 2 +- src/test/run-fail/unwind-move.rs | 2 +- src/test/run-fail/unwind-resource-fail.rs | 2 +- src/test/run-fail/unwind-resource-fail2.rs | 2 +- .../run-pass/alt-ref-binding-in-guard-3256.rs | 2 +- src/test/run-pass/argument-passing.rs | 2 +- src/test/run-pass/auto-encode.rs | 2 +- src/test/run-pass/auto-ref-sliceable.rs | 2 +- src/test/run-pass/bind-by-move.rs | 4 +- .../borrowck-move-from-unsafe-ptr-ok.rs | 2 +- src/test/run-pass/cap-clause-move.rs | 8 +-- src/test/run-pass/class-poly-methods.rs | 2 +- src/test/run-pass/dvec-test.rs | 2 +- src/test/run-pass/fn-bare-spawn.rs | 2 +- src/test/run-pass/hashmap-memory.rs | 2 +- src/test/run-pass/init-res-into-things.rs | 12 ++-- src/test/run-pass/intrinsic-move-val.rs | 2 +- src/test/run-pass/issue-1895.rs | 2 +- src/test/run-pass/issue-2185.rs | 6 +- src/test/run-pass/issue-2718.rs | 66 +++++++++---------- src/test/run-pass/issue-2834.rs | 2 +- src/test/run-pass/issue-2904.rs | 2 +- src/test/run-pass/issue-2930.rs | 2 +- src/test/run-pass/issue-3168.rs | 6 +- src/test/run-pass/issue-3176.rs | 8 +-- src/test/run-pass/issue-3220.rs | 2 +- src/test/run-pass/issue-3447.rs | 2 +- src/test/run-pass/issue-3878.rs | 2 +- src/test/run-pass/issue-4016.rs | 2 +- src/test/run-pass/last-use-in-block.rs | 4 +- src/test/run-pass/last-use-in-cap-clause.rs | 2 +- src/test/run-pass/liveness-move-in-loop.rs | 2 +- src/test/run-pass/log-linearized.rs | 2 +- ...nomorphized-callees-with-ty-params-3314.rs | 2 +- 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-arg-2-unique.rs | 2 +- src/test/run-pass/move-arg-2.rs | 2 +- src/test/run-pass/move-arg.rs | 2 +- src/test/run-pass/move-nullary-fn.rs | 2 +- src/test/run-pass/move-scalar.rs | 2 +- src/test/run-pass/move-self.rs | 2 +- src/test/run-pass/non-legacy-modes.rs | 2 +- src/test/run-pass/option-unwrap.rs | 6 +- src/test/run-pass/pipe-bank-proto.rs | 30 ++++----- src/test/run-pass/pipe-detect-term.rs | 6 +- src/test/run-pass/pipe-peek.rs | 2 +- src/test/run-pass/pipe-pingpong-bounded.rs | 34 +++++----- src/test/run-pass/pipe-pingpong-proto.rs | 20 +++--- .../run-pass/pipe-presentation-examples.rs | 26 ++++---- src/test/run-pass/pipe-select.rs | 32 ++++----- src/test/run-pass/pipe-sleep.rs | 4 +- src/test/run-pass/regions-copy-closure.rs | 2 +- src/test/run-pass/regions-static-closure.rs | 4 +- .../run-pass/resource-assign-is-not-copy.rs | 4 +- src/test/run-pass/resource-cycle.rs | 8 +-- src/test/run-pass/resource-cycle2.rs | 4 +- src/test/run-pass/resource-cycle3.rs | 4 +- src/test/run-pass/resource-destruct.rs | 2 +- src/test/run-pass/resource-generic.rs | 2 +- src/test/run-pass/rt-sched-1.rs | 2 +- src/test/run-pass/select-macro.rs | 16 ++--- src/test/run-pass/sendfn-spawn-with-fn-arg.rs | 2 +- src/test/run-pass/static-method-test.rs | 4 +- src/test/run-pass/task-comm-0.rs | 2 +- src/test/run-pass/task-comm-10.rs | 6 +- src/test/run-pass/task-comm-11.rs | 4 +- src/test/run-pass/task-comm-12.rs | 4 +- src/test/run-pass/task-comm-13.rs | 2 +- src/test/run-pass/task-comm-14.rs | 4 +- src/test/run-pass/task-comm-15.rs | 2 +- src/test/run-pass/task-comm-16.rs | 2 +- src/test/run-pass/task-comm-3.rs | 4 +- src/test/run-pass/task-comm-7.rs | 8 +-- src/test/run-pass/task-comm-9.rs | 6 +- .../trait-default-method-bound-subst.rs | 4 +- .../trait-default-method-bound-subst2.rs | 4 +- .../trait-default-method-bound-subst3.rs | 4 +- .../trait-default-method-bound-subst4.rs | 4 +- src/test/run-pass/trait-to-str.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-fn-arg-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/unused-move-capture.rs | 2 +- src/test/run-pass/unused-move.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 +- src/test/run-pass/yield.rs | 4 +- src/test/run-pass/yield1.rs | 4 +- 150 files changed, 409 insertions(+), 411 deletions(-) diff --git a/doc/rust.md b/doc/rust.md index 23035b3b34a..14efa3fcead 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -213,7 +213,7 @@ else enum extern false fn for if impl let log loop -match mod move mut +match mod mut priv pub pure ref return self static struct super diff --git a/doc/tutorial-borrowed-ptr.md b/doc/tutorial-borrowed-ptr.md index 939051ca605..c13b2528598 100644 --- a/doc/tutorial-borrowed-ptr.md +++ b/doc/tutorial-borrowed-ptr.md @@ -431,7 +431,7 @@ fn example5c(x: @S) -> int { let y = &v.g; ... } - x.f = move v; // Replace x.f + x.f = v; // Replace x.f ... # return 0; } diff --git a/doc/tutorial-tasks.md b/doc/tutorial-tasks.md index 5900fc1a9ff..a3d0ecaa4ba 100644 --- a/doc/tutorial-tasks.md +++ b/doc/tutorial-tasks.md @@ -161,7 +161,7 @@ use pipes::{stream, Port, Chan}; let (port, chan): (Port, Chan) = stream(); -do spawn |move chan| { +do spawn || { let result = some_expensive_computation(); chan.send(result); } @@ -192,7 +192,7 @@ spawns the child task. # use pipes::{stream, Port, Chan}; # fn some_expensive_computation() -> int { 42 } # let (port, chan) = stream(); -do spawn |move chan| { +do spawn || { let result = some_expensive_computation(); chan.send(result); } @@ -229,7 +229,7 @@ following program is ill-typed: # fn some_expensive_computation() -> int { 42 } let (port, chan) = stream(); -do spawn |move chan| { +do spawn { chan.send(some_expensive_computation()); } @@ -248,12 +248,12 @@ Instead we can use a `SharedChan`, a type that allows a single use pipes::{stream, SharedChan}; let (port, chan) = stream(); -let chan = SharedChan(move chan); +let chan = SharedChan(chan); for uint::range(0, 3) |init_val| { // Create a new channel handle to distribute to the child task let child_chan = chan.clone(); - do spawn |move child_chan| { + do spawn { child_chan.send(some_expensive_computation(init_val)); } } @@ -283,10 +283,10 @@ might look like the example below. // Create a vector of ports, one for each child task let ports = do vec::from_fn(3) |init_val| { let (port, chan) = stream(); - do spawn |move chan| { + do spawn { chan.send(some_expensive_computation(init_val)); } - move port + port }; // Wait on each port, accumulating the results @@ -398,13 +398,13 @@ before returning. Hence: # fn sleep_forever() { loop { task::yield() } } # do task::try { let (receiver, sender): (Port, Chan) = stream(); -do spawn |move receiver| { // Bidirectionally linked +do spawn { // Bidirectionally linked // Wait for the supervised child task to exist. let message = receiver.recv(); // Kill both it and the parent task. assert message != 42; } -do try |move sender| { // Unidirectionally linked +do try { // Unidirectionally linked sender.send(42); sleep_forever(); // Will get woken up by force } @@ -505,7 +505,7 @@ Here is the code for the parent task: let (from_child, to_child) = DuplexStream(); -do spawn |move to_child| { +do spawn { stringifier(&to_child); }; diff --git a/doc/tutorial.md b/doc/tutorial.md index a825b7f535f..9550dd927fa 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -1260,7 +1260,7 @@ Moving it into a mutable slot makes the elements assignable. let crayons: ~[Crayon] = ~[BananaMania, Beaver, Bittersweet]; // Put the vector into a mutable slot -let mut mutable_crayons = move crayons; +let mut mutable_crayons = crayons; // Now it's mutable to the bone mutable_crayons[0] = Apricot; diff --git a/src/librustc/metadata/encoder.rs b/src/librustc/metadata/encoder.rs index 12c5e3388db..ad418943ec0 100644 --- a/src/librustc/metadata/encoder.rs +++ b/src/librustc/metadata/encoder.rs @@ -1229,7 +1229,7 @@ pub fn encode_metadata(parms: encode_parms, crate: &crate) -> ~[u8] { let ecx: @encode_ctxt = @encode_ctxt({ diag: parms.diag, tcx: parms.tcx, - stats: @mut move stats, + stats: @mut stats, reachable: parms.reachable, reexports2: parms.reexports2, item_symbols: parms.item_symbols, diff --git a/src/test/auxiliary/cci_class_6.rs b/src/test/auxiliary/cci_class_6.rs index f4b27e04c13..3ab101bc0b4 100644 --- a/src/test/auxiliary/cci_class_6.rs +++ b/src/test/auxiliary/cci_class_6.rs @@ -27,7 +27,7 @@ pub mod kitties { cat { meows: in_x, how_hungry: in_y, - info: move in_info + info: in_info } } } diff --git a/src/test/bench/core-vec-append.rs b/src/test/bench/core-vec-append.rs index b8766d86b01..1dfcb31f196 100644 --- a/src/test/bench/core-vec-append.rs +++ b/src/test/bench/core-vec-append.rs @@ -27,7 +27,7 @@ fn collect_dvec(num: uint) -> ~[uint] { for uint::range(0u, num) |i| { result.push(i); } - return dvec::unwrap(move result); + return dvec::unwrap(result); } fn main() { diff --git a/src/test/bench/graph500-bfs.rs b/src/test/bench/graph500-bfs.rs index e88cb62db73..5910ade013e 100644 --- a/src/test/bench/graph500-bfs.rs +++ b/src/test/bench/graph500-bfs.rs @@ -141,7 +141,7 @@ fn bfs(graph: graph, key: node_id) -> bfs_result { }; } - move marks + marks } /** @@ -260,7 +260,7 @@ fn pbfs(&&graph: arc::ARC, key: node_id) -> bfs_result { i += 1; let old_len = colors.len(); - let color = arc::ARC(move colors); + let color = arc::ARC(colors); let color_vec = arc::get(&color); // FIXME #3387 requires this temp colors = do par::mapi(*color_vec) { diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs index 5b6c5210dbf..bfbc7ecd20a 100644 --- a/src/test/bench/msgsend-pipes-shared.rs +++ b/src/test/bench/msgsend-pipes-shared.rs @@ -27,7 +27,7 @@ use io::WriterUtil; use pipes::{Port, Chan, SharedChan}; macro_rules! move_out ( - { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } } ) enum request { @@ -58,7 +58,7 @@ fn run(args: &[~str]) { let (from_child, to_parent) = pipes::stream(); let (from_parent, to_child) = pipes::stream(); - let to_child = SharedChan(move to_child); + let to_child = SharedChan(to_child); let size = uint::from_str(args[1]).get(); let workers = uint::from_str(args[2]).get(); @@ -68,8 +68,8 @@ fn run(args: &[~str]) { for uint::range(0, workers) |_i| { let to_child = to_child.clone(); do task::task().future_result(|+r| { - worker_results.push(move r); - }).spawn |move to_child| { + worker_results.push(r); + }).spawn || { for uint::range(0, size / workers) |_i| { //error!("worker %?: sending %? bytes", i, num_bytes); to_child.send(bytes(num_bytes)); @@ -77,7 +77,7 @@ fn run(args: &[~str]) { //error!("worker %? exiting", i); }; } - do task::spawn |move from_parent, move to_parent| { + do task::spawn || { server(from_parent, to_parent); } diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs index 269d02ae45f..57d9bb49df2 100644 --- a/src/test/bench/msgsend-pipes.rs +++ b/src/test/bench/msgsend-pipes.rs @@ -23,7 +23,7 @@ use io::WriterUtil; use pipes::{Port, PortSet, Chan}; macro_rules! move_out ( - { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } } ) enum request { @@ -54,7 +54,7 @@ fn run(args: &[~str]) { let (from_child, to_parent) = pipes::stream(); let (from_parent_, to_child) = pipes::stream(); let from_parent = PortSet(); - from_parent.add(move from_parent_); + from_parent.add(from_parent_); let size = uint::from_str(args[1]).get(); let workers = uint::from_str(args[2]).get(); @@ -63,10 +63,10 @@ fn run(args: &[~str]) { let mut worker_results = ~[]; for uint::range(0, workers) |_i| { let (from_parent_, to_child) = pipes::stream(); - from_parent.add(move from_parent_); + from_parent.add(from_parent_); do task::task().future_result(|+r| { - worker_results.push(move r); - }).spawn |move to_child| { + worker_results.push(r); + }).spawn || { for uint::range(0, size / workers) |_i| { //error!("worker %?: sending %? bytes", i, num_bytes); to_child.send(bytes(num_bytes)); @@ -74,7 +74,7 @@ fn run(args: &[~str]) { //error!("worker %? exiting", i); }; } - do task::spawn |move from_parent, move to_parent| { + do task::spawn || { server(from_parent, to_parent); } diff --git a/src/test/bench/msgsend-ring-mutex-arcs.rs b/src/test/bench/msgsend-ring-mutex-arcs.rs index 5e1ac20f5eb..9b6fee5e23b 100644 --- a/src/test/bench/msgsend-ring-mutex-arcs.rs +++ b/src/test/bench/msgsend-ring-mutex-arcs.rs @@ -40,7 +40,7 @@ fn recv(p: &pipe) -> uint { fn init() -> (pipe,pipe) { let m = arc::MutexARC(~[]); - ((&m).clone(), move m) + ((&m).clone(), m) } @@ -48,18 +48,18 @@ fn thread_ring(i: uint, count: uint, +num_chan: pipe, +num_port: pipe) { - let mut num_chan = move Some(move num_chan); - let mut num_port = move Some(move num_port); + let mut num_chan = Some(num_chan); + let mut num_port = Some(num_port); // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); let mut num_chan2 = option::swap_unwrap(&mut num_chan); let mut num_port2 = option::swap_unwrap(&mut num_port); send(&num_chan2, i * j); - num_chan = Some(move num_chan2); + num_chan = Some(num_chan2); let _n = recv(&num_port2); //log(error, _n); - num_port = Some(move num_port2); + num_port = Some(num_port2); }; } @@ -77,7 +77,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Some(move num_chan); + let mut num_chan = Some(num_chan); let start = time::precise_time_s(); @@ -89,22 +89,22 @@ fn main() { let (new_chan, num_port) = init(); let num_chan2 = ~mut None; *num_chan2 <-> num_chan; - let num_port = ~mut Some(move num_port); - let new_future = future::spawn(|move num_chan2, move num_port| { + let num_port = ~mut Some(num_port); + let new_future = do future::spawn() || { let mut num_chan = None; num_chan <-> *num_chan2; let mut num_port1 = None; num_port1 <-> *num_port; thread_ring(i, msg_per_task, - option::unwrap(move num_chan), - option::unwrap(move num_port1)) - }); - futures.push(move new_future); - num_chan = Some(move new_chan); + option::unwrap(num_chan), + option::unwrap(num_port1)) + }; + futures.push(new_future); + num_chan = Some(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port); + thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/msgsend-ring-pipes.rs b/src/test/bench/msgsend-ring-pipes.rs index e9281a0c417..71ca0f95765 100644 --- a/src/test/bench/msgsend-ring-pipes.rs +++ b/src/test/bench/msgsend-ring-pipes.rs @@ -29,15 +29,15 @@ proto! ring ( ) macro_rules! move_out ( - ($x:expr) => { unsafe { let y = move *ptr::addr_of(&$x); move y } } + ($x:expr) => { unsafe { let y = *ptr::addr_of(&$x); y } } ) fn thread_ring(i: uint, count: uint, +num_chan: ring::client::num, +num_port: ring::server::num) { - let mut num_chan = move Some(move num_chan); - let mut num_port = move Some(move num_port); + let mut num_chan = Some(num_chan); + let mut num_port = Some(num_port); // Send/Receive lots of messages. for uint::range(0, count) |j| { //error!("task %?, iter %?", i, j); @@ -45,9 +45,9 @@ fn thread_ring(i: uint, let mut num_port2 = None; num_chan2 <-> num_chan; num_port2 <-> num_port; - num_chan = Some(ring::client::num(option::unwrap(move num_chan2), i * j)); - let port = option::unwrap(move num_port2); - match recv(move port) { + num_chan = Some(ring::client::num(option::unwrap(num_chan2), i * j)); + let port = option::unwrap(num_port2); + match recv(port) { ring::num(_n, p) => { //log(error, _n); num_port = Some(move_out!(p)); @@ -70,7 +70,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = ring::init(); - let mut num_chan = Some(move num_chan); + let mut num_chan = Some(num_chan); let start = time::precise_time_s(); @@ -82,23 +82,22 @@ fn main() { let (new_chan, num_port) = ring::init(); let num_chan2 = ~mut None; *num_chan2 <-> num_chan; - let num_port = ~mut Some(move num_port); - let new_future = do future::spawn - |move num_chan2, move num_port| { + let num_port = ~mut Some(num_port); + let new_future = do future::spawn || { let mut num_chan = None; num_chan <-> *num_chan2; let mut num_port1 = None; num_port1 <-> *num_port; thread_ring(i, msg_per_task, - option::unwrap(move num_chan), - option::unwrap(move num_port1)) + option::unwrap(num_chan), + option::unwrap(num_port1)) }; - futures.push(move new_future); - num_chan = Some(move new_chan); + futures.push(new_future); + num_chan = Some(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port); + thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/msgsend-ring-rw-arcs.rs b/src/test/bench/msgsend-ring-rw-arcs.rs index ff88eea598d..eaae8370d6b 100644 --- a/src/test/bench/msgsend-ring-rw-arcs.rs +++ b/src/test/bench/msgsend-ring-rw-arcs.rs @@ -40,7 +40,7 @@ fn recv(p: &pipe) -> uint { fn init() -> (pipe,pipe) { let x = arc::RWARC(~[]); - ((&x).clone(), move x) + ((&x).clone(), x) } @@ -48,18 +48,18 @@ fn thread_ring(i: uint, count: uint, +num_chan: pipe, +num_port: pipe) { - let mut num_chan = move Some(move num_chan); - let mut num_port = move Some(move num_port); + let mut num_chan = Some(num_chan); + let mut num_port = Some(num_port); // Send/Receive lots of messages. for uint::range(0u, count) |j| { //error!("task %?, iter %?", i, j); let mut num_chan2 = option::swap_unwrap(&mut num_chan); let mut num_port2 = option::swap_unwrap(&mut num_port); send(&num_chan2, i * j); - num_chan = Some(move num_chan2); + num_chan = Some(num_chan2); let _n = recv(&num_port2); //log(error, _n); - num_port = Some(move num_port2); + num_port = Some(num_port2); }; } @@ -77,7 +77,7 @@ fn main() { let msg_per_task = uint::from_str(args[2]).get(); let (num_chan, num_port) = init(); - let mut num_chan = Some(move num_chan); + let mut num_chan = Some(num_chan); let start = time::precise_time_s(); @@ -89,23 +89,22 @@ fn main() { let (new_chan, num_port) = init(); let num_chan2 = ~mut None; *num_chan2 <-> num_chan; - let num_port = ~mut Some(move num_port); - let new_future = do future::spawn - |move num_chan2, move num_port| { + let num_port = ~mut Some(num_port); + let new_future = do future::spawn || { let mut num_chan = None; num_chan <-> *num_chan2; let mut num_port1 = None; num_port1 <-> *num_port; thread_ring(i, msg_per_task, - option::unwrap(move num_chan), - option::unwrap(move num_port1)) + option::unwrap(num_chan), + option::unwrap(num_port1)) }; - futures.push(move new_future); - num_chan = Some(move new_chan); + futures.push(new_future); + num_chan = Some(new_chan); }; // do our iteration - thread_ring(0, msg_per_task, option::unwrap(move num_chan), move num_port); + thread_ring(0, msg_per_task, option::unwrap(num_chan), num_port); // synchronize for futures.each |f| { f.get() }; diff --git a/src/test/bench/noise.rs b/src/test/bench/noise.rs index a07dcee35f4..39caba92732 100644 --- a/src/test/bench/noise.rs +++ b/src/test/bench/noise.rs @@ -35,8 +35,8 @@ fn Noise2DContext() -> ~Noise2DContext { r.shuffle_mut(permutations); ~Noise2DContext{ - rgradients: move rgradients, - permutations: move permutations, + rgradients: rgradients, + permutations: permutations, } } diff --git a/src/test/bench/pingpong.rs b/src/test/bench/pingpong.rs index 3d367c54683..11a127b9722 100644 --- a/src/test/bench/pingpong.rs +++ b/src/test/bench/pingpong.rs @@ -45,17 +45,17 @@ proto! pingpong_unbounded ( // This stuff should go in libcore::pipes macro_rules! move_it ( - { $x:expr } => { let t = move *ptr::addr_of(&($x)); move t } + { $x:expr } => { let t = *ptr::addr_of(&($x)); t } ) macro_rules! follow ( { $($message:path($($x: ident),+) -> $next:ident $e:expr)+ } => ( - |m| match move m { - $(Some($message($($x,)* move next)) => { - let $next = move next; - move $e })+ + |m| match m { + $(Some($message($($x,)* next)) => { + let $next = next; + $e })+ _ => { fail!() } } ); @@ -63,10 +63,10 @@ macro_rules! follow ( { $($message:path -> $next:ident $e:expr)+ } => ( - |m| match move m { - $(Some($message(move next)) => { - let $next = move next; - move $e })+ + |m| match m { + $(Some($message(next)) => { + let $next = next; + $e })+ _ => { fail!() } } ) @@ -74,7 +74,7 @@ macro_rules! follow ( fn switch(+endp: pipes::RecvPacketBuffered, f: fn(+v: Option) -> U) -> U { - f(pipes::try_recv(move endp)) + f(pipes::try_recv(endp)) } // Here's the benchmark @@ -84,10 +84,10 @@ fn bounded(count: uint) { let mut ch = do spawn_service(init) |ch| { let mut count = count; - let mut ch = move ch; + let mut ch = ch; while count > 0 { - ch = switch(move ch, follow! ( - ping -> next { server::pong(move next) } + ch = switch(ch, follow! ( + ping -> next { server::pong(next) } )); count -= 1; @@ -96,10 +96,10 @@ fn bounded(count: uint) { let mut count = count; while count > 0 { - let ch_ = client::ping(move ch); + let ch_ = client::ping(ch); - ch = switch(move ch_, follow! ( - pong -> next { move next } + ch = switch(ch_, follow! ( + pong -> next { next } )); count -= 1; @@ -111,10 +111,10 @@ fn unbounded(count: uint) { let mut ch = do spawn_service(init) |ch| { let mut count = count; - let mut ch = move ch; + let mut ch = ch; while count > 0 { - ch = switch(move ch, follow! ( - ping -> next { server::pong(move next) } + ch = switch(ch, follow! ( + ping -> next { server::pong(next) } )); count -= 1; @@ -123,10 +123,10 @@ fn unbounded(count: uint) { let mut count = count; while count > 0 { - let ch_ = client::ping(move ch); + let ch_ = client::ping(ch); - ch = switch(move ch_, follow! ( - pong -> next { move next } + ch = switch(ch_, follow! ( + pong -> next { next } )); count -= 1; diff --git a/src/test/bench/shootout-chameneos-redux.rs b/src/test/bench/shootout-chameneos-redux.rs index 27111ff3b6d..b42ec246ccb 100644 --- a/src/test/bench/shootout-chameneos-redux.rs +++ b/src/test/bench/shootout-chameneos-redux.rs @@ -156,7 +156,7 @@ fn rendezvous(nn: uint, set: ~[color]) { let to_rendezvous_log = to_rendezvous_log.clone(); let (from_rendezvous, to_creature) = stream(); let from_rendezvous = Cell(from_rendezvous); - do task::spawn |move ii, move col| { + do task::spawn || { creature(ii, col, from_rendezvous.take(), to_rendezvous.clone(), to_rendezvous_log.clone()); } diff --git a/src/test/bench/shootout-k-nucleotide-pipes.rs b/src/test/bench/shootout-k-nucleotide-pipes.rs index 3afb86210e1..b1b16975212 100644 --- a/src/test/bench/shootout-k-nucleotide-pipes.rs +++ b/src/test/bench/shootout-k-nucleotide-pipes.rs @@ -128,7 +128,7 @@ fn make_sequence_processor(sz: uint, from_parent: pipes::Port<~[u8]>, _ => { ~"" } }; - to_parent.send(move buffer); + to_parent.send(buffer); } // given a FASTA file on stdin, process sequence THREE @@ -149,23 +149,23 @@ fn main() { // initialize each sequence sorter let sizes = ~[1,2,3,4,6,12,18]; let streams = vec::map(sizes, |_sz| Some(stream())); - let mut streams = move streams; + let mut streams = streams; let mut from_child = ~[]; let to_child = vec::mapi(sizes, |ii, sz| { let sz = *sz; let mut stream = None; stream <-> streams[ii]; - let (from_child_, to_parent_) = option::unwrap(move stream); + let (from_child_, to_parent_) = option::unwrap(stream); - from_child.push(move from_child_); + from_child.push(from_child_); let (from_parent, to_child) = pipes::stream(); - do task::spawn_with(move from_parent) |move to_parent_, from_parent| { + do task::spawn_with(from_parent) |from_parent| { make_sequence_processor(sz, from_parent, to_parent_); }; - move to_child + to_child }); diff --git a/src/test/bench/shootout-mandelbrot.rs b/src/test/bench/shootout-mandelbrot.rs index 76a76887772..5ab9b068d0b 100644 --- a/src/test/bench/shootout-mandelbrot.rs +++ b/src/test/bench/shootout-mandelbrot.rs @@ -172,7 +172,7 @@ fn main() { let pchan = pipes::SharedChan(pchan); for uint::range(0_u, size) |j| { let cchan = pchan.clone(); - do task::spawn |move cchan| { cchan.send(chanmb(j, size)) }; + do task::spawn || { cchan.send(chanmb(j, size)) }; }; writer(path, pport, size); } diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs index ac695421059..2c9da65cc13 100644 --- a/src/test/bench/shootout-pfib.rs +++ b/src/test/bench/shootout-pfib.rs @@ -43,15 +43,15 @@ fn fib(n: int) -> int { } else { let p = pipes::PortSet(); let ch = p.chan(); - task::spawn(|move ch| pfib(ch, n - 1) ); + task::spawn(|| pfib(ch, n - 1) ); let ch = p.chan(); - task::spawn(|move ch| pfib(ch, n - 2) ); + task::spawn(|| pfib(ch, n - 2) ); c.send(p.recv() + p.recv()); } } let (p, ch) = pipes::stream(); - let _t = task::spawn(|move ch| pfib(ch, n) ); + let _t = task::spawn(|| pfib(ch, n) ); p.recv() } @@ -86,7 +86,7 @@ fn stress(num_tasks: int) { let mut results = ~[]; for range(0, num_tasks) |i| { do task::task().future_result(|+r| { - results.push(move r); + results.push(r); }).spawn { stress_task(i); } diff --git a/src/test/bench/task-perf-alloc-unwind.rs b/src/test/bench/task-perf-alloc-unwind.rs index 5f0530871fc..b4b02c3aaa8 100644 --- a/src/test/bench/task-perf-alloc-unwind.rs +++ b/src/test/bench/task-perf-alloc-unwind.rs @@ -99,6 +99,6 @@ fn recurse_or_fail(depth: int, st: Option) { } }; - recurse_or_fail(depth, Some(move st)); + recurse_or_fail(depth, Some(st)); } } diff --git a/src/test/bench/task-perf-jargon-metal-smoke.rs b/src/test/bench/task-perf-jargon-metal-smoke.rs index 06f4213ee7b..f2441755a7b 100644 --- a/src/test/bench/task-perf-jargon-metal-smoke.rs +++ b/src/test/bench/task-perf-jargon-metal-smoke.rs @@ -19,14 +19,14 @@ fn child_generation(gens_left: uint, -c: pipes::Chan<()>) { // This used to be O(n^2) in the number of generations that ever existed. // With this code, only as many generations are alive at a time as tasks // alive at a time, - let c = ~mut Some(move c); - do task::spawn_supervised |move c| { + let c = ~mut Some(c); + do task::spawn_supervised || { let c = option::swap_unwrap(c); if gens_left & 1 == 1 { task::yield(); // shake things up a bit } if gens_left > 0 { - child_generation(gens_left - 1, move c); // recurse + child_generation(gens_left - 1, c); // recurse } else { c.send(()) } @@ -44,7 +44,7 @@ fn main() { }; let (p,c) = pipes::stream(); - child_generation(uint::from_str(args[1]).get(), move c); + child_generation(uint::from_str(args[1]).get(), c); if p.try_recv().is_none() { fail!(~"it happened when we slumbered"); } diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs index 4a6195b1ae8..3b6ececaef9 100644 --- a/src/test/bench/task-perf-linked-failure.rs +++ b/src/test/bench/task-perf-linked-failure.rs @@ -46,9 +46,9 @@ fn grandchild_group(num_tasks: uint) { fn spawn_supervised_blocking(myname: &str, +f: fn~()) { let mut res = None; - task::task().future_result(|+r| res = Some(move r)).supervised().spawn(move f); + task::task().future_result(|+r| res = Some(r)).supervised().spawn(f); error!("%s group waiting", myname); - let x = option::unwrap(move res).recv(); + let x = option::unwrap(res).recv(); assert x == task::Success; } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs index 298e5d53c94..e9bc4a5e195 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs @@ -18,8 +18,8 @@ impl Drop for X { fn main() { let x = Some(X { x: () }); - match move x { - Some(ref _y @ move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + match x { + Some(ref _y @ _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs index 162a10a370b..6548adddf19 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs @@ -18,8 +18,8 @@ impl Drop for X { fn main() { let x = Some((X { x: () }, X { x: () })); - match move x { - Some((ref _y, move _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + match x { + Some((ref _y, _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs index 1aed491bbf0..aaa9d9f920a 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs @@ -20,8 +20,8 @@ enum double_option { some2(T,U), none2 } fn main() { let x = some2(X { x: () }, X { x: () }); - match move x { - some2(ref _y, move _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + match x { + some2(ref _y, _z) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern none2 => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs index 9c879e29709..b5686b64c81 100644 --- a/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs +++ b/src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs @@ -18,8 +18,8 @@ impl Drop for X { fn main() { let x = Some((X { x: () }, X { x: () })); - match move x { - Some((move _y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern + match x { + Some((_y, ref _z)) => { }, //~ ERROR cannot bind by-move and by-ref in the same pattern None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-guards.rs b/src/test/compile-fail/bind-by-move-no-guards.rs index 82f4d57911b..40a444df12d 100644 --- a/src/test/compile-fail/bind-by-move-no-guards.rs +++ b/src/test/compile-fail/bind-by-move-no-guards.rs @@ -12,9 +12,9 @@ fn main() { let (p,c) = pipes::stream(); let x = Some(p); c.send(false); - match move x { - Some(move z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard - Some(move z) => { assert !z.recv(); }, + match x { + Some(z) if z.recv() => { fail!() }, //~ ERROR cannot bind by-move into a pattern guard + Some(z) => { assert !z.recv(); }, None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs index 586285d9566..c8537afa190 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-1.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-1.rs @@ -21,7 +21,7 @@ impl Drop for X { fn main() { let x = Some(X { x: () }); match x { - Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue + Some(_z) => { }, //~ ERROR cannot bind by-move when matching an lvalue None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs index 9ed48fe33e3..26b1084c091 100644 --- a/src/test/compile-fail/bind-by-move-no-lvalues-2.rs +++ b/src/test/compile-fail/bind-by-move-no-lvalues-2.rs @@ -23,7 +23,7 @@ struct Y { y: Option } fn main() { let x = Y { y: Some(X { x: () }) }; match x.y { - Some(move _z) => { }, //~ ERROR cannot bind by-move when matching an lvalue + Some(_z) => { }, //~ ERROR cannot bind by-move when matching an lvalue None => fail!() } } diff --git a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs index d60ef84f040..c86158be5ea 100644 --- a/src/test/compile-fail/bind-by-move-no-sub-bindings.rs +++ b/src/test/compile-fail/bind-by-move-no-sub-bindings.rs @@ -18,8 +18,8 @@ impl Drop for X { fn main() { let x = Some(X { x: () }); - match move x { - Some(move _y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings + match x { + Some(_y @ ref _z) => { }, //~ ERROR cannot bind by-move with sub-bindings None => fail!() } } diff --git a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs index 0b9375bc543..7b6484fd4aa 100644 --- a/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs +++ b/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs @@ -20,6 +20,6 @@ impl Add for foo { fn main() { let x = foo(~3); - let _y = x + move x; + let _y = x + x; //~^ ERROR moving out of immutable local variable prohibited due to outstanding loan } 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 71546835659..8f332646bbc 100644 --- a/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs +++ b/src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs @@ -9,7 +9,7 @@ // except according to those terms. fn foo(x: *~int) -> ~int { - let y = move *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block + let y = *x; //~ ERROR dereference of unsafe pointer requires unsafe function or block return y; } diff --git a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs index deebff5f43a..cec81d8a6ef 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-element-loan.rs @@ -4,7 +4,7 @@ fn a() -> &[int] { [_a, ..tail] => tail, _ => fail!(~"foo") }; - move tail + tail } fn main() { diff --git a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs index e1ed0f0daa1..714a80def93 100644 --- a/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs +++ b/src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs @@ -4,7 +4,7 @@ fn a() -> &int { [_a, ..tail] => &tail[0], _ => fail!(~"foo") }; - move tail + tail } fn main() { diff --git a/src/test/compile-fail/copy-a-resource.rs b/src/test/compile-fail/copy-a-resource.rs index 95fd9b938f0..f1b31d66b3f 100644 --- a/src/test/compile-fail/copy-a-resource.rs +++ b/src/test/compile-fail/copy-a-resource.rs @@ -23,7 +23,7 @@ fn foo(i:int) -> foo { } fn main() { - let x = move foo(10); + let x = foo(10); let _y = copy x; //~^ ERROR copying a value of non-copyable type `foo` log(error, x); diff --git a/src/test/compile-fail/issue-2548.rs b/src/test/compile-fail/issue-2548.rs index abc73469719..951944e2485 100644 --- a/src/test/compile-fail/issue-2548.rs +++ b/src/test/compile-fail/issue-2548.rs @@ -34,7 +34,7 @@ fn main() { let mut res = foo(x); let mut v = ~[]; - v = move ~[(move res)] + v; //~ instantiating a type parameter with an incompatible type `foo`, which does not fulfill `Copy` + v = ~[(res)] + v; //~ instantiating a type parameter with an incompatible type `foo`, which does not fulfill `Copy` assert (v.len() == 2); } diff --git a/src/test/compile-fail/issue-3177-mutable-struct.rs b/src/test/compile-fail/issue-3177-mutable-struct.rs index 8a65366d2cb..a71826c629b 100644 --- a/src/test/compile-fail/issue-3177-mutable-struct.rs +++ b/src/test/compile-fail/issue-3177-mutable-struct.rs @@ -17,5 +17,5 @@ struct S { fn main() { let a1 = ~S{ s: true, cant_nest: () }; - let _a2 = ~S{ s: move a1, cant_nest: () }; + let _a2 = ~S{ s: a1, cant_nest: () }; } diff --git a/src/test/compile-fail/kindck-nonsendable-1.rs b/src/test/compile-fail/kindck-nonsendable-1.rs index a513e367fe5..c88dae232fa 100644 --- a/src/test/compile-fail/kindck-nonsendable-1.rs +++ b/src/test/compile-fail/kindck-nonsendable-1.rs @@ -14,5 +14,5 @@ fn main() { let x = @3u; let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint` let _ = fn~(copy x) { foo(x); }; //~ ERROR value has non-owned type `@uint` - let _ = fn~(move x) { foo(x); }; //~ ERROR value has non-owned type `@uint` + let _ = fn~() { foo(x); }; //~ ERROR value has non-owned type `@uint` } diff --git a/src/test/compile-fail/liveness-unused.rs b/src/test/compile-fail/liveness-unused.rs index b5157c669a7..970abf4fd94 100644 --- a/src/test/compile-fail/liveness-unused.rs +++ b/src/test/compile-fail/liveness-unused.rs @@ -68,5 +68,5 @@ impl Drop for r { fn main() { let x = r { x: () }; - fn@(move x) { copy x; }; //~ ERROR copying a value of non-copyable type + fn@() { copy x; }; //~ ERROR copying a value of non-copyable type } diff --git a/src/test/compile-fail/noncopyable-class.rs b/src/test/compile-fail/noncopyable-class.rs index 115120ff372..42bad88633c 100644 --- a/src/test/compile-fail/noncopyable-class.rs +++ b/src/test/compile-fail/noncopyable-class.rs @@ -37,7 +37,7 @@ fn foo(i:int) -> foo { } fn main() { - let x = move foo(10); + let x = foo(10); let _y = copy x; //~ ERROR copying a value of non-copyable type log(error, x); } diff --git a/src/test/compile-fail/unique-pinned-nocopy.rs b/src/test/compile-fail/unique-pinned-nocopy.rs index 1eebc770132..12eef71f38b 100644 --- a/src/test/compile-fail/unique-pinned-nocopy.rs +++ b/src/test/compile-fail/unique-pinned-nocopy.rs @@ -17,7 +17,7 @@ impl Drop for r { } fn main() { - let i = move ~r { b: true }; + let i = ~r { b: true }; let _j = copy i; //~ ERROR copying a value of non-copyable type log(debug, i); } diff --git a/src/test/compile-fail/unique-unique-kind.rs b/src/test/compile-fail/unique-unique-kind.rs index 25c42ab4add..d36b53eb2ee 100644 --- a/src/test/compile-fail/unique-unique-kind.rs +++ b/src/test/compile-fail/unique-unique-kind.rs @@ -13,5 +13,5 @@ fn f(_i: T) { fn main() { let i = ~@100; - f(move i); //~ ERROR does not fulfill `Owned` + f(i); //~ ERROR does not fulfill `Owned` } diff --git a/src/test/compile-fail/unique-vec-res.rs b/src/test/compile-fail/unique-vec-res.rs index 28a7b37d6e2..4ff9dd6f991 100644 --- a/src/test/compile-fail/unique-vec-res.rs +++ b/src/test/compile-fail/unique-vec-res.rs @@ -24,8 +24,8 @@ fn f(+_i: ~[T], +_j: ~[T]) { fn main() { let i1 = @mut 0; let i2 = @mut 1; - let r1 = move ~[~r { i: i1 }]; - let r2 = move ~[~r { i: i2 }]; + let r1 = ~[~r { i: i1 }]; + let r2 = ~[~r { i: i2 }]; f(copy r1, copy r2); //~^ ERROR copying a value of non-copyable type //~^^ ERROR copying a value of non-copyable type diff --git a/src/test/compile-fail/unsendable-class.rs b/src/test/compile-fail/unsendable-class.rs index e660884e40b..8e9ce5f97fc 100644 --- a/src/test/compile-fail/unsendable-class.rs +++ b/src/test/compile-fail/unsendable-class.rs @@ -26,5 +26,5 @@ fn foo(i:int, j: @~str) -> foo { fn main() { let cat = ~"kitty"; let (_, ch) = pipes::stream(); //~ ERROR does not fulfill `Owned` - ch.send(foo(42, @(move cat))); //~ ERROR does not fulfill `Owned` + ch.send(foo(42, @(cat))); //~ ERROR does not fulfill `Owned` } diff --git a/src/test/compile-fail/vec-res-add.rs b/src/test/compile-fail/vec-res-add.rs index f21a202dcd8..b06f91d50f2 100644 --- a/src/test/compile-fail/vec-res-add.rs +++ b/src/test/compile-fail/vec-res-add.rs @@ -22,8 +22,8 @@ impl Drop for r { fn main() { // This can't make sense as it would copy the classes - let i = move ~[r(0)]; - let j = move ~[r(1)]; + let i = ~[r(0)]; + let j = ~[r(1)]; let k = i + j; log(debug, j); } diff --git a/src/test/run-fail/out-of-stack-managed-box.rs b/src/test/run-fail/out-of-stack-managed-box.rs index 85857486cbb..9dcdaacb3c1 100644 --- a/src/test/run-fail/out-of-stack-managed-box.rs +++ b/src/test/run-fail/out-of-stack-managed-box.rs @@ -15,11 +15,11 @@ // error-pattern:ran out of stack fn main() { - eat(move @0); + eat(@0); } fn eat( +a: @int ) { - eat(move a) + eat(a) } diff --git a/src/test/run-fail/out-of-stack-owned-box.rs b/src/test/run-fail/out-of-stack-owned-box.rs index ef5101d1a9c..d4bc70f43ef 100644 --- a/src/test/run-fail/out-of-stack-owned-box.rs +++ b/src/test/run-fail/out-of-stack-owned-box.rs @@ -11,11 +11,11 @@ // xfail-test // error-pattern:ran out of stack fn main() { - eat(move ~0); + eat(~0); } fn eat( +a: ~int ) { - eat(move a) + eat(a) } diff --git a/src/test/run-fail/unwind-box-res.rs b/src/test/run-fail/unwind-box-res.rs index f544438a7ca..ba8f2fa37cb 100644 --- a/src/test/run-fail/unwind-box-res.rs +++ b/src/test/run-fail/unwind-box-res.rs @@ -36,7 +36,7 @@ fn main() { unsafe { let i1 = ~0; let i1p = cast::reinterpret_cast(&i1); - cast::forget(move i1); + cast::forget(i1); let x = @r(i1p); failfn(); log(error, x); diff --git a/src/test/run-fail/unwind-closure.rs b/src/test/run-fail/unwind-closure.rs index 34257b15b7f..6d52046b3e2 100644 --- a/src/test/run-fail/unwind-closure.rs +++ b/src/test/run-fail/unwind-closure.rs @@ -16,6 +16,6 @@ fn f(a: @int) { fn main() { let b = @0; - let g : fn@() = |move b|f(b); + let g : fn@() = || f(b); g(); } diff --git a/src/test/run-fail/unwind-move.rs b/src/test/run-fail/unwind-move.rs index 539896e8313..b2d30688ec5 100644 --- a/src/test/run-fail/unwind-move.rs +++ b/src/test/run-fail/unwind-move.rs @@ -15,5 +15,5 @@ fn f(-_a: @int) { fn main() { let a = @0; - f(move a); + f(a); } diff --git a/src/test/run-fail/unwind-resource-fail.rs b/src/test/run-fail/unwind-resource-fail.rs index 8b9d1a66457..0d57e9279bc 100644 --- a/src/test/run-fail/unwind-resource-fail.rs +++ b/src/test/run-fail/unwind-resource-fail.rs @@ -19,5 +19,5 @@ fn r(i: int) -> r { r { i: i } } fn main() { @0; - let r = move r(0); + let r = r(0); } diff --git a/src/test/run-fail/unwind-resource-fail2.rs b/src/test/run-fail/unwind-resource-fail2.rs index 9c2c1a24a5e..0b33326abe7 100644 --- a/src/test/run-fail/unwind-resource-fail2.rs +++ b/src/test/run-fail/unwind-resource-fail2.rs @@ -20,6 +20,6 @@ fn r(i: int) -> r { r { i: i } } fn main() { @0; - let r = move r(0); + let r = r(0); fail!(); } diff --git a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs index a04d8d4618a..4474aec3d2e 100644 --- a/src/test/run-pass/alt-ref-binding-in-guard-3256.rs +++ b/src/test/run-pass/alt-ref-binding-in-guard-3256.rs @@ -10,7 +10,7 @@ pub fn main() { let x = Some(private::exclusive(true)); - match move x { + match x { Some(ref z) if z.with(|b| *b) => { do z.with |b| { assert *b; } }, diff --git a/src/test/run-pass/argument-passing.rs b/src/test/run-pass/argument-passing.rs index e58dc29578d..ba9266b8a30 100644 --- a/src/test/run-pass/argument-passing.rs +++ b/src/test/run-pass/argument-passing.rs @@ -24,7 +24,7 @@ fn f2(a: int, f: fn(int)) -> int { f(1); return a; } pub fn main() { let mut a = X {mut x: 1}, b = 2, c = 3; - assert (f1(a, &mut b, move c) == 6); + assert (f1(a, &mut b, c) == 6); assert (a.x == 0); assert (b == 10); assert (f2(a.x, |x| a.x = 50 ) == 0); diff --git a/src/test/run-pass/auto-encode.rs b/src/test/run-pass/auto-encode.rs index 53c572e75d0..d4171ceb70f 100644 --- a/src/test/run-pass/auto-encode.rs +++ b/src/test/run-pass/auto-encode.rs @@ -46,7 +46,7 @@ fn test_ebml { impl Pushable for ~[T] { fn push_val(&mut self, +t: T) { - self.push(move t); + self.push(t); } } diff --git a/src/test/run-pass/bind-by-move.rs b/src/test/run-pass/bind-by-move.rs index bdcc6295664..1e836740f8e 100644 --- a/src/test/run-pass/bind-by-move.rs +++ b/src/test/run-pass/bind-by-move.rs @@ -17,8 +17,8 @@ fn dispose(+_x: arc::ARC) unsafe { } pub fn main() { let p = arc::arc(true); let x = Some(p); - match move x { - Some(move z) => { dispose(z); }, + match x { + Some(z) => { dispose(z); }, None => fail!() } } 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 b54791328a0..2d83e9746b5 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 @@ -12,7 +12,7 @@ fn bar(x: *~int) -> ~int { unsafe { - let y = move *x; + let y = *x; return y; } } diff --git a/src/test/run-pass/cap-clause-move.rs b/src/test/run-pass/cap-clause-move.rs index dd4c7ba6a85..e27434400c1 100644 --- a/src/test/run-pass/cap-clause-move.rs +++ b/src/test/run-pass/cap-clause-move.rs @@ -11,21 +11,21 @@ pub fn main() { let x = ~1; let y = ptr::addr_of(&(*x)) as uint; - let lam_move = fn@(move x) -> uint { ptr::addr_of(&(*x)) as uint }; + let lam_move = fn@() -> uint { ptr::addr_of(&(*x)) as uint }; assert lam_move() == y; let x = ~2; let y = ptr::addr_of(&(*x)) as uint; - let lam_move: fn@() -> uint = |move x| ptr::addr_of(&(*x)) as uint; + let lam_move: fn@() -> uint = || ptr::addr_of(&(*x)) as uint; assert lam_move() == y; let x = ~3; let y = ptr::addr_of(&(*x)) as uint; - let snd_move = fn~(move x) -> uint { ptr::addr_of(&(*x)) as uint }; + let snd_move = fn~() -> uint { ptr::addr_of(&(*x)) as uint }; assert snd_move() == y; let x = ~4; let y = ptr::addr_of(&(*x)) as uint; - let lam_move: fn~() -> uint = |move x| ptr::addr_of(&(*x)) as uint; + let lam_move: fn~() -> uint = || ptr::addr_of(&(*x)) as uint; assert lam_move() == y; } diff --git a/src/test/run-pass/class-poly-methods.rs b/src/test/run-pass/class-poly-methods.rs index b7e638f40e8..5ef5e55b729 100644 --- a/src/test/run-pass/class-poly-methods.rs +++ b/src/test/run-pass/class-poly-methods.rs @@ -26,7 +26,7 @@ fn cat(in_x : uint, in_y : int, -in_info: ~[U]) -> cat { cat { meows: in_x, how_hungry: in_y, - info: move in_info + info: in_info } } diff --git a/src/test/run-pass/dvec-test.rs b/src/test/run-pass/dvec-test.rs index a0c6b666554..cb8b1c5f25f 100644 --- a/src/test/run-pass/dvec-test.rs +++ b/src/test/run-pass/dvec-test.rs @@ -31,6 +31,6 @@ pub fn main() { assert *e == exp[i]; } - let v = dvec::unwrap(move d); + let v = dvec::unwrap(d); assert v == exp; } diff --git a/src/test/run-pass/fn-bare-spawn.rs b/src/test/run-pass/fn-bare-spawn.rs index 163063ab745..c875b805ea3 100644 --- a/src/test/run-pass/fn-bare-spawn.rs +++ b/src/test/run-pass/fn-bare-spawn.rs @@ -11,7 +11,7 @@ // This is what the signature to spawn should look like with bare functions fn spawn(val: T, f: extern fn(T)) { - f(move val); + f(val); } fn f(+i: int) { diff --git a/src/test/run-pass/hashmap-memory.rs b/src/test/run-pass/hashmap-memory.rs index d7a285d58e6..6a12704d4b4 100644 --- a/src/test/run-pass/hashmap-memory.rs +++ b/src/test/run-pass/hashmap-memory.rs @@ -39,7 +39,7 @@ mod map_reduce { for inputs.each |i| { let ctrl = ctrl.clone(); let i = copy *i; - task::spawn(|move i| map_task(ctrl.clone(), copy i) ); + task::spawn(|| map_task(ctrl.clone(), copy i) ); } } diff --git a/src/test/run-pass/init-res-into-things.rs b/src/test/run-pass/init-res-into-things.rs index 0605fac3677..0185b19b481 100644 --- a/src/test/run-pass/init-res-into-things.rs +++ b/src/test/run-pass/init-res-into-things.rs @@ -32,7 +32,7 @@ fn r(i: @mut int) -> r { fn test_box() { let i = @mut 0; { - let a = move @r(i); + let a = @r(i); } assert *i == 1; } @@ -40,7 +40,7 @@ fn test_box() { fn test_rec() { let i = @mut 0; { - let a = move Box {x: r(i)}; + let a = Box {x: r(i)}; } assert *i == 1; } @@ -52,7 +52,7 @@ fn test_tag() { let i = @mut 0; { - let a = move t0(r(i)); + let a = t0(r(i)); } assert *i == 1; } @@ -60,7 +60,7 @@ fn test_tag() { fn test_tup() { let i = @mut 0; { - let a = move (r(i), 0); + let a = (r(i), 0); } assert *i == 1; } @@ -68,7 +68,7 @@ fn test_tup() { fn test_unique() { let i = @mut 0; { - let a = move ~r(i); + let a = ~r(i); } assert *i == 1; } @@ -76,7 +76,7 @@ fn test_unique() { fn test_box_rec() { let i = @mut 0; { - let a = move @Box { + let a = @Box { x: r(i) }; } diff --git a/src/test/run-pass/intrinsic-move-val.rs b/src/test/run-pass/intrinsic-move-val.rs index b17eb37438a..9e8e9d8bc15 100644 --- a/src/test/run-pass/intrinsic-move-val.rs +++ b/src/test/run-pass/intrinsic-move-val.rs @@ -18,7 +18,7 @@ pub fn main() { unsafe { let mut x = @1; let mut y = @2; - rusti::move_val(&mut y, move x); + rusti::move_val(&mut y, x); assert *y == 1; } } diff --git a/src/test/run-pass/issue-1895.rs b/src/test/run-pass/issue-1895.rs index 3d20eb813d8..42c6ae38b6a 100644 --- a/src/test/run-pass/issue-1895.rs +++ b/src/test/run-pass/issue-1895.rs @@ -10,7 +10,7 @@ pub fn main() { let x = 1; - let y = fn@(move x) -> int { + let y = fn@() -> int { x }(); } diff --git a/src/test/run-pass/issue-2185.rs b/src/test/run-pass/issue-2185.rs index ff35b81aad1..f3f7f4dacba 100644 --- a/src/test/run-pass/issue-2185.rs +++ b/src/test/run-pass/issue-2185.rs @@ -35,11 +35,11 @@ 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 = move b0; + let mut b = b0; do self.iter |a| { - b = move blk(b, a); + b = blk(b, a); } - move b + b } fn range(lo: uint, hi: uint, it: fn(uint)) { diff --git a/src/test/run-pass/issue-2718.rs b/src/test/run-pass/issue-2718.rs index 0cae04b60bc..ba7cf0cc45f 100644 --- a/src/test/run-pass/issue-2718.rs +++ b/src/test/run-pass/issue-2718.rs @@ -61,18 +61,18 @@ pub mod pipes { // We should consider moving this to ::core::unsafe, although I // suspect graydon would want us to use void pointers instead. pub unsafe fn uniquify(+x: *T) -> ~T { - unsafe { cast::transmute(move x) } + unsafe { cast::transmute(x) } } pub fn swap_state_acq(+dst: &mut state, src: state) -> state { unsafe { - transmute(rusti::atomic_xchg_acq(transmute(move dst), src as int)) + transmute(rusti::atomic_xchg_acq(transmute(dst), src as int)) } } pub fn swap_state_rel(+dst: &mut state, src: state) -> state { unsafe { - transmute(rusti::atomic_xchg_rel(transmute(move dst), src as int)) + transmute(rusti::atomic_xchg_rel(transmute(dst), src as int)) } } @@ -80,20 +80,20 @@ pub mod pipes { let p = p.unwrap(); let p = unsafe { uniquify(p) }; assert (*p).payload.is_none(); - (*p).payload = move Some(move payload); + (*p).payload = Some(payload); let old_state = swap_state_rel(&mut (*p).state, full); match old_state { empty => { // Yay, fastpath. // The receiver will eventually clean this up. - unsafe { forget(move p); } + unsafe { forget(p); } } full => { fail!(~"duplicate send") } blocked => { // The receiver will eventually clean this up. - unsafe { forget(move p); } + unsafe { forget(p); } } terminated => { // The receiver will never receive this. Rely on drop_glue @@ -113,7 +113,7 @@ pub mod pipes { full => { let mut payload = None; payload <-> (*p).payload; - return Some(option::unwrap(move payload)) + return Some(option::unwrap(payload)) } terminated => { assert old_state == terminated; @@ -128,7 +128,7 @@ pub mod pipes { match swap_state_rel(&mut (*p).state, terminated) { empty | blocked => { // The receiver will eventually clean up. - unsafe { forget(move p) } + unsafe { forget(p) } } full => { // This is impossible @@ -145,7 +145,7 @@ pub mod pipes { match swap_state_rel(&mut (*p).state, terminated) { empty => { // the sender will clean up - unsafe { forget(move p) } + unsafe { forget(p) } } blocked => { // this shouldn't happen. @@ -166,7 +166,7 @@ pub mod pipes { if self.p != None { let mut p = None; p <-> self.p; - sender_terminate(option::unwrap(move p)) + sender_terminate(option::unwrap(p)) } } } @@ -175,7 +175,7 @@ pub mod pipes { fn unwrap() -> *packet { let mut p = None; p <-> self.p; - option::unwrap(move p) + option::unwrap(p) } } @@ -194,7 +194,7 @@ pub mod pipes { if self.p != None { let mut p = None; p <-> self.p; - receiver_terminate(option::unwrap(move p)) + receiver_terminate(option::unwrap(p)) } } } @@ -203,7 +203,7 @@ pub mod pipes { fn unwrap() -> *packet { let mut p = None; p <-> self.p; - option::unwrap(move p) + option::unwrap(p) } } @@ -231,9 +231,9 @@ pub mod pingpong { let addr : *::pipes::send_packet = match &p { &ping(ref x) => { cast::transmute(ptr::addr_of(x)) } }; - let liberated_value = move *addr; - cast::forget(move p); - move liberated_value + let liberated_value = *addr; + cast::forget(p); + liberated_value } } @@ -242,9 +242,9 @@ pub mod pingpong { let addr : *::pipes::send_packet = match &p { &pong(ref x) => { cast::transmute(ptr::addr_of(x)) } }; - let liberated_value = move *addr; - cast::forget(move p); - move liberated_value + let liberated_value = *addr; + cast::forget(p); + liberated_value } } @@ -262,16 +262,16 @@ pub mod pingpong { pub fn do_ping(-c: ping) -> pong { let (sp, rp) = ::pipes::entangle(); - ::pipes::send(move c, pingpong::ping(move sp)); - move rp + ::pipes::send(c, pingpong::ping(sp)); + rp } pub fn do_pong(-c: pong) -> (ping, ()) { - let packet = ::pipes::recv(move c); + let packet = ::pipes::recv(c); if packet.is_none() { fail!(~"sender closed the connection") } - (pingpong::liberate_pong(option::unwrap(move packet)), ()) + (pingpong::liberate_pong(option::unwrap(packet)), ()) } } @@ -282,32 +282,32 @@ pub mod pingpong { pub type pong = ::pipes::send_packet; pub fn do_ping(-c: ping) -> (pong, ()) { - let packet = ::pipes::recv(move c); + let packet = ::pipes::recv(c); if packet.is_none() { fail!(~"sender closed the connection") } - (pingpong::liberate_ping(option::unwrap(move packet)), ()) + (pingpong::liberate_ping(option::unwrap(packet)), ()) } pub fn do_pong(-c: pong) -> ping { let (sp, rp) = ::pipes::entangle(); - ::pipes::send(move c, pingpong::pong(move sp)); - move rp + ::pipes::send(c, pingpong::pong(sp)); + rp } } } fn client(-chan: pingpong::client::ping) { - let chan = pingpong::client::do_ping(move chan); + let chan = pingpong::client::do_ping(chan); log(error, ~"Sent ping"); - let (_chan, _data) = pingpong::client::do_pong(move chan); + let (_chan, _data) = pingpong::client::do_pong(chan); log(error, ~"Received pong"); } fn server(-chan: pingpong::server::ping) { - let (chan, _data) = pingpong::server::do_ping(move chan); + let (chan, _data) = pingpong::server::do_ping(chan); log(error, ~"Received ping"); - let _chan = pingpong::server::do_pong(move chan); + let _chan = pingpong::server::do_pong(chan); log(error, ~"Sent pong"); } @@ -319,12 +319,12 @@ pub fn main() { let client_ = ~mut Some(client_); let server_ = ~mut Some(server_); - task::spawn {|move client_| + task::spawn {|client_| let mut client__ = none; *client_ <-> client__; client(option::unwrap(client__)); }; - task::spawn {|move server_| + task::spawn {|server_| let mut server_ˊ = none; *server_ <-> server_ˊ; server(option::unwrap(server_ˊ)); diff --git a/src/test/run-pass/issue-2834.rs b/src/test/run-pass/issue-2834.rs index b78cefe1c95..84e0f20e61b 100644 --- a/src/test/run-pass/issue-2834.rs +++ b/src/test/run-pass/issue-2834.rs @@ -19,7 +19,7 @@ proto! streamp ( fn rendezvous() { let (c, s) = streamp::init(); - let streams: ~[streamp::client::open] = ~[move c]; + let streams: ~[streamp::client::open] = ~[c]; error!("%?", streams[0]); } diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index eadfa82619a..9a726bedbc3 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -60,7 +60,7 @@ fn square_from_char(c: char) -> square { } fn read_board_grid(+in: rdr) -> ~[~[square]] { - let in = (move in) as io::Reader; + let in = (in) as io::Reader; let mut grid = ~[]; for in.each_line |line| { let mut row = ~[]; diff --git a/src/test/run-pass/issue-2930.rs b/src/test/run-pass/issue-2930.rs index 4b6985f057e..6d22a2ea5ed 100644 --- a/src/test/run-pass/issue-2930.rs +++ b/src/test/run-pass/issue-2930.rs @@ -17,5 +17,5 @@ proto! stream ( pub fn main() { let (bc, _bp) = stream::init(); - stream::client::send(move bc, ~"abc"); + stream::client::send(bc, ~"abc"); } diff --git a/src/test/run-pass/issue-3168.rs b/src/test/run-pass/issue-3168.rs index 02b147e65fc..d40bf6e32cf 100644 --- a/src/test/run-pass/issue-3168.rs +++ b/src/test/run-pass/issue-3168.rs @@ -12,15 +12,15 @@ pub fn main() { let (p,c) = pipes::stream(); - do task::try |move c| { + do task::try || { let (p2,c2) = pipes::stream(); - do task::spawn |move p2| { + do task::spawn || { p2.recv(); error!("sibling fails"); fail!(); } let (p3,c3) = pipes::stream(); - c.send(move c3); + c.send(c3); c2.send(()); error!("child blocks"); p3.recv(); diff --git a/src/test/run-pass/issue-3176.rs b/src/test/run-pass/issue-3176.rs index b5f2a1d22a6..fac73d07b66 100644 --- a/src/test/run-pass/issue-3176.rs +++ b/src/test/run-pass/issue-3176.rs @@ -14,19 +14,19 @@ use pipes::{Select2, Selectable}; pub fn main() { let (p,c) = pipes::stream(); - do task::try |move c| { + do task::try || { let (p2,c2) = pipes::stream(); - do task::spawn |move p2| { + do task::spawn || { p2.recv(); error!("sibling fails"); fail!(); } let (p3,c3) = pipes::stream(); - c.send(move c3); + c.send(c3); c2.send(()); error!("child blocks"); let (p, c) = pipes::stream(); - (move p, move p3).select(); + (p, p3).select(); c.send(()); }; error!("parent tries"); diff --git a/src/test/run-pass/issue-3220.rs b/src/test/run-pass/issue-3220.rs index 71c83e02617..ef65531e554 100644 --- a/src/test/run-pass/issue-3220.rs +++ b/src/test/run-pass/issue-3220.rs @@ -23,5 +23,5 @@ impl thing { fn f(self) {} } pub fn main() { let z = thing(); - (move z).f(); + (z).f(); } diff --git a/src/test/run-pass/issue-3447.rs b/src/test/run-pass/issue-3447.rs index 18b47e2925d..0bcc5983eb7 100644 --- a/src/test/run-pass/issue-3447.rs +++ b/src/test/run-pass/issue-3447.rs @@ -20,7 +20,7 @@ impl list{ next: option::None }; - self.next = Some(@(move newList)); + self.next = Some(@(newList)); } } diff --git a/src/test/run-pass/issue-3878.rs b/src/test/run-pass/issue-3878.rs index dd41d696b3a..a5791e38343 100644 --- a/src/test/run-pass/issue-3878.rs +++ b/src/test/run-pass/issue-3878.rs @@ -11,5 +11,5 @@ pub fn main() { let y = ~1; - move y; + y; } diff --git a/src/test/run-pass/issue-4016.rs b/src/test/run-pass/issue-4016.rs index 515b342faf3..307d7974762 100644 --- a/src/test/run-pass/issue-4016.rs +++ b/src/test/run-pass/issue-4016.rs @@ -20,7 +20,7 @@ trait JD : Deserializable { } fn exec() { let doc = result::unwrap(json::from_str("")); - let _v: T = deserialize(&json::Deserializer(move doc)); + let _v: T = deserialize(&json::Deserializer(doc)); fail!() } diff --git a/src/test/run-pass/last-use-in-block.rs b/src/test/run-pass/last-use-in-block.rs index 9c04ccdcba0..e8083dd3f6b 100644 --- a/src/test/run-pass/last-use-in-block.rs +++ b/src/test/run-pass/last-use-in-block.rs @@ -13,14 +13,14 @@ fn lp(s: ~str, f: fn(~str) -> T) -> T { while false { let r = f(s); - return (move r); + return (r); } fail!(); } fn apply(s: ~str, f: fn(~str) -> T) -> T { fn g(s: ~str, f: fn(~str) -> T) -> T {f(s)} - g(s, |v| { let r = f(v); move r }) + g(s, |v| { let r = f(v); r }) } pub fn main() {} diff --git a/src/test/run-pass/last-use-in-cap-clause.rs b/src/test/run-pass/last-use-in-cap-clause.rs index e8cb47b3738..2fd2cc9d22b 100644 --- a/src/test/run-pass/last-use-in-cap-clause.rs +++ b/src/test/run-pass/last-use-in-cap-clause.rs @@ -15,7 +15,7 @@ struct A { a: ~int } fn foo() -> fn@() -> int { let k = ~22; let _u = A {a: copy k}; - return fn@(move k) -> int { 22 }; + return fn@() -> int { 22 }; } pub fn main() { diff --git a/src/test/run-pass/liveness-move-in-loop.rs b/src/test/run-pass/liveness-move-in-loop.rs index f8166e2443d..8c4b7d57bc2 100644 --- a/src/test/run-pass/liveness-move-in-loop.rs +++ b/src/test/run-pass/liveness-move-in-loop.rs @@ -15,7 +15,7 @@ fn the_loop() { loop { let x = 5; if x > 3 { - list += ~[take(move x)]; + list += ~[take(x)]; } else { break; } diff --git a/src/test/run-pass/log-linearized.rs b/src/test/run-pass/log-linearized.rs index db0b24fca1d..152dcb3d4a7 100644 --- a/src/test/run-pass/log-linearized.rs +++ b/src/test/run-pass/log-linearized.rs @@ -21,7 +21,7 @@ struct V { v: ~[option] } fn mk() -> @Smallintmap { let mut v: ~[option] = ~[]; - return @Smallintmap {mut v: move v}; + return @Smallintmap {mut v: v}; } fn f() { diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index 57f7a3f24db..b5af07207bc 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -25,7 +25,7 @@ struct F { a: A } impl Serializable for F { fn serialize(s: S) { - self.a.serialize(move s); + self.a.serialize(s); } } diff --git a/src/test/run-pass/move-1-unique.rs b/src/test/run-pass/move-1-unique.rs index 380c969fa1c..45ba5eb9748 100644 --- a/src/test/run-pass/move-1-unique.rs +++ b/src/test/run-pass/move-1-unique.rs @@ -13,7 +13,7 @@ struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: ~Triple) -> int { let bar = foo; let mut y: ~Triple; - if x { y = move bar; } else { y = ~Triple{x: 4, y: 5, z: 6}; } + if x { y = bar; } else { y = ~Triple{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 ea6dc94bb8e..35cbe6e080c 100644 --- a/src/test/run-pass/move-1.rs +++ b/src/test/run-pass/move-1.rs @@ -13,7 +13,7 @@ struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: @Triple) -> int { let bar = foo; let mut y: @Triple; - if x { y = move bar; } else { y = @Triple{x: 4, y: 5, z: 6}; } + if x { y = bar; } else { y = @Triple{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 133837089b8..bc3b5405f18 100644 --- a/src/test/run-pass/move-2-unique.rs +++ b/src/test/run-pass/move-2-unique.rs @@ -11,4 +11,4 @@ struct X { x: int, y: int, z: int } -pub fn main() { let x = ~X{x: 1, y: 2, z: 3}; let y = move x; assert (y.y == 2); } +pub fn main() { let x = ~X{x: 1, y: 2, z: 3}; let y = x; assert (y.y == 2); } diff --git a/src/test/run-pass/move-2.rs b/src/test/run-pass/move-2.rs index f2b534765cf..23ec3a178c1 100644 --- a/src/test/run-pass/move-2.rs +++ b/src/test/run-pass/move-2.rs @@ -11,4 +11,4 @@ struct X { x: int, y: int, z: int } -pub fn main() { let x = @X {x: 1, y: 2, z: 3}; let y = move x; assert (y.y == 2); } +pub fn main() { let x = @X {x: 1, y: 2, z: 3}; let y = 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 40d8f9a9bce..82b8d2c9609 100644 --- a/src/test/run-pass/move-3-unique.rs +++ b/src/test/run-pass/move-3-unique.rs @@ -15,7 +15,7 @@ struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: ~Triple) -> int { let bar = foo; let mut y: ~Triple; - if x { y = move bar; } else { y = ~Triple {x: 4, y: 5, z: 6}; } + if x { y = bar; } else { y = ~Triple {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 0e57d0f6126..161dc55f8a3 100644 --- a/src/test/run-pass/move-3.rs +++ b/src/test/run-pass/move-3.rs @@ -15,7 +15,7 @@ struct Triple { x: int, y: int, z: int } fn test(x: bool, foo: @Triple) -> int { let bar = foo; let mut y: @Triple; - if x { y = move bar; } else { y = @Triple{x: 4, y: 5, z: 6}; } + if x { y = bar; } else { y = @Triple{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 7b7b816aeb2..8845bdfffe1 100644 --- a/src/test/run-pass/move-4-unique.rs +++ b/src/test/run-pass/move-4-unique.rs @@ -14,9 +14,9 @@ struct Triple {a: int, b: int, c: int} fn test(foo: ~Triple) -> ~Triple { let foo = foo; - let bar = move foo; - let baz = move bar; - let quux = move baz; + let bar = foo; + let baz = bar; + let quux = baz; return quux; } diff --git a/src/test/run-pass/move-4.rs b/src/test/run-pass/move-4.rs index cdb48b43b35..1a5432620d3 100644 --- a/src/test/run-pass/move-4.rs +++ b/src/test/run-pass/move-4.rs @@ -15,9 +15,9 @@ struct Triple { a: int, b: int, c: int } fn test(foo: @Triple) -> @Triple { let foo = foo; - let bar = move foo; - let baz = move bar; - let quux = move baz; + let bar = foo; + let baz = bar; + let quux = baz; return quux; } diff --git a/src/test/run-pass/move-arg-2-unique.rs b/src/test/run-pass/move-arg-2-unique.rs index e6a3670804b..21969418c34 100644 --- a/src/test/run-pass/move-arg-2-unique.rs +++ b/src/test/run-pass/move-arg-2-unique.rs @@ -13,7 +13,7 @@ fn test(-foo: ~~[int]) { assert (foo[0] == 10); } pub fn main() { let x = ~~[10]; // Test forgetting a local by move-in - test(move x); + test(x); // Test forgetting a temporary by move-in. test(~~[10]); diff --git a/src/test/run-pass/move-arg-2.rs b/src/test/run-pass/move-arg-2.rs index 09dc47ab50e..8c843d2da68 100644 --- a/src/test/run-pass/move-arg-2.rs +++ b/src/test/run-pass/move-arg-2.rs @@ -13,7 +13,7 @@ fn test(-foo: @~[int]) { assert (foo[0] == 10); } pub fn main() { let x = @~[10]; // Test forgetting a local by move-in - test(move x); + test(x); // Test forgetting a temporary by move-in. test(@~[10]); diff --git a/src/test/run-pass/move-arg.rs b/src/test/run-pass/move-arg.rs index 8e65981ebdf..570fa6ee391 100644 --- a/src/test/run-pass/move-arg.rs +++ b/src/test/run-pass/move-arg.rs @@ -10,4 +10,4 @@ fn test(-foo: int) { assert (foo == 10); } -pub fn main() { let x = 10; test(move x); } +pub fn main() { let x = 10; test(x); } diff --git a/src/test/run-pass/move-nullary-fn.rs b/src/test/run-pass/move-nullary-fn.rs index 0aac8857c59..0114eeefbfb 100644 --- a/src/test/run-pass/move-nullary-fn.rs +++ b/src/test/run-pass/move-nullary-fn.rs @@ -12,7 +12,7 @@ fn f2(-thing: fn@()) { } fn f(-thing: fn@()) { - f2(move thing); + f2(thing); } pub fn main() { diff --git a/src/test/run-pass/move-scalar.rs b/src/test/run-pass/move-scalar.rs index 533543ad138..a7ddc4e4cdb 100644 --- a/src/test/run-pass/move-scalar.rs +++ b/src/test/run-pass/move-scalar.rs @@ -12,6 +12,6 @@ pub fn main() { let y: int = 42; let mut x: int; - x = move y; + x = y; assert (x == 42); } diff --git a/src/test/run-pass/move-self.rs b/src/test/run-pass/move-self.rs index 170dd520ed6..37ce1bce9e6 100644 --- a/src/test/run-pass/move-self.rs +++ b/src/test/run-pass/move-self.rs @@ -4,7 +4,7 @@ struct S { impl S { fn foo(self) { - (move self).bar(); + self.bar(); } fn bar(self) { diff --git a/src/test/run-pass/non-legacy-modes.rs b/src/test/run-pass/non-legacy-modes.rs index 6db971121b7..2a1f94a1d8c 100644 --- a/src/test/run-pass/non-legacy-modes.rs +++ b/src/test/run-pass/non-legacy-modes.rs @@ -13,7 +13,7 @@ struct X { } fn apply(x: T, f: fn(T)) { - f(move x); + f(x); } fn check_int(x: int) { diff --git a/src/test/run-pass/option-unwrap.rs b/src/test/run-pass/option-unwrap.rs index 9f787c915e5..7616ff5007e 100644 --- a/src/test/run-pass/option-unwrap.rs +++ b/src/test/run-pass/option-unwrap.rs @@ -21,8 +21,8 @@ impl Drop for dtor { } fn unwrap(+o: Option) -> T { - match move o { - Some(move v) => move v, + match o { + Some(v) => v, None => fail!() } } @@ -32,7 +32,7 @@ pub fn main() { { let b = Some(dtor { x:x }); - let c = unwrap(move b); + let c = unwrap(b); } assert *x == 0; diff --git a/src/test/run-pass/pipe-bank-proto.rs b/src/test/run-pass/pipe-bank-proto.rs index d79160a41c4..bc218e71ede 100644 --- a/src/test/run-pass/pipe-bank-proto.rs +++ b/src/test/run-pass/pipe-bank-proto.rs @@ -44,21 +44,21 @@ proto! bank ( ) macro_rules! move_it ( - { $x:expr } => { unsafe { let y = move *ptr::addr_of(&($x)); move y } } + { $x:expr } => { unsafe { let y = *ptr::addr_of(&($x)); y } } ) fn switch(+endp: pipes::RecvPacket, f: fn(+v: Option) -> U) -> U { - f(pipes::try_recv(move endp)) + f(pipes::try_recv(endp)) } -fn move_it(-x: T) -> T { move x } +fn move_it(-x: T) -> T { x } macro_rules! follow ( { $($message:path$(($($x: ident),+))||* -> $next:ident $e:expr)+ } => ( - |m| match move m { + |m| match m { $(Some($message($($($x,)+)* next)) => { let $next = move_it!(next); $e })+ @@ -70,15 +70,15 @@ macro_rules! follow ( fn client_follow(+bank: bank::client::login) { use bank::*; - let bank = client::login(move bank, ~"theincredibleholk", ~"1234"); - let bank = switch(move bank, follow! ( - ok -> connected { move connected } + let bank = client::login(bank, ~"theincredibleholk", ~"1234"); + let bank = switch(bank, follow! ( + ok -> connected { connected } invalid -> _next { fail!(~"bank closed the connected") } )); - let bank = client::deposit(move bank, 100.00); - let bank = client::withdrawal(move bank, 50.00); - switch(move bank, follow! ( + let bank = client::deposit(bank, 100.00); + let bank = client::withdrawal(bank, 50.00); + switch(bank, follow! ( money(m) -> _next { io::println(~"Yay! I got money!"); } @@ -91,8 +91,8 @@ fn client_follow(+bank: bank::client::login) { fn bank_client(+bank: bank::client::login) { use bank::*; - let bank = client::login(move bank, ~"theincredibleholk", ~"1234"); - let bank = match try_recv(move bank) { + let bank = client::login(bank, ~"theincredibleholk", ~"1234"); + let bank = match try_recv(bank) { Some(ok(connected)) => { move_it!(connected) } @@ -100,9 +100,9 @@ fn bank_client(+bank: bank::client::login) { None => { fail!(~"bank closed the connection") } }; - let bank = client::deposit(move bank, 100.00); - let bank = client::withdrawal(move bank, 50.00); - match try_recv(move bank) { + let bank = client::deposit(bank, 100.00); + let bank = client::withdrawal(bank, 50.00); + match try_recv(bank) { Some(money(*)) => { io::println(~"Yay! I got money!"); } diff --git a/src/test/run-pass/pipe-detect-term.rs b/src/test/run-pass/pipe-detect-term.rs index 6831170734d..2d765423988 100644 --- a/src/test/run-pass/pipe-detect-term.rs +++ b/src/test/run-pass/pipe-detect-term.rs @@ -32,7 +32,7 @@ pub fn main() { let iotask = &uv::global_loop::get(); pipes::spawn_service(oneshot::init, |p| { - match try_recv(move p) { + match try_recv(p) { Some(*) => { fail!() } None => { } } @@ -47,11 +47,11 @@ pub fn main() { fn failtest() { let (c, p) = oneshot::init(); - do task::spawn_with(move c) |_c| { + do task::spawn_with(c) |_c| { fail!(); } - error!("%?", recv(move p)); + error!("%?", recv(p)); // make sure we get killed if we missed it in the receive. loop { task::yield() } } diff --git a/src/test/run-pass/pipe-peek.rs b/src/test/run-pass/pipe-peek.rs index 7dc1feb2417..baa5ba5bf00 100644 --- a/src/test/run-pass/pipe-peek.rs +++ b/src/test/run-pass/pipe-peek.rs @@ -27,7 +27,7 @@ pub fn main() { assert !pipes::peek(&p); - oneshot::client::signal(move c); + oneshot::client::signal(c); assert pipes::peek(&p); } diff --git a/src/test/run-pass/pipe-pingpong-bounded.rs b/src/test/run-pass/pipe-pingpong-bounded.rs index a3b03daf02f..b13b262e864 100644 --- a/src/test/run-pass/pipe-pingpong-bounded.rs +++ b/src/test/run-pass/pipe-pingpong-bounded.rs @@ -36,7 +36,7 @@ mod pingpong { pong: mk_packet::() } }; - do pipes::entangle_buffer(move buffer) |buffer, data| { + do pipes::entangle_buffer(buffer) |buffer, data| { data.ping.set_buffer(buffer); data.pong.set_buffer(buffer); ptr::addr_of(&(data.ping)) @@ -53,9 +53,9 @@ mod pingpong { let b = pipe.reuse_buffer(); let s = SendPacketBuffered(ptr::addr_of(&(b.buffer.data.pong))); let c = RecvPacketBuffered(ptr::addr_of(&(b.buffer.data.pong))); - let message = ::pingpong::ping(move s); - ::pipes::send(move pipe, move message); - move c + let message = ::pingpong::ping(s); + ::pipes::send(pipe, message); + c } } pub type ping = pipes::SendPacketBuffered<::pingpong::ping, @@ -74,9 +74,9 @@ mod pingpong { let b = pipe.reuse_buffer(); let s = SendPacketBuffered(ptr::addr_of(&(b.buffer.data.ping))); let c = RecvPacketBuffered(ptr::addr_of(&(b.buffer.data.ping))); - let message = ::pingpong::pong(move s); - ::pipes::send(move pipe, move message); - move c + let message = ::pingpong::pong(s); + ::pipes::send(pipe, message); + c } } pub type pong = pipes::SendPacketBuffered<::pingpong::pong, @@ -91,34 +91,34 @@ mod test { pub fn client(-chan: ::pingpong::client::ping) { use pingpong::client; - let chan = client::ping(move chan); return; + let chan = client::ping(chan); return; log(error, "Sent ping"); - let pong(_chan) = recv(move chan); + let pong(_chan) = recv(chan); log(error, "Received pong"); } pub fn server(-chan: ::pingpong::server::ping) { use pingpong::server; - let ping(chan) = recv(move chan); return; + let ping(chan) = recv(chan); return; log(error, "Received ping"); - let _chan = server::pong(move chan); + let _chan = server::pong(chan); log(error, "Sent pong"); } } pub fn main() { let (client_, server_) = ::pingpong::init(); - let client_ = ~mut Some(move client_); - let server_ = ~mut Some(move server_); - do task::spawn |move client_| { + let client_ = ~mut Some(client_); + let server_ = ~mut Some(server_); + do task::spawn || { let mut client__ = None; *client_ <-> client__; - test::client(option::unwrap(move client__)); + test::client(option::unwrap(client__)); }; - do task::spawn |move server_| { + do task::spawn || { let mut server_ˊ = None; *server_ <-> server_ˊ; - test::server(option::unwrap(move server_ˊ)); + test::server(option::unwrap(server_ˊ)); }; } diff --git a/src/test/run-pass/pipe-pingpong-proto.rs b/src/test/run-pass/pipe-pingpong-proto.rs index 97afbba42c5..0d71a2c37d1 100644 --- a/src/test/run-pass/pipe-pingpong-proto.rs +++ b/src/test/run-pass/pipe-pingpong-proto.rs @@ -33,35 +33,35 @@ mod test { pub fn client(-chan: ::pingpong::client::ping) { use pingpong::client; - let chan = client::ping(move chan); + let chan = client::ping(chan); log(error, ~"Sent ping"); - let pong(_chan) = recv(move chan); + let pong(_chan) = recv(chan); log(error, ~"Received pong"); } pub fn server(-chan: ::pingpong::server::ping) { use pingpong::server; - let ping(chan) = recv(move chan); + let ping(chan) = recv(chan); log(error, ~"Received ping"); - let _chan = server::pong(move chan); + let _chan = server::pong(chan); log(error, ~"Sent pong"); } } pub fn main() { let (client_, server_) = pingpong::init(); - let client_ = ~mut Some(move client_); - let server_ = ~mut Some(move server_); + let client_ = ~mut Some(client_); + let server_ = ~mut Some(server_); - do task::spawn |move client_| { + do task::spawn || { let mut client__ = None; *client_ <-> client__; - test::client(option::unwrap(move client__)); + test::client(option::unwrap(client__)); }; - do task::spawn |move server_| { + do task::spawn || { let mut server_ˊ = None; *server_ <-> server_ˊ; - test::server(option::unwrap(move server_ˊ)); + test::server(option::unwrap(server_ˊ)); }; } diff --git a/src/test/run-pass/pipe-presentation-examples.rs b/src/test/run-pass/pipe-presentation-examples.rs index 401c32b67f9..5fd1bb276c1 100644 --- a/src/test/run-pass/pipe-presentation-examples.rs +++ b/src/test/run-pass/pipe-presentation-examples.rs @@ -34,10 +34,10 @@ macro_rules! select_if ( ], )* } => { if $index == $count { - match move pipes::try_recv(move $port) { - $(Some($message($($(move $x,)+)* move next)) => { - let $next = move next; - move $e + match pipes::try_recv($port) { + $(Some($message($($($x,)+)* next)) => { + let $next = next; + $e })+ _ => fail!() } @@ -105,33 +105,33 @@ fn render(_buffer: &Buffer) { } fn draw_frame(+channel: double_buffer::client::acquire) { - let channel = request(move channel); + let channel = request(channel); select! ( channel => { give_buffer(buffer) -> channel { render(&buffer); - release(move channel, move buffer) + release(channel, buffer) } } ); } fn draw_two_frames(+channel: double_buffer::client::acquire) { - let channel = request(move channel); + let channel = request(channel); let channel = select! ( channel => { give_buffer(buffer) -> channel { render(&buffer); - release(move channel, move buffer) + release(channel, buffer) } } ); - let channel = request(move channel); + let channel = request(channel); select! ( channel => { give_buffer(buffer) -> channel { render(&buffer); - release(move channel, move buffer) + release(channel, buffer) } } ); @@ -152,7 +152,7 @@ fn draw_two_frames_bad1(+channel: double_buffer::client::acquire) { channel => { give_buffer(buffer) -> channel { render(&buffer); - release(channel, move buffer) + release(channel, buffer) } } ); @@ -165,9 +165,9 @@ fn draw_two_frames_bad2(+channel: double_buffer::client::acquire) { channel => { give_buffer(buffer) -> channel { render(&buffer); - release(channel, move buffer); + release(channel, buffer); render(&buffer); - release(channel, move buffer); + release(channel, buffer); } } ); diff --git a/src/test/run-pass/pipe-select.rs b/src/test/run-pass/pipe-select.rs index 62765d71398..0bf739139cf 100644 --- a/src/test/run-pass/pipe-select.rs +++ b/src/test/run-pass/pipe-select.rs @@ -41,24 +41,24 @@ pub fn main() { let c = pipes::spawn_service(stream::init, |p| { error!("waiting for pipes"); - let stream::send(x, p) = recv(move p); + let stream::send(x, p) = recv(p); error!("got pipes"); let (left, right) : (oneshot::server::waiting, oneshot::server::waiting) - = move x; + = x; error!("selecting"); - let (i, _, _) = select(~[move left, move right]); + let (i, _, _) = select(~[left, right]); error!("selected"); assert i == 0; error!("waiting for pipes"); - let stream::send(x, _) = recv(move p); + let stream::send(x, _) = recv(p); error!("got pipes"); let (left, right) : (oneshot::server::waiting, oneshot::server::waiting) - = move x; + = x; error!("selecting"); - let (i, m, _) = select(~[move left, move right]); + let (i, m, _) = select(~[left, right]); error!("selected %?", i); if m.is_some() { assert i == 1; @@ -68,20 +68,20 @@ pub fn main() { let (c1, p1) = oneshot::init(); let (_c2, p2) = oneshot::init(); - let c = send(move c, (move p1, move p2)); + let c = send(c, (p1, p2)); sleep(iotask, 100); - signal(move c1); + signal(c1); let (_c1, p1) = oneshot::init(); let (c2, p2) = oneshot::init(); - send(move c, (move p1, move p2)); + send(c, (p1, p2)); sleep(iotask, 100); - signal(move c2); + signal(c2); test_select2(); } @@ -90,26 +90,26 @@ fn test_select2() { let (ac, ap) = stream::init(); let (bc, bp) = stream::init(); - stream::client::send(move ac, 42); + stream::client::send(ac, 42); - match pipes::select2(move ap, move bp) { + match pipes::select2(ap, bp) { either::Left(*) => { } either::Right(*) => { fail!() } } - stream::client::send(move bc, ~"abc"); + stream::client::send(bc, ~"abc"); error!("done with first select2"); let (ac, ap) = stream::init(); let (bc, bp) = stream::init(); - stream::client::send(move bc, ~"abc"); + stream::client::send(bc, ~"abc"); - match pipes::select2(move ap, move bp) { + match pipes::select2(ap, bp) { either::Left(*) => { fail!() } either::Right(*) => { } } - stream::client::send(move ac, 42); + stream::client::send(ac, 42); } diff --git a/src/test/run-pass/pipe-sleep.rs b/src/test/run-pass/pipe-sleep.rs index ac4829a9c19..521c400489e 100644 --- a/src/test/run-pass/pipe-sleep.rs +++ b/src/test/run-pass/pipe-sleep.rs @@ -26,10 +26,10 @@ proto! oneshot ( pub fn main() { use oneshot::client::*; - let c = pipes::spawn_service(oneshot::init, |p| { recv(move p); }); + let c = pipes::spawn_service(oneshot::init, |p| { recv(p); }); let iotask = &uv::global_loop::get(); sleep(iotask, 500); - signal(move c); + signal(c); } diff --git a/src/test/run-pass/regions-copy-closure.rs b/src/test/run-pass/regions-copy-closure.rs index bfb4ac5f60c..ff3e115eda9 100644 --- a/src/test/run-pass/regions-copy-closure.rs +++ b/src/test/run-pass/regions-copy-closure.rs @@ -13,7 +13,7 @@ struct closure_box { } fn box_it(+x: &r/fn()) -> closure_box/&r { - closure_box {cl: move x} + closure_box {cl: x} } pub fn main() { diff --git a/src/test/run-pass/regions-static-closure.rs b/src/test/run-pass/regions-static-closure.rs index 8b7fbfd3758..00f5e695475 100644 --- a/src/test/run-pass/regions-static-closure.rs +++ b/src/test/run-pass/regions-static-closure.rs @@ -13,7 +13,7 @@ struct closure_box { } fn box_it(+x: &r/fn()) -> closure_box/&r { - closure_box {cl: move x} + closure_box {cl: x} } fn call_static_closure(cl: closure_box/&static) { @@ -22,5 +22,5 @@ fn call_static_closure(cl: closure_box/&static) { pub fn main() { let cl_box = box_it(|| debug!("Hello, world!")); - call_static_closure(move cl_box); + call_static_closure(cl_box); } diff --git a/src/test/run-pass/resource-assign-is-not-copy.rs b/src/test/run-pass/resource-assign-is-not-copy.rs index ee28c96defc..af3c92db8f6 100644 --- a/src/test/run-pass/resource-assign-is-not-copy.rs +++ b/src/test/run-pass/resource-assign-is-not-copy.rs @@ -29,8 +29,8 @@ pub fn main() { // Even though these look like copies, they are guaranteed not to be { let a = r(i); - let b = (move a, 10); - let (c, _d) = move b; + let b = (a, 10); + let (c, _d) = b; log(debug, c); } assert *i == 1; diff --git a/src/test/run-pass/resource-cycle.rs b/src/test/run-pass/resource-cycle.rs index fb9a1e8117a..d47d56b6021 100644 --- a/src/test/run-pass/resource-cycle.rs +++ b/src/test/run-pass/resource-cycle.rs @@ -45,10 +45,10 @@ pub fn main() { unsafe { let i1 = ~0; let i1p = cast::reinterpret_cast(&i1); - cast::forget(move i1); + cast::forget(i1); let i2 = ~0; let i2p = cast::reinterpret_cast(&i2); - cast::forget(move i2); + cast::forget(i2); let x1 = @t(Node{ mut next: None, @@ -56,7 +56,7 @@ pub fn main() { let rs = r(i1p); debug!("r = %x", cast::reinterpret_cast::<*r, uint>(&ptr::addr_of(&rs))); - move rs } + rs } }); debug!("x1 = %x, x1.r = %x", @@ -69,7 +69,7 @@ pub fn main() { let rs = r(i2p); debug!("r2 = %x", cast::reinterpret_cast::<*r, uint>(&ptr::addr_of(&rs))); - move rs + rs } }); diff --git a/src/test/run-pass/resource-cycle2.rs b/src/test/run-pass/resource-cycle2.rs index eea5c43bb99..1b39093c7d0 100644 --- a/src/test/run-pass/resource-cycle2.rs +++ b/src/test/run-pass/resource-cycle2.rs @@ -45,10 +45,10 @@ pub fn main() { unsafe { let i1 = ~0xA; let i1p = cast::reinterpret_cast(&i1); - cast::forget(move i1); + cast::forget(i1); let i2 = ~0xA; let i2p = cast::reinterpret_cast(&i2); - cast::forget(move i2); + cast::forget(i2); let u1 = U {a: 0xB, b: 0xC, c: i1p}; let u2 = U {a: 0xB, b: 0xC, c: i2p}; diff --git a/src/test/run-pass/resource-cycle3.rs b/src/test/run-pass/resource-cycle3.rs index 544d82e7995..036ca249669 100644 --- a/src/test/run-pass/resource-cycle3.rs +++ b/src/test/run-pass/resource-cycle3.rs @@ -54,10 +54,10 @@ pub fn main() { unsafe { let i1 = ~0xA; let i1p = cast::reinterpret_cast(&i1); - cast::forget(move i1); + cast::forget(i1); let i2 = ~0xA; let i2p = cast::reinterpret_cast(&i2); - cast::forget(move i2); + cast::forget(i2); let u1 = U {a: 0xB, b: 0xC, c: i1p}; let u2 = U {a: 0xB, b: 0xC, c: i2p}; diff --git a/src/test/run-pass/resource-destruct.rs b/src/test/run-pass/resource-destruct.rs index 7b5456e2189..3dc4ca7bd61 100644 --- a/src/test/run-pass/resource-destruct.rs +++ b/src/test/run-pass/resource-destruct.rs @@ -30,7 +30,7 @@ fn shrinky_pointer(i: @@mut int) -> shrinky_pointer { pub fn main() { let my_total = @@mut 10; - { let pt = move shrinky_pointer(my_total); assert (pt.look_at() == 10); } + { let pt = 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 17ce27fa60a..eb25f20607f 100644 --- a/src/test/run-pass/resource-generic.rs +++ b/src/test/run-pass/resource-generic.rs @@ -33,6 +33,6 @@ pub fn main() { let box = @mut 10; fn dec_box(&&i: @mut int) { *i -= 1; } - { let _i = move finish(Arg{val: box, fin: dec_box}); } + { let _i = finish(Arg{val: box, fin: dec_box}); } assert (*box == 9); } diff --git a/src/test/run-pass/rt-sched-1.rs b/src/test/run-pass/rt-sched-1.rs index badd9632cc8..cefed420546 100644 --- a/src/test/run-pass/rt-sched-1.rs +++ b/src/test/run-pass/rt-sched-1.rs @@ -46,7 +46,7 @@ pub fn main() { }; let fptr = cast::reinterpret_cast(&ptr::addr_of(&f)); rustrt::start_task(new_task_id, fptr); - cast::forget(move f); + cast::forget(f); po.recv(); } } diff --git a/src/test/run-pass/select-macro.rs b/src/test/run-pass/select-macro.rs index 45df9cfa610..d576875be10 100644 --- a/src/test/run-pass/select-macro.rs +++ b/src/test/run-pass/select-macro.rs @@ -27,18 +27,18 @@ macro_rules! select_if ( $count:expr, $port:path => [ $(type_this $message:path$(($(x $x: ident),+))dont_type_this* - -> $next:ident => { move $e:expr }),+ + -> $next:ident => { $e:expr }),+ ] $(, $ports:path => [ $(type_this $messages:path$(($(x $xs: ident),+))dont_type_this* - -> $nexts:ident => { move $es:expr }),+ + -> $nexts:ident => { $es:expr }),+ ] )* } => { if $index == $count { - match move pipes::try_recv($port) { - $(Some($message($($(move $x,)+)* move next)) => { - let $next = move next; - move $e + match pipes::try_recv($port) { + $(Some($message($($($x,)+)* next)) => { + let $next = next; + $e })+ _ => fail!() } @@ -48,7 +48,7 @@ macro_rules! select_if ( $count + 1 $(, $ports => [ $(type_this $messages$(($(x $xs),+))dont_type_this* - -> $nexts => { move $es }),+ + -> $nexts => { $es }),+ ])* ) } @@ -64,7 +64,7 @@ macro_rules! select ( } => { let index = pipes::selecti([$(($port).header()),+]); select_if!(index, 0 $(, $port => [ - $(type_this $message$(($(x $x),+))dont_type_this* -> $next => { move $e }),+ + $(type_this $message$(($(x $x),+))dont_type_this* -> $next => { $e }),+ ])+) } ) diff --git a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs index d86dc4d56d7..fce0889e0a9 100644 --- a/src/test/run-pass/sendfn-spawn-with-fn-arg.rs +++ b/src/test/run-pass/sendfn-spawn-with-fn-arg.rs @@ -20,7 +20,7 @@ fn test05() { log(error, *three + n); // will copy x into the closure assert(*three == 3); }; - task::spawn(fn~(move fn_to_send) { + task::spawn(fn~() { test05_start(fn_to_send); }); } diff --git a/src/test/run-pass/static-method-test.rs b/src/test/run-pass/static-method-test.rs index 3402da6c55c..da79bf53fe0 100644 --- a/src/test/run-pass/static-method-test.rs +++ b/src/test/run-pass/static-method-test.rs @@ -23,13 +23,13 @@ fn andand(x1: T, x2: T) -> T { impl bool_like for bool { static fn select(&&b: bool, +x1: A, +x2: A) -> A { - if b { move x1 } else { move x2 } + if b { x1 } else { x2 } } } impl bool_like for int { static fn select(&&b: int, +x1: A, +x2: A) -> A { - if b != 0 { move x1 } else { move x2 } + if b != 0 { x1 } else { x2 } } } diff --git a/src/test/run-pass/task-comm-0.rs b/src/test/run-pass/task-comm-0.rs index b66f295e1ba..aa8a2a9146c 100644 --- a/src/test/run-pass/task-comm-0.rs +++ b/src/test/run-pass/task-comm-0.rs @@ -29,7 +29,7 @@ fn test05_start(ch : Chan) { fn test05() { let (po, ch) = pipes::stream(); - task::spawn(|move ch| test05_start(ch) ); + task::spawn(|| test05_start(ch) ); let mut value = po.recv(); log(error, value); value = po.recv(); diff --git a/src/test/run-pass/task-comm-10.rs b/src/test/run-pass/task-comm-10.rs index a5d55fd823b..289a728efc3 100644 --- a/src/test/run-pass/task-comm-10.rs +++ b/src/test/run-pass/task-comm-10.rs @@ -15,7 +15,7 @@ extern mod std; fn start(c: pipes::Chan>) { let (p, ch) = pipes::stream(); - c.send(move ch); + c.send(ch); let mut a; let mut b; @@ -24,12 +24,12 @@ fn start(c: pipes::Chan>) { log(error, a); b = p.recv(); assert b == ~"B"; - log(error, move b); + log(error, b); } pub fn main() { let (p, ch) = pipes::stream(); - let child = task::spawn(|move ch| start(ch) ); + let child = task::spawn(|| start(ch) ); let c = p.recv(); c.send(~"A"); diff --git a/src/test/run-pass/task-comm-11.rs b/src/test/run-pass/task-comm-11.rs index 498b0b74238..996566abcd8 100644 --- a/src/test/run-pass/task-comm-11.rs +++ b/src/test/run-pass/task-comm-11.rs @@ -15,11 +15,11 @@ extern mod std; fn start(c: pipes::Chan>) { let (p, ch) = pipes::stream(); - c.send(move ch); + c.send(ch); } pub fn main() { let (p, ch) = pipes::stream(); - let child = task::spawn(|move ch| start(ch) ); + let child = task::spawn(|| start(ch) ); let c = p.recv(); } diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs index d32e9454f53..9f23ab1c9df 100644 --- a/src/test/run-pass/task-comm-12.rs +++ b/src/test/run-pass/task-comm-12.rs @@ -17,7 +17,7 @@ fn start(&&task_number: int) { debug!("Started / Finished task."); } fn test00() { let i: int = 0; let mut result = None; - do task::task().future_result(|+r| { result = Some(move r); }).spawn { + do task::task().future_result(|+r| { result = Some(r); }).spawn { start(i) } @@ -29,7 +29,7 @@ fn test00() { } // Try joining tasks that have already finished. - option::unwrap(move result).recv(); + option::unwrap(result).recv(); debug!("Joined task."); } diff --git a/src/test/run-pass/task-comm-13.rs b/src/test/run-pass/task-comm-13.rs index c52facf230b..4ee23ec54d6 100644 --- a/src/test/run-pass/task-comm-13.rs +++ b/src/test/run-pass/task-comm-13.rs @@ -22,6 +22,6 @@ fn start(c: pipes::Chan, start: int, number_of_messages: int) { pub fn main() { debug!("Check that we don't deadlock."); let (p, ch) = pipes::stream(); - task::try(|move ch| start(ch, 0, 10) ); + task::try(|| start(ch, 0, 10) ); debug!("Joined task"); } diff --git a/src/test/run-pass/task-comm-14.rs b/src/test/run-pass/task-comm-14.rs index dbf8c034935..f32fbdd04e6 100644 --- a/src/test/run-pass/task-comm-14.rs +++ b/src/test/run-pass/task-comm-14.rs @@ -19,8 +19,8 @@ pub fn main() { while (i > 0) { log(debug, i); let (p, ch) = pipes::stream(); - po.add(move p); - task::spawn({let i = i; |move ch| child(i, ch)}); + po.add(p); + task::spawn({let i = i; || child(i, ch)}); i = i - 1; } diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs index c65e10d36b7..957066005ac 100644 --- a/src/test/run-pass/task-comm-15.rs +++ b/src/test/run-pass/task-comm-15.rs @@ -28,6 +28,6 @@ pub fn main() { // the child's point of view the receiver may die. We should // drop messages on the floor in this case, and not crash! let (p, ch) = pipes::stream(); - task::spawn(|move ch| start(ch, 10)); + task::spawn(|| start(ch, 10)); p.recv(); } diff --git a/src/test/run-pass/task-comm-16.rs b/src/test/run-pass/task-comm-16.rs index afc9290b62d..648a54d190f 100644 --- a/src/test/run-pass/task-comm-16.rs +++ b/src/test/run-pass/task-comm-16.rs @@ -100,7 +100,7 @@ fn test_tag() { fn test_chan() { let (po, ch) = pipes::stream(); let (po0, ch0) = pipes::stream(); - ch.send(move ch0); + ch.send(ch0); let ch1 = po.recv(); // Does the transmitted channel still work? diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs index 97280d37c63..372a0ea434b 100644 --- a/src/test/run-pass/task-comm-3.rs +++ b/src/test/run-pass/task-comm-3.rs @@ -44,10 +44,10 @@ fn test00() { while i < number_of_tasks { let ch = po.chan(); task::task().future_result(|+r| { - results.push(move r); + results.push(r); }).spawn({ let i = i; - |move ch| test00_start(ch, i, number_of_messages) + || test00_start(ch, i, number_of_messages) }); i = i + 1; } diff --git a/src/test/run-pass/task-comm-7.rs b/src/test/run-pass/task-comm-7.rs index 5ebd191944b..481df2d1d52 100644 --- a/src/test/run-pass/task-comm-7.rs +++ b/src/test/run-pass/task-comm-7.rs @@ -27,19 +27,19 @@ fn test00() { let number_of_messages: int = 10; let c = p.chan(); - do task::spawn |move c| { + do task::spawn || { test00_start(c, number_of_messages * 0, number_of_messages); } let c = p.chan(); - do task::spawn |move c| { + do task::spawn || { test00_start(c, number_of_messages * 1, number_of_messages); } let c = p.chan(); - do task::spawn |move c| { + do task::spawn || { test00_start(c, number_of_messages * 2, number_of_messages); } let c = p.chan(); - do task::spawn |move c| { + do task::spawn || { test00_start(c, number_of_messages * 3, number_of_messages); } diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs index ac259e7f785..d3ed48f7575 100644 --- a/src/test/run-pass/task-comm-9.rs +++ b/src/test/run-pass/task-comm-9.rs @@ -28,8 +28,8 @@ fn test00() { let ch = p.chan(); let mut result = None; - do task::task().future_result(|+r| { result = Some(move r); }).spawn - |move ch| { + do task::task().future_result(|+r| { result = Some(r); }).spawn + || { test00_start(ch, number_of_messages); } @@ -40,7 +40,7 @@ fn test00() { i += 1; } - option::unwrap(move result).recv(); + option::unwrap(result).recv(); assert (sum == number_of_messages * (number_of_messages - 1) / 2); } diff --git a/src/test/run-pass/trait-default-method-bound-subst.rs b/src/test/run-pass/trait-default-method-bound-subst.rs index 3f69a2e5d90..5468970ecf5 100644 --- a/src/test/run-pass/trait-default-method-bound-subst.rs +++ b/src/test/run-pass/trait-default-method-bound-subst.rs @@ -11,13 +11,13 @@ // xfail-test trait A { - fn g(x: T, y: U) -> (T, U) { (move x, move y) } + fn g(x: T, y: U) -> (T, U) { (x, y) } } impl A for int { } fn f>(i: V, j: T, k: U) -> (T, U) { - i.g(move j, move k) + i.g(j, k) } fn main () { diff --git a/src/test/run-pass/trait-default-method-bound-subst2.rs b/src/test/run-pass/trait-default-method-bound-subst2.rs index fcb9f60d762..71f4165db9d 100644 --- a/src/test/run-pass/trait-default-method-bound-subst2.rs +++ b/src/test/run-pass/trait-default-method-bound-subst2.rs @@ -11,13 +11,13 @@ // xfail-test trait A { - fn g(x: T) -> T { move x } + fn g(x: T) -> T { x } } impl A for int { } fn f>(i: V, j: T) -> T { - i.g(move j) + i.g(j) } fn main () { diff --git a/src/test/run-pass/trait-default-method-bound-subst3.rs b/src/test/run-pass/trait-default-method-bound-subst3.rs index c89d4abe3da..f27bd7c0a7b 100644 --- a/src/test/run-pass/trait-default-method-bound-subst3.rs +++ b/src/test/run-pass/trait-default-method-bound-subst3.rs @@ -11,13 +11,13 @@ #[allow(default_methods)]; trait A { - fn g(x: T, y: T) -> (T, T) { (move x, move y) } + fn g(x: T, y: T) -> (T, T) { (x, y) } } impl A for int { } fn f(i: V, j: T, k: T) -> (T, T) { - i.g(move j, move k) + i.g(j, k) } fn main () { diff --git a/src/test/run-pass/trait-default-method-bound-subst4.rs b/src/test/run-pass/trait-default-method-bound-subst4.rs index 7a6dfa33a1a..8ea53417951 100644 --- a/src/test/run-pass/trait-default-method-bound-subst4.rs +++ b/src/test/run-pass/trait-default-method-bound-subst4.rs @@ -11,13 +11,13 @@ #[allow(default_methods)]; trait A { - fn g(x: uint) -> uint { move x } + fn g(x: uint) -> uint { x } } impl A for int { } fn f>(i: V, j: uint) -> uint { - i.g(move j) + i.g(j) } fn main () { diff --git a/src/test/run-pass/trait-to-str.rs b/src/test/run-pass/trait-to-str.rs index 62f4ef89d69..b3ebc2ba820 100644 --- a/src/test/run-pass/trait-to-str.rs +++ b/src/test/run-pass/trait-to-str.rs @@ -40,7 +40,7 @@ pub fn main() { assert indirect(~[10, 20]) == ~"[10, 20]!"; fn indirect2(x: T) -> ~str { - indirect(move x) + indirect(x) } assert indirect2(~[1]) == ~"[1]!"; } diff --git a/src/test/run-pass/unique-decl-move-temp.rs b/src/test/run-pass/unique-decl-move-temp.rs index fd4f428bd9d..96e91093d37 100644 --- a/src/test/run-pass/unique-decl-move-temp.rs +++ b/src/test/run-pass/unique-decl-move-temp.rs @@ -9,6 +9,6 @@ // except according to those terms. pub fn main() { - let i = move ~100; + let i = ~100; assert *i == 100; } diff --git a/src/test/run-pass/unique-decl-move.rs b/src/test/run-pass/unique-decl-move.rs index 27600c04e22..7723eafc035 100644 --- a/src/test/run-pass/unique-decl-move.rs +++ b/src/test/run-pass/unique-decl-move.rs @@ -10,6 +10,6 @@ pub fn main() { let i = ~100; - let j = move i; + let j = i; assert *j == 100; } diff --git a/src/test/run-pass/unique-fn-arg-move.rs b/src/test/run-pass/unique-fn-arg-move.rs index 61cee457b0c..12e9820361d 100644 --- a/src/test/run-pass/unique-fn-arg-move.rs +++ b/src/test/run-pass/unique-fn-arg-move.rs @@ -14,5 +14,5 @@ fn f(-i: ~int) { pub fn main() { let i = ~100; - f(move i); + f(i); } diff --git a/src/test/run-pass/unique-move-drop.rs b/src/test/run-pass/unique-move-drop.rs index fd86d5aa6fe..5988a3e8658 100644 --- a/src/test/run-pass/unique-move-drop.rs +++ b/src/test/run-pass/unique-move-drop.rs @@ -11,6 +11,6 @@ pub fn main() { let i = ~100; let j = ~200; - let j = move i; + let j = i; assert *j == 100; } diff --git a/src/test/run-pass/unique-move-temp.rs b/src/test/run-pass/unique-move-temp.rs index eaa8a1cf7bd..08a496987c0 100644 --- a/src/test/run-pass/unique-move-temp.rs +++ b/src/test/run-pass/unique-move-temp.rs @@ -10,6 +10,6 @@ pub fn main() { let mut i; - i = move ~100; + i = ~100; assert *i == 100; } diff --git a/src/test/run-pass/unique-move.rs b/src/test/run-pass/unique-move.rs index be0426edbe2..5e778d581d3 100644 --- a/src/test/run-pass/unique-move.rs +++ b/src/test/run-pass/unique-move.rs @@ -11,6 +11,6 @@ pub fn main() { let i = ~100; let mut j; - j = move i; + j = i; assert *j == 100; } diff --git a/src/test/run-pass/unreachable-code-1.rs b/src/test/run-pass/unreachable-code-1.rs index 8e900aa7ff3..9c658fdc252 100644 --- a/src/test/run-pass/unreachable-code-1.rs +++ b/src/test/run-pass/unreachable-code-1.rs @@ -12,7 +12,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = move fail!(); + let c = 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 75b2bf090ba..fa93dfd0fe1 100644 --- a/src/test/run-pass/unreachable-code.rs +++ b/src/test/run-pass/unreachable-code.rs @@ -12,7 +12,7 @@ fn id(x: bool) -> bool { x } fn call_id() { - let c = move fail!(); + let c = fail!(); id(c); } diff --git a/src/test/run-pass/unused-move-capture.rs b/src/test/run-pass/unused-move-capture.rs index 8f3a6f91d17..665abe23ee8 100644 --- a/src/test/run-pass/unused-move-capture.rs +++ b/src/test/run-pass/unused-move-capture.rs @@ -10,6 +10,6 @@ pub fn main() { let x = ~1; - let lam_move = fn@(move x) { }; + let lam_move = fn@() { }; lam_move(); } diff --git a/src/test/run-pass/unused-move.rs b/src/test/run-pass/unused-move.rs index 785eb691459..69ce791c1a3 100644 --- a/src/test/run-pass/unused-move.rs +++ b/src/test/run-pass/unused-move.rs @@ -15,5 +15,5 @@ pub fn main() { let y = ~1; - move y; + y; } diff --git a/src/test/run-pass/unwind-resource.rs b/src/test/run-pass/unwind-resource.rs index 62673fc134d..93f1c7b5b45 100644 --- a/src/test/run-pass/unwind-resource.rs +++ b/src/test/run-pass/unwind-resource.rs @@ -33,7 +33,7 @@ fn complainer(c: SharedChan) -> complainer { } fn f(c: SharedChan) { - let _c = move complainer(c); + let _c = complainer(c); fail!(); } diff --git a/src/test/run-pass/unwind-resource2.rs b/src/test/run-pass/unwind-resource2.rs index 967ed727aa5..75ce797cfc8 100644 --- a/src/test/run-pass/unwind-resource2.rs +++ b/src/test/run-pass/unwind-resource2.rs @@ -26,7 +26,7 @@ fn complainer(c: @int) -> complainer { } fn f() { - let c = move complainer(@0); + let c = complainer(@0); fail!(); } diff --git a/src/test/run-pass/weird-exprs.rs b/src/test/run-pass/weird-exprs.rs index 28a5a5ca47b..5b515ae5434 100644 --- a/src/test/run-pass/weird-exprs.rs +++ b/src/test/run-pass/weird-exprs.rs @@ -50,7 +50,7 @@ fn zombiejesus() { fn notsure() { let mut _x; let mut _y = (_x = 0) == (_x = 0); - let mut _z = (_x = move 0) < (_x = 0); + let mut _z = (_x = 0) < (_x = 0); let _a = (_x += 0) == (_x = 0); let _b = (_y <-> _z) == (_y <-> _z); } @@ -73,7 +73,7 @@ fn angrydome() { break; } } -fn evil_lincoln() { let evil = move debug!("lincoln"); } +fn evil_lincoln() { let evil = debug!("lincoln"); } pub 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 3d44cf2669b..df5f5904793 100644 --- a/src/test/run-pass/while-loop-constraints-2.rs +++ b/src/test/run-pass/while-loop-constraints-2.rs @@ -15,7 +15,7 @@ pub fn main() { let mut x: int; while z < 50 { z += 1; - while false { x = move y; y = z; } + while false { x = y; y = z; } log(debug, y); } assert (y == 42 && z == 50); diff --git a/src/test/run-pass/yield.rs b/src/test/run-pass/yield.rs index d5c58bbd0fa..16f43016b8e 100644 --- a/src/test/run-pass/yield.rs +++ b/src/test/run-pass/yield.rs @@ -11,13 +11,13 @@ pub fn main() { let mut result = None; - task::task().future_result(|+r| { result = Some(move r); }).spawn(child); + task::task().future_result(|+r| { result = Some(r); }).spawn(child); error!("1"); task::yield(); error!("2"); task::yield(); error!("3"); - option::unwrap(move result).recv(); + option::unwrap(result).recv(); } fn child() { diff --git a/src/test/run-pass/yield1.rs b/src/test/run-pass/yield1.rs index 1f617062434..ae1271f64e4 100644 --- a/src/test/run-pass/yield1.rs +++ b/src/test/run-pass/yield1.rs @@ -11,10 +11,10 @@ pub fn main() { let mut result = None; - task::task().future_result(|+r| { result = Some(move r); }).spawn(child); + task::task().future_result(|+r| { result = Some(r); }).spawn(child); error!("1"); task::yield(); - option::unwrap(move result).recv(); + option::unwrap(result).recv(); } fn child() { error!("2"); }