]> git.lizzy.rs Git - rust.git/commitdiff
tests/tutorials: Get rid of `move`.
authorLuqman Aden <laden@mozilla.com>
Fri, 15 Feb 2013 10:44:18 +0000 (02:44 -0800)
committerLuqman Aden <laden@mozilla.com>
Fri, 15 Feb 2013 10:49:55 +0000 (02:49 -0800)
150 files changed:
doc/rust.md
doc/tutorial-borrowed-ptr.md
doc/tutorial-tasks.md
doc/tutorial.md
src/librustc/metadata/encoder.rs
src/test/auxiliary/cci_class_6.rs
src/test/bench/core-vec-append.rs
src/test/bench/graph500-bfs.rs
src/test/bench/msgsend-pipes-shared.rs
src/test/bench/msgsend-pipes.rs
src/test/bench/msgsend-ring-mutex-arcs.rs
src/test/bench/msgsend-ring-pipes.rs
src/test/bench/msgsend-ring-rw-arcs.rs
src/test/bench/noise.rs
src/test/bench/pingpong.rs
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-mandelbrot.rs
src/test/bench/shootout-pfib.rs
src/test/bench/task-perf-alloc-unwind.rs
src/test/bench/task-perf-jargon-metal-smoke.rs
src/test/bench/task-perf-linked-failure.rs
src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-1.rs
src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-2.rs
src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-3.rs
src/test/compile-fail/bind-by-move-neither-can-live-while-the-other-survives-4.rs
src/test/compile-fail/bind-by-move-no-guards.rs
src/test/compile-fail/bind-by-move-no-lvalues-1.rs
src/test/compile-fail/bind-by-move-no-lvalues-2.rs
src/test/compile-fail/bind-by-move-no-sub-bindings.rs
src/test/compile-fail/borrowck-loan-in-overloaded-op.rs
src/test/compile-fail/borrowck-move-from-unsafe-ptr.rs
src/test/compile-fail/borrowck-vec-pattern-element-loan.rs
src/test/compile-fail/borrowck-vec-pattern-tail-element-loan.rs
src/test/compile-fail/copy-a-resource.rs
src/test/compile-fail/issue-2548.rs
src/test/compile-fail/issue-3177-mutable-struct.rs
src/test/compile-fail/kindck-nonsendable-1.rs
src/test/compile-fail/liveness-unused.rs
src/test/compile-fail/noncopyable-class.rs
src/test/compile-fail/unique-pinned-nocopy.rs
src/test/compile-fail/unique-unique-kind.rs
src/test/compile-fail/unique-vec-res.rs
src/test/compile-fail/unsendable-class.rs
src/test/compile-fail/vec-res-add.rs
src/test/run-fail/out-of-stack-managed-box.rs
src/test/run-fail/out-of-stack-owned-box.rs
src/test/run-fail/unwind-box-res.rs
src/test/run-fail/unwind-closure.rs
src/test/run-fail/unwind-move.rs
src/test/run-fail/unwind-resource-fail.rs
src/test/run-fail/unwind-resource-fail2.rs
src/test/run-pass/alt-ref-binding-in-guard-3256.rs
src/test/run-pass/argument-passing.rs
src/test/run-pass/auto-encode.rs
src/test/run-pass/auto-ref-sliceable.rs
src/test/run-pass/bind-by-move.rs
src/test/run-pass/borrowck-move-from-unsafe-ptr-ok.rs
src/test/run-pass/cap-clause-move.rs
src/test/run-pass/class-poly-methods.rs
src/test/run-pass/dvec-test.rs
src/test/run-pass/fn-bare-spawn.rs
src/test/run-pass/hashmap-memory.rs
src/test/run-pass/init-res-into-things.rs
src/test/run-pass/intrinsic-move-val.rs
src/test/run-pass/issue-1895.rs
src/test/run-pass/issue-2185.rs
src/test/run-pass/issue-2718.rs
src/test/run-pass/issue-2834.rs
src/test/run-pass/issue-2904.rs
src/test/run-pass/issue-2930.rs
src/test/run-pass/issue-3168.rs
src/test/run-pass/issue-3176.rs
src/test/run-pass/issue-3220.rs
src/test/run-pass/issue-3447.rs
src/test/run-pass/issue-3878.rs
src/test/run-pass/issue-4016.rs
src/test/run-pass/last-use-in-block.rs
src/test/run-pass/last-use-in-cap-clause.rs
src/test/run-pass/liveness-move-in-loop.rs
src/test/run-pass/log-linearized.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs
src/test/run-pass/move-1-unique.rs
src/test/run-pass/move-1.rs
src/test/run-pass/move-2-unique.rs
src/test/run-pass/move-2.rs
src/test/run-pass/move-3-unique.rs
src/test/run-pass/move-3.rs
src/test/run-pass/move-4-unique.rs
src/test/run-pass/move-4.rs
src/test/run-pass/move-arg-2-unique.rs
src/test/run-pass/move-arg-2.rs
src/test/run-pass/move-arg.rs
src/test/run-pass/move-nullary-fn.rs
src/test/run-pass/move-scalar.rs
src/test/run-pass/move-self.rs
src/test/run-pass/non-legacy-modes.rs
src/test/run-pass/option-unwrap.rs
src/test/run-pass/pipe-bank-proto.rs
src/test/run-pass/pipe-detect-term.rs
src/test/run-pass/pipe-peek.rs
src/test/run-pass/pipe-pingpong-bounded.rs
src/test/run-pass/pipe-pingpong-proto.rs
src/test/run-pass/pipe-presentation-examples.rs
src/test/run-pass/pipe-select.rs
src/test/run-pass/pipe-sleep.rs
src/test/run-pass/regions-copy-closure.rs
src/test/run-pass/regions-static-closure.rs
src/test/run-pass/resource-assign-is-not-copy.rs
src/test/run-pass/resource-cycle.rs
src/test/run-pass/resource-cycle2.rs
src/test/run-pass/resource-cycle3.rs
src/test/run-pass/resource-destruct.rs
src/test/run-pass/resource-generic.rs
src/test/run-pass/rt-sched-1.rs
src/test/run-pass/select-macro.rs
src/test/run-pass/sendfn-spawn-with-fn-arg.rs
src/test/run-pass/static-method-test.rs
src/test/run-pass/task-comm-0.rs
src/test/run-pass/task-comm-10.rs
src/test/run-pass/task-comm-11.rs
src/test/run-pass/task-comm-12.rs
src/test/run-pass/task-comm-13.rs
src/test/run-pass/task-comm-14.rs
src/test/run-pass/task-comm-15.rs
src/test/run-pass/task-comm-16.rs
src/test/run-pass/task-comm-3.rs
src/test/run-pass/task-comm-7.rs
src/test/run-pass/task-comm-9.rs
src/test/run-pass/trait-default-method-bound-subst.rs
src/test/run-pass/trait-default-method-bound-subst2.rs
src/test/run-pass/trait-default-method-bound-subst3.rs
src/test/run-pass/trait-default-method-bound-subst4.rs
src/test/run-pass/trait-to-str.rs
src/test/run-pass/unique-decl-move-temp.rs
src/test/run-pass/unique-decl-move.rs
src/test/run-pass/unique-fn-arg-move.rs
src/test/run-pass/unique-move-drop.rs
src/test/run-pass/unique-move-temp.rs
src/test/run-pass/unique-move.rs
src/test/run-pass/unreachable-code-1.rs
src/test/run-pass/unreachable-code.rs
src/test/run-pass/unused-move-capture.rs
src/test/run-pass/unused-move.rs
src/test/run-pass/unwind-resource.rs
src/test/run-pass/unwind-resource2.rs
src/test/run-pass/weird-exprs.rs
src/test/run-pass/while-loop-constraints-2.rs
src/test/run-pass/yield.rs
src/test/run-pass/yield1.rs

index 23035b3b34a0fc511baeefb18763c211ec1bcffb..14efa3fcead884c040696744668021fc849554a3 100644 (file)
@@ -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
index 939051ca6058dcf3a56c63289a1d9746abcd4c74..c13b2528598c18c648956dc5bd38e73637c75216 100644 (file)
@@ -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;
 }
index 5900fc1a9ff2d3ce5db56dc22d8e42379e53c144..a3d0ecaa4ba6552e21b33ceacc16d70ca4272527 100644 (file)
@@ -161,7 +161,7 @@ use pipes::{stream, Port, Chan};
 
 let (port, chan): (Port<int>, Chan<int>) = 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<int>, Chan<int>) = 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);
 };
 
index a825b7f535f727e254faf6ee149987025118ebc9..9550dd927fac36c1457e3e16207c0e1c822649b8 100644 (file)
@@ -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;
index 12c5e3388dbe71d78d98db5a5f0748b1ddaab884..ad418943ec06c24874c4741bc7866010141bdb4a 100644 (file)
@@ -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,
index f4b27e04c1304c792fded807098ceb5d89422a1f..3ab101bc0b4e83183f08d78ca084b56dfa8a939c 100644 (file)
@@ -27,7 +27,7 @@ pub fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> {
         cat {
             meows: in_x,
             how_hungry: in_y,
-            info: move in_info
+            info: in_info
         }
     }
 }
index b8766d86b017a08ad7ce9e67859e9103ce50dc34..1dfcb31f19638853ef4d965744efbf3dc8ea8cfa 100644 (file)
@@ -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() {
index e88cb62db7345fefbed54783b8133639c96039db..5910ade013e8844f595f5d31d802843dc8fe47dd 100644 (file)
@@ -141,7 +141,7 @@ fn bfs(graph: graph, key: node_id) -> bfs_result {
         };
     }
 
-    move marks
+    marks
 }
 
 /**
@@ -260,7 +260,7 @@ fn is_gray_factory() -> ~fn(c: &color) -> bool {
         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) {
index 5b6c5210dbffb6628a9a2c066db5fc07b87b8c37..bfbc7ecd20ac692e1efa907f4f13d160ba23185a 100644 (file)
@@ -27,7 +27,7 @@
 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);
     }
 
index 269d02ae45f339a94eac0de21d316c4932a1aa39..57d9bb49df25ab03bb48a5066f10c2e02a4e9af9 100644 (file)
@@ -23,7 +23,7 @@
 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);
     }
 
index 5e1ac20f5eb9fb0ac7b40f095384bddd1aa2fe92..9b6fee5e23bc1280046f2d808d975df3324878c7 100644 (file)
@@ -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() };
index e9281a0c417361f26c1d52d24ac3026d3a8576a0..71ca0f957657506ad3aae844712715234febfe0a 100644 (file)
 )
 
 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() };
index ff88eea598dfb0954e7249545e6be845ab94d30c..eaae8370d6b8b5b2957c1005c95c8b117907cf74 100644 (file)
@@ -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() };
index a07dcee35f4d35acb6d5c49377b212be1f36f7ab..39caba9273293ba24bf7f31fdf08a1e9c24515e8 100644 (file)
@@ -35,8 +35,8 @@ fn Noise2DContext() -> ~Noise2DContext {
     r.shuffle_mut(permutations);
 
     ~Noise2DContext{
-        rgradients: move rgradients,
-        permutations: move permutations,
+        rgradients: rgradients,
+        permutations: permutations,
     }
 }
 
index 3d367c546838bd1a821547349c7c04eeedc7076d..11a127b9722f407c2a624cc16e13062883ba7bb6 100644 (file)
 
 // 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<T: Owned, Tb: Owned, U>(+endp: pipes::RecvPacketBuffered<T, Tb>,
                       f: fn(+v: Option<T>) -> 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;
index 27111ff3b6d45d39a294a3a01196ecefacf2312e..b42ec246ccb975f935c29fc624ac695eaf1e5272 100644 (file)
@@ -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());
             }
index 3afb86210e1b80c8689c6ddb59893b891f7d6212..b1b169752122eca367540453688e876fd3cd84ab 100644 (file)
@@ -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
     });
 
 
index 76a76887772180d0a6d9cc0a044b7334eeb78187..5ab9b068d0b0eae8d1f8ebef742cced9f2248d6b 100644 (file)
@@ -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);
 }
index ac695421059c71e5f47e68ebda430f89e2c16ccb..2c9da65cc13accd2f57d41e79d7052d50362b5e1 100644 (file)
@@ -43,15 +43,15 @@ fn pfib(c: Chan<int>, n: 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);
         }
index 5f0530871fc835c56f55b4381e241de5543ee04c..b4b02c3aaa8d45c1b195330c21dafa0d80bda600 100644 (file)
@@ -99,6 +99,6 @@ fn recurse_or_fail(depth: int, st: Option<State>) {
           }
         };
 
-        recurse_or_fail(depth, Some(move st));
+        recurse_or_fail(depth, Some(st));
     }
 }
index 06f4213ee7b93809b57b37f08075b446e4613bc5..f2441755a7b1dab0f1f78ab72bdf21e9f64cd7b7 100644 (file)
@@ -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");
     }
index 4a6195b1ae89cbba14c4fa418caa1dc4a4046ffe..3b6ececaef90a5d9953cc37e1e931eade0a07858 100644 (file)
@@ -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;
 }
 
index 298e5d53c940148dfc1ec04876dda21d2a4145d0..e9bc4a5e195d795b740f5777d86d8abd6e359baf 100644 (file)
@@ -18,8 +18,8 @@ fn finalize(&self) {
 
 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!()
     }
 }
index 162a10a370b78369e6f0da3d0fc3a58bad834440..6548adddf1956aa4651c0e8063bb93603aa3d940 100644 (file)
@@ -18,8 +18,8 @@ fn finalize(&self) {
 
 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!()
     }
 }
index 1aed491bbf0694c6b4eec75b3122fa8547e6bbb5..aaa9d9f920a6aa52777fc9a41e98012d90aa07b1 100644 (file)
@@ -20,8 +20,8 @@ enum double_option<T,U> { 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!()
     }
 }
index 9c879e297090f76eb74e82b9bdf9143c3f1be467..b5686b64c810be3391cbf916949fd62c313a2d9d 100644 (file)
@@ -18,8 +18,8 @@ fn finalize(&self) {
 
 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!()
     }
 }
index 82f4d57911b4cae6ed3bf03e07f1b5705a82f7dc..40a444df12d368b162f370d26edb7259af85d5fb 100644 (file)
@@ -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!()
     }
 }
index 586285d9566916f6b8e9d709c220438e805e0312..c8537afa1905e59f5e46232d37087f584e6b138f 100644 (file)
@@ -21,7 +21,7 @@ fn finalize(&self) {
 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!()
     }
 }
index 9ed48fe33e31917e927b2b34dad23a824a0c98f7..26b1084c09172e13df0551c4215051803e282359 100644 (file)
@@ -23,7 +23,7 @@ struct Y { y: Option<X> }
 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!()
     }
 }
index d60ef84f04024ee2318e24a48176ed9b4e34616b..c86158be5ea7f5a11ffcdeffdcd9a613dc2b0ca6 100644 (file)
@@ -18,8 +18,8 @@ fn finalize(&self) {
 
 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!()
     }
 }
index 0b9375bc543a1b526c46930c6e16a418ffe262ad..7b6484fd4aadb649f2c1d11273af65310dd7e288 100644 (file)
@@ -20,6 +20,6 @@ impl Add<foo, foo> 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
 }
index 7154683565960c8f9d05091b95a7e37d294e5780..8f332646bbccde96b333d7c8f8ecb5c908fe40de 100644 (file)
@@ -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;
 }
 
index deebff5f43a3c57443313b07cd22ea1b1636c025..cec81d8a6ef5b4c39935f9aefd3a887944e97f92 100644 (file)
@@ -4,7 +4,7 @@ fn a() -> &[int] {
         [_a, ..tail] => tail,
         _ => fail!(~"foo")
     };
-    move tail
+    tail
 }
 
 fn main() {
index e1ed0f0daa1e8119324d26f03c4020c11c8cb6ca..714a80def9358de21f52a8d8633c88e079919b43 100644 (file)
@@ -4,7 +4,7 @@ fn a() -> &int {
         [_a, ..tail] => &tail[0],
         _ => fail!(~"foo")
     };
-    move tail
+    tail
 }
 
 fn main() {
index 95fd9b938f07b649a0db58b68dc3c1d2ecab1050..f1b31d66b3f685b20666288e06e6676a8b028966 100644 (file)
@@ -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);
index abc734697191f4096219e5d0e1d0404fd6c39eaa..951944e24857f6dda47b26e4c6f1d87dcbb60255 100644 (file)
@@ -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);
     }
 
index 8a65366d2cb438e4dcccd310defbe04607dcb2a0..a71826c629b6c89e92e828da298edebe959142c4 100644 (file)
@@ -17,5 +17,5 @@ struct S<T: Const> {
 
 fn main() {
     let a1  = ~S{ s: true, cant_nest: () };
-    let _a2 = ~S{ s: move a1, cant_nest: () };
+    let _a2 = ~S{ s: a1, cant_nest: () };
 }
index a513e367fe5bc83d904aecd072b1580a4f266446..c88dae232fa0615f21711a0fd82597087e543203 100644 (file)
@@ -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`
 }
index b5157c669a73a5be8ae299863ed946c3539a2f46..970abf4fd94b06864561298dae9fc9e70437cd2a 100644 (file)
@@ -68,5 +68,5 @@ fn finalize(&self) {}
 
 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
 }
index 115120ff37263d6e928605b4c3fa3b5689f8c342..42bad88633cff40315db2266bdc929c2ddb2603f 100644 (file)
@@ -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);
 }
index 1eebc7701328cf6509e3c50eb1e207a905113993..12eef71f38bb3f07cbe53dc859b73da1e2bcb932 100644 (file)
@@ -17,7 +17,7 @@ fn finalize(&self) {}
 }
 
 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);
 }
index 25c42ab4adde508f205c21a581c52e4375075563..d36b53eb2ee719729b6638ef486cc724f0b01c15 100644 (file)
@@ -13,5 +13,5 @@ fn f<T: Owned>(_i: T) {
 
 fn main() {
     let i = ~@100;
-    f(move i); //~ ERROR does not fulfill `Owned`
+    f(i); //~ ERROR does not fulfill `Owned`
 }
index 28a7b37d6e20b1327ec37272778220cb283f6cba..4ff9dd6f9914ef0ea2d2b6a22706c0f02e3c90a3 100644 (file)
@@ -24,8 +24,8 @@ fn f<T>(+_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
index e660884e40b9ef02df36009d9438cbfa5e60def7..8e9ce5f97fc1da0ecc59c3c1026118c051f6f0d1 100644 (file)
@@ -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`
 }
index f21a202dcd82badd6af9a5277eb2aab7929d262d..b06f91d50f25cf0ba24720fa07d56b680f441dc5 100644 (file)
@@ -22,8 +22,8 @@ fn finalize(&self) {}
 
 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);
 }
index 85857486cbbb77d10ee55bef62ecb697bc7fccf3..9dcdaacb3c1a43c824d29532a480da3d67ddc0f2 100644 (file)
 
 // error-pattern:ran out of stack
 fn main() {
-    eat(move @0);
+    eat(@0);
 }
 
 fn eat(
     +a: @int
 ) {
-    eat(move a)
+    eat(a)
 }
index ef5101d1a9cd59315062e93304ed7a484678bc4e..d4bc70f43ef6e768ffb960729221ce5e8d95444c 100644 (file)
 // xfail-test
 // error-pattern:ran out of stack
 fn main() {
-    eat(move ~0);
+    eat(~0);
 }
 
 fn eat(
     +a: ~int
 ) {
-    eat(move a)
+    eat(a)
 }
index f544438a7cae1e1bba2b3eb5e0bff67059c976db..ba8f2fa37cb3b86338f18bd36d201aa4c98c4bc3 100644 (file)
@@ -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);
index 34257b15b7fd8fcb669a243f03dd2d291ecf6756..6d52046b3e2fe8dcbb9b9edd2eb41a42782aa303 100644 (file)
@@ -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();
 }
index 539896e83131988ae8edf654a9143b7bd2007150..b2d30688ec55db08be40bc046714288d5bf8d38c 100644 (file)
@@ -15,5 +15,5 @@ fn f(-_a: @int) {
 
 fn main() {
     let a = @0;
-    f(move a);
+    f(a);
 }
index 8b9d1a66457149cb4af0fd5630333b5e861f13be..0d57e9279bc72bbc313e42efb80fab6436bfe5d1 100644 (file)
@@ -19,5 +19,5 @@ fn r(i: int) -> r { r { i: i } }
 
 fn main() {
     @0;
-    let r = move r(0);
+    let r = r(0);
 }
index 9c2c1a24a5e666496729491f0508425ca1e91558..0b33326abe7190bee5728d953acf3fc0a1e6773e 100644 (file)
@@ -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!();
 }
index a04d8d4618a276f7074656d720ea46fff43bcde2..4474aec3d2e503be58632a711f8e4eb145080329 100644 (file)
@@ -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; }
         },
index e58dc29578d5fd89e51861ce8707fad4a619d9de..ba9266b8a30f2c4963622b4b88b176930556dc04 100644 (file)
@@ -24,7 +24,7 @@ fn f1(a: X, b: &mut int, -c: int) -> int {
 
 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);
index 53c572e75d099d344211c0392f6d398c85375c29..d4171ceb70fd2a9ab69fb35e1793f71df9d399c5 100644 (file)
@@ -46,7 +46,7 @@ fn test_ebml<A:
         let ebml_w = &EBWriter::Encoder(wr);
         a1.encode(ebml_w)
     };
-    let d = EBReader::Doc(@move bytes);
+    let d = EBReader::Doc(@bytes);
     let a2: A = Decodable::decode(&EBReader::Decoder(d));
     assert *a1 == a2;
 }
index 23165d026e81223f2f2801ae682f43b2a494c627..87f70d00f8c9f24b97476be0048ab99b94412b29 100644 (file)
@@ -14,7 +14,7 @@ trait Pushable<T> {
 
 impl<T> Pushable<T> for ~[T] {
     fn push_val(&mut self, +t: T) {
-        self.push(move t);
+        self.push(t);
     }
 }
 
index bdcc629566462216cc006bc438db23a0a41254a5..1e836740f8e81d244de611d0ea692f07287af956 100644 (file)
@@ -17,8 +17,8 @@ fn dispose(+_x: arc::ARC<bool>) 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!()
     }
 }
index b54791328a0cb9636fc104a09f9913745e4a8536..2d83e9746b580951f258bc2625405315e8a3ced8 100644 (file)
@@ -12,7 +12,7 @@
 
 fn bar(x: *~int) -> ~int {
     unsafe {
-        let y = move *x;
+        let y = *x;
         return y;
     }
 }
index dd4c7ba6a85cb923604dc33fee7ea087773ac513..e27434400c1851d1faf2347ae5f83ad33d52b246 100644 (file)
 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;
 }
index b7e638f40e8c01aa472ea6e336584453959badfe..5ef5e55b7293eac539af2a4a53e142b7943a82a8 100644 (file)
@@ -26,7 +26,7 @@ fn cat<U>(in_x : uint, in_y : int, -in_info: ~[U]) -> cat<U> {
     cat {
         meows: in_x,
         how_hungry: in_y,
-        info: move in_info
+        info: in_info
     }
 }
 
index a0c6b666554a39139f1adfd8e5eb3b3cdea07ece..cb8b1c5f25f270675fbc61f054d9c31758bba374 100644 (file)
@@ -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;
 }
index 163063ab745d5031e711e4eab71e77325ff2c89e..c875b805ea3ca9e185e11c9b57b7c95c90aeca74 100644 (file)
@@ -11,7 +11,7 @@
 // This is what the signature to spawn should look like with bare functions
 
 fn spawn<T: Owned>(val: T, f: extern fn(T)) {
-    f(move val);
+    f(val);
 }
 
 fn f(+i: int) {
index d7a285d58e66283232d9bb62eb7efbec1236e614..6a12704d4b4b52d62017cc27ec50c5ac2a528ce9 100644 (file)
@@ -39,7 +39,7 @@ fn start_mappers(ctrl: SharedChan<ctrl_proto>, inputs: ~[~str]) {
         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) );
         }
     }
 
index 0605fac3677bf7a10c4c4accef743d042a3b1347..0185b19b481771d3941b957605db1771a10395c6 100644 (file)
@@ -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 @@ enum t {
 
     let i = @mut 0;
     {
-        let a = move t0(r(i));
+        let a = t0(r(i));
     }
     assert *i == 1;
 }
@@ -60,7 +60,7 @@ enum t {
 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)
         };
     }
index b17eb37438a5064708ed11162c7c9fa293220989..9e8e9d8bc15be1998a915122b8a587df63047aae 100644 (file)
@@ -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;
     }
 }
index 3d20eb813d8b5fced95c1d7546ca3b24f88431d1..42c6ae38b6afbf7c22461b454cf7f279b0ceeca5 100644 (file)
@@ -10,7 +10,7 @@
 
 pub fn main() {
   let x = 1;
-  let y = fn@(move x) -> int {
+  let y = fn@() -> int {
              x
           }();
 }
index ff35b81aad1f66fef39e585b9f3902974b7a1089..f3f7f4dacbad4acc5db73f87d5b5b690de68e0ee 100644 (file)
@@ -35,11 +35,11 @@ fn filter<A,IA:iterable<A>>(self: IA, prd: fn@(A) -> bool, blk: fn(A)) {
 }
 
 fn foldl<A,B,IA:iterable<A>>(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)) {
index 0cae04b60bc74d099773ea933043bfe2cff5f8fd..ba7cf0cc45fbca97342a7262c40f2e52ea3ab836 100644 (file)
@@ -61,18 +61,18 @@ mod rusti {
     // We should consider moving this to ::core::unsafe, although I
     // suspect graydon would want us to use void pointers instead.
     pub unsafe fn uniquify<T>(+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 fn send<T: Owned>(-p: send_packet<T>, -payload: T) {
         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 fn recv<T: Owned>(-p: recv_packet<T>) -> Option<T> {
               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 fn sender_terminate<T: Owned>(p: *packet<T>) {
         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 fn receiver_terminate<T: Owned>(p: *packet<T>) {
         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 @@ fn finalize(&self) {
             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 impl<T: Owned> send_packet<T> {
         fn unwrap() -> *packet<T> {
             let mut p = None;
             p <-> self.p;
-            option::unwrap(move p)
+            option::unwrap(p)
         }
     }
 
@@ -194,7 +194,7 @@ fn finalize(&self) {
             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 impl<T: Owned> recv_packet<T> {
         fn unwrap() -> *packet<T> {
             let mut p = None;
             p <-> self.p;
-            option::unwrap(move p)
+            option::unwrap(p)
         }
     }
 
@@ -231,9 +231,9 @@ pub fn liberate_ping(-p: ping) -> ::pipes::send_packet<pong> {
             let addr : *::pipes::send_packet<pong> = 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 fn liberate_pong(-p: pong) -> ::pipes::send_packet<ping> {
             let addr : *::pipes::send_packet<ping> = 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 client {
         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 server {
         pub type pong = ::pipes::send_packet<pingpong::pong>;
 
         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_ËŠ));
index b78cefe1c95e4d8fb239672934b20919848d007a..84e0f20e61b11eb40e44005c2fb4250d3e1c3576 100644 (file)
@@ -19,7 +19,7 @@
 
 fn rendezvous() {
     let (c, s) = streamp::init();
-    let streams: ~[streamp::client::open<int>] = ~[move c];
+    let streams: ~[streamp::client::open<int>] = ~[c];
 
     error!("%?", streams[0]);
 }
index eadfa82619acd9862586ee94f1c05ffcca085026..9a726bedbc340939326ec0b56ad03d996cf48983 100644 (file)
@@ -60,7 +60,7 @@ fn square_from_char(c: char) -> square {
 }
 
 fn read_board_grid<rdr: &static io::Reader>(+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 = ~[];
index 4b6985f057ead1af1b41e00ce43952caa34db2cf..6d22a2ea5edcf26737ee4a0c84bd17d5508b3e0b 100644 (file)
@@ -17,5 +17,5 @@
 pub fn main() {
     let (bc, _bp) = stream::init();
 
-    stream::client::send(move bc, ~"abc");
+    stream::client::send(bc, ~"abc");
 }
index 02b147e65fce116ed6541568c53e57fe96f99ef3..d40bf6e32cf87a7aa2f682c0f3b09c8707c8529c 100644 (file)
 
 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();
index b5f2a1d22a6e5239375597bf004ee0d26a14645f..fac73d07b6642188bbffd4637b49cfa526754958 100644 (file)
 
 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");
index 71c83e02617ff04a37ce3cf016bfcc4c5a8f7559..ef65531e5546f51ce986d3cd3915ec5374082122 100644 (file)
@@ -23,5 +23,5 @@ impl thing { fn f(self) {} }
 
 pub fn main() {
     let z = thing();
-    (move z).f();
+    (z).f();
 }
index 18b47e2925dd27127147d15b3de29d63e1ca4cf4..0bcc5983eb719590cc49a84064e626d819cba37a 100644 (file)
@@ -20,7 +20,7 @@ fn addEnd(&self, element: &self/T) {
             next: option::None
         };
 
-        self.next = Some(@(move newList));
+        self.next = Some(@(newList));
     }
 }
 
index dd41d696b3a93a10ffcb90d5720d520d8a988ed3..a5791e3834351bdbcdc1994f6c88802582dd8e20 100644 (file)
@@ -11,5 +11,5 @@
 pub fn main()
 {
     let y = ~1;
-    move y;
+    y;
 }
index 515b342faf3dfe6354bcfb79e1dd232972058737..307d7974762f733ac9d923454507b420d931f5a2 100644 (file)
@@ -20,7 +20,7 @@ trait JD : Deserializable<json::Deserializer> { }
 
 fn exec<T: JD>() {
     let doc = result::unwrap(json::from_str(""));
-    let _v: T = deserialize(&json::Deserializer(move doc));
+    let _v: T = deserialize(&json::Deserializer(doc));
     fail!()
 }
 
index 9c04ccdcba0aa461754718aa863a79b72a25f0ac..e8083dd3f6b215339d407f6ca293ec65a0017c0f 100644 (file)
 fn lp<T>(s: ~str, f: fn(~str) -> T) -> T {
     while false {
         let r = f(s);
-        return (move r);
+        return (r);
     }
     fail!();
 }
 
 fn apply<T>(s: ~str, f: fn(~str) -> T) -> T {
     fn g<T>(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() {}
index e8cb47b37384661357a04c7b3ee64ef4cc867c61..2fd2cc9d22b8125cc4df4c0b5b895e6899fddb2e 100644 (file)
@@ -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() {
index f8166e2443d80adf7ca772870b250cecb094a322..8c4b7d57bc201df3ae8463e259ccab8c5fc3f3b9 100644 (file)
@@ -15,7 +15,7 @@ fn the_loop() {
     loop {
         let x = 5;
         if x > 3 {
-            list += ~[take(move x)];
+            list += ~[take(x)];
         } else {
             break;
         }
index db0b24fca1d2d8863980a04bad1d9dcaa62cb285..152dcb3d4a7a7efc3fe2e3edc0da44ec676fcb3d 100644 (file)
@@ -21,7 +21,7 @@ struct V<T> { v: ~[option<T>] }
 
 fn mk<T>() -> @Smallintmap<T> {
     let mut v: ~[option<T>] = ~[];
-    return @Smallintmap {mut v: move v};
+    return @Smallintmap {mut v: v};
 }
 
 fn f<T,U>() {
index 57f7a3f24db2106cb4fd26e57e52657d3a845169..b5af07207bccd2325f36732957af163aa014f2b1 100644 (file)
@@ -25,7 +25,7 @@ struct F<A> { a: A }
 
 impl<A: Copy Serializable> Serializable for F<A> {
     fn serialize<S: Serializer>(s: S) {
-        self.a.serialize(move s);
+        self.a.serialize(s);
     }
 }
 
index 380c969fa1c7dddde31c0ce705081fb28701d554..45ba5eb97481176fc70584ec375b46ed26229e85 100644 (file)
@@ -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;
 }
 
index ea6dc94bb8ef42931bd4feab4543c28592d08b5c..35cbe6e080cc814175a3ea37d6c09dd7768e051f 100644 (file)
@@ -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;
 }
 
index 133837089b8a3cefcb60029e3398bc716f39be99..bc3b5405f1867a92c7239bdded37984adab189be 100644 (file)
@@ -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); }
index f2b534765cf51399a8e606cd59d138d165f48d43..23ec3a178c15a5acd52f6048e1628b392369f879 100644 (file)
@@ -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); }
index 40d8f9a9bcef7dbbbba398894f44931306e1d6d4..82b8d2c96092197a12c0bd73d34c69de674dc83b 100644 (file)
@@ -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;
 }
 
index 0e57d0f612689efa22b1e1ce6324557f12172dc4..161dc55f8a34b34ae2c5d1fbcc1a8ec2458d01a7 100644 (file)
@@ -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;
 }
 
index 7b7b816aeb2ab6fb5e42ae87579d651d27cf7177..8845bdfffe146bfd09c1e87d0754de6fa95d7cbc 100644 (file)
@@ -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;
 }
 
index cdb48b43b35baab391e989bd2f725e5af74d5c3b..1a5432620d3088a44a4065c72366190477c60eb8 100644 (file)
@@ -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;
 }
 
index e6a3670804baeebdec02e0f930650210a718517e..21969418c3451769bf0df414be71d12dfd289c3d 100644 (file)
@@ -13,7 +13,7 @@
 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]);
index 09dc47ab50e00e3fe8a688923759c83b249f2993..8c843d2da682feb2816dd1c706232096390bf12b 100644 (file)
@@ -13,7 +13,7 @@
 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]);
index 8e65981ebdf1c572f1e7cec52b94d35880342b22..570fa6ee39166651267720e6ec82425fad68c758 100644 (file)
@@ -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); }
index 0aac8857c598d23ccbea65f5dbaa1412ca6bbf5a..0114eeefbfb2d8da7b34bde238179534a7191351 100644 (file)
@@ -12,7 +12,7 @@
 fn f2(-thing: fn@()) { }
 
 fn f(-thing: fn@()) {
-    f2(move thing);
+    f2(thing);
 }
 
 pub fn main() {
index 533543ad138cc18e0f1d5c1bd042e0881d118ca2..a7ddc4e4cdbe2032eba4e1ad4c9a87f0cb417ba5 100644 (file)
@@ -12,6 +12,6 @@ pub fn main() {
 
     let y: int = 42;
     let mut x: int;
-    x = move y;
+    x = y;
     assert (x == 42);
 }
index 170dd520ed6f47c046b41993cae97b303d9f37df..37ce1bce9e65973858b295af5bbd4bf6fc851137 100644 (file)
@@ -4,7 +4,7 @@ struct S {
 
 impl S {
     fn foo(self) {
-        (move self).bar();
+        self.bar();
     }
 
     fn bar(self) {
index 6db971121b758c78317379dd0ec735cc254d2ca7..2a1f94a1d8cdf61b4f55524d666ed1d682e3e70f 100644 (file)
@@ -13,7 +13,7 @@ struct X {
 }
 
 fn apply<T>(x: T, f: fn(T)) {
-    f(move x);
+    f(x);
 }
 
 fn check_int(x: int) {
index 9f787c915e59d74738c1bd6cfe46cba6b154e833..7616ff5007eee8d0f24f2d9b1b153a4fd30a42cc 100644 (file)
@@ -21,8 +21,8 @@ fn finalize(&self) {
 }
 
 fn unwrap<T>(+o: Option<T>) -> 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;
index d79160a41c44aac525850d687ddbf29bdff99880..bc218e71ede9b690b62f1e4a228c20562a9fb143 100644 (file)
 )
 
 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<T: Owned, U>(+endp: pipes::RecvPacket<T>,
                       f: fn(+v: Option<T>) -> U) -> U {
-    f(pipes::try_recv(move endp))
+    f(pipes::try_recv(endp))
 }
 
-fn move_it<T>(-x: T) -> T { move x }
+fn move_it<T>(-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!");
       }
index 6831170734d14b6423a2d8a073e1d9e7a7850d2e..2d765423988419035d70d81ea44f581c9dcfdc0c 100644 (file)
@@ -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() }
 }
index 7dc1feb24179b2fd4051be89396fd7b638b26ded..baa5ba5bf00a82d7b62414511caac0b24d8938ad 100644 (file)
@@ -27,7 +27,7 @@ pub fn main() {
 
     assert !pipes::peek(&p);
 
-    oneshot::client::signal(move c);
+    oneshot::client::signal(c);
 
     assert pipes::peek(&p);
 }
index a3b03daf02fbff33259e612e30287fd78c8914e4..b13b262e8645e85fff0d33254ce6dd0f3f6e585d 100644 (file)
@@ -36,7 +36,7 @@ pub fn init() -> (client::ping, server::ping) {
                 pong: mk_packet::<pong>()
             }
         };
-        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 @@ pub fn ping(+pipe: ping) -> pong {
                 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 @@ pub fn pong(+pipe: pong) -> ping {
                 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_ËŠ));
     };
 }
index 97afbba42c5b58034934297780205b39a50753bd..0d71a2c37d162e369c034e195ef09b1b0aa22800 100644 (file)
@@ -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_ËŠ));
     };
 }
index 401c32b67f9d4a0a4f1628a0da8560d42cc3eaea..5fd1bb276c1e85496e75eb216f167d1bbd96f353 100644 (file)
@@ -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);
             }
         }
     );
index 62765d71398fcafe2e4883f473fc6be88027e125..0bf739139cfe18716c1d3b288696a6008ca2ad8f 100644 (file)
@@ -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);
 }
index ac4829a9c19ad2656d190e2b89eee155b4a68865..521c400489e95620eac83d53edfee3fc37ef5b06 100644 (file)
 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);
 }
index bfb4ac5f60c9923debc632e260f5173900993fb5..ff3e115eda9b0caaefcc36ab3ec4eb4268f918fd 100644 (file)
@@ -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() {
index 8b7fbfd3758c0a2bbd5f1e1fafc825f2f739506b..00f5e695475a28c9bc412f2cf46dc576286981ff 100644 (file)
@@ -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);
 }
index ee28c96defcad4f62715e73f6e004bb24f60444b..af3c92db8f6a16bb4e73b001fc227dc8f61e034c 100644 (file)
@@ -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;
index fb9a1e8117a5b7b0d63f7dfc6a8c2d33516f005b..d47d56b6021b31d48116e86be7a469bf08ef4c94 100644 (file)
@@ -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
                 }
         });
         
index eea5c43bb99556afb619fc0438a1098708d362c6..1b39093c7d05cc7e82d40afad210063c13d980e2 100644 (file)
@@ -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};
index 544d82e799544487b7a3c8aaa97b29d61deb1e3b..036ca2496698c1399ff0c6313a7d3ef86c7b5c05 100644 (file)
@@ -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};
index 7b5456e21898cb485913fed1d029f75f27ad81c8..3dc4ca7bd61dc13a7aa891564fca33d4cb479fce 100644 (file)
@@ -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);
 }
index 17ce27fa60ad12720dedd1af13567f95ec979378..eb25f20607f41544b9e554468e7f9375b82e58c4 100644 (file)
@@ -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);
 }
index badd9632cc8a3aa1794c457d933dbd10f2840d77..cefed420546eab56909af6b1e297421e1a6eeca7 100644 (file)
@@ -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();
     }
 }
index 45df9cfa610c984387492e276a685ae4fe7bb329..d576875be10d8575fe88fcb765be9d15dc6340d8 100644 (file)
@@ -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 }),+
         ])+)
     }
 )
index d86dc4d56d7ddaf89037af2abb5a93974bd87d23..fce0889e0a9b8bfbfc913799d011cc49eecdfd56 100644 (file)
@@ -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);
     });
 }
index 3402da6c55c9d1cbc6920708219f79c3a598e78a..da79bf53fe06c9deedfc4c19c2249fb58d265b21 100644 (file)
@@ -23,13 +23,13 @@ fn andand<T: bool_like Copy>(x1: T, x2: T) -> T {
 
 impl bool_like for bool {
     static fn select<A>(&&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<A>(&&b: int, +x1: A, +x2: A) -> A {
-        if b != 0 { move x1 } else { move x2 }
+        if b != 0 { x1 } else { x2 }
     }
 }
 
index b66f295e1bad8c6ddabd8132043398433d5b6fe2..aa8a2a9146cbc6466fcfcace5a25e4b60ecec766 100644 (file)
@@ -29,7 +29,7 @@ fn test05_start(ch : Chan<int>) {
 
 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();
index a5d55fd823bcf3b3cfe20a03274c1434da3db50c..289a728efc39a535a1ca0d1f99032905177fb340 100644 (file)
@@ -15,7 +15,7 @@
 
 fn start(c: pipes::Chan<pipes::Chan<~str>>) {
     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<pipes::Chan<~str>>) {
     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");
index 498b0b7423868a3028d19145750037f1472e5196..996566abcd89fd49b257a0eb673fb54ef604148e 100644 (file)
 
 fn start(c: pipes::Chan<pipes::Chan<int>>) {
     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();
 }
index d32e9454f533b4fa0b0e6220453f872c0be44f48..9f23ab1c9dfa68e0c3f27721cd100d5d652d2404 100644 (file)
@@ -17,7 +17,7 @@
 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.");
 }
index c52facf230be95df377cd045238af7fad138ce14..4ee23ec54d6cb9c1a71409eb9dceb01f674ea502 100644 (file)
@@ -22,6 +22,6 @@ fn start(c: pipes::Chan<int>, 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");
 }
index dbf8c034935501aaf352a7fd4e7c72cc47893cfb..f32fbdd04e62ead75f8ffe8da6bf9e67645b0636 100644 (file)
@@ -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;
     }
 
index c65e10d36b7e63de9ebcee0fe63b96951dfa771e..957066005acda898cb5d558e621486412fa4ffb5 100644 (file)
@@ -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();
 }
index afc9290b62db7d10f3ad8bc6506dc256405db094..648a54d190fa408b0b294f95632510943ce15558 100644 (file)
@@ -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?
 
index 97280d37c6384aff83019e24ca7006269ca979e6..372a0ea434b58b326a1fb2a0eb07b39df6f28d23 100644 (file)
@@ -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;
     }
index 5ebd191944b6197fa458c45f04e252bcc4d4ba99..481df2d1d529b4a1c94dfe1b38c6f5ef15e0bf01 100644 (file)
@@ -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);
     }
 
index ac259e7f7855b75878425ffe09073d447e6527a6..d3ed48f7575239fc67ee9cb63b648ba9a34318a4 100644 (file)
@@ -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);
 }
index 3f69a2e5d909b99650f38598d237cc23ccec6627..5468970ecf555e58d577130c0cf56bbedc85e2a7 100644 (file)
 // xfail-test
 
 trait A<T> {
-    fn g<U>(x: T, y: U) -> (T, U) { (move x, move y) }
+    fn g<U>(x: T, y: U) -> (T, U) { (x, y) }
 }
 
 impl A<int> for int { }
 
 fn f<T, U, V: A<T>>(i: V, j: T, k: U) -> (T, U) {
-    i.g(move j, move k)
+    i.g(j, k)
 }
 
 fn main () {
index fcb9f60d762c8ffb4bf136ce144544f5aaaf6a15..71f4165db9d64f0a893b91cba7e8c5a74070f450 100644 (file)
 // xfail-test
 
 trait A<T> {
-    fn g(x: T) -> T { move x }
+    fn g(x: T) -> T { x }
 }
 
 impl A<int> for int { }
 
 fn f<T, V: A<T>>(i: V, j: T) -> T {
-    i.g(move j)
+    i.g(j)
 }
 
 fn main () {
index c89d4abe3dae7a222b4a5640452d2efa125bf330..f27bd7c0a7bf90c6f557e0999ae0c461f6b90a69 100644 (file)
 #[allow(default_methods)];
 
 trait A {
-    fn g<T>(x: T, y: T) -> (T, T) { (move x, move y) }
+    fn g<T>(x: T, y: T) -> (T, T) { (x, y) }
 }
 
 impl A for int { }
 
 fn f<T, V: A>(i: V, j: T, k: T) -> (T, T) {
-    i.g(move j, move k)
+    i.g(j, k)
 }
 
 fn main () {
index 7a6dfa33a1ac4f2f7065cb1acb132f68c4007e9b..8ea5341795164404551338b26b4d1a4486f0643e 100644 (file)
 #[allow(default_methods)];
 
 trait A<T> {
-    fn g(x: uint) -> uint { move x }
+    fn g(x: uint) -> uint { x }
 }
 
 impl<T> A<T> for int { }
 
 fn f<T, V: A<T>>(i: V, j: uint) -> uint {
-    i.g(move j)
+    i.g(j)
 }
 
 fn main () {
index 62f4ef89d693d2711d36b9a5a9c4cb9fe232c665..b3ebc2ba820aabd2a9f00085b65d1afad5d8766a 100644 (file)
@@ -40,7 +40,7 @@ fn indirect<T: to_str>(x: T) -> ~str {
     assert indirect(~[10, 20]) == ~"[10, 20]!";
 
     fn indirect2<T: to_str>(x: T) -> ~str {
-        indirect(move x)
+        indirect(x)
     }
     assert indirect2(~[1]) == ~"[1]!";
 }
index fd4f428bd9d7aa7668b4931290dd83e23c1c695f..96e91093d37a2eb40dc0ecf74e27c2d722b2fe1b 100644 (file)
@@ -9,6 +9,6 @@
 // except according to those terms.
 
 pub fn main() {
-    let i = move ~100;
+    let i = ~100;
     assert *i == 100;
 }
index 27600c04e22f975ca516c41422790949e14c2259..7723eafc035eed7db487bb80bbc1631b79de9a3e 100644 (file)
@@ -10,6 +10,6 @@
 
 pub fn main() {
     let i = ~100;
-    let j = move i;
+    let j = i;
     assert *j == 100;
 }
index 61cee457b0cf0ee1ab06887d943d246ecc0ee19c..12e9820361d777a53790019e3d1f586616db3c7b 100644 (file)
@@ -14,5 +14,5 @@ fn f(-i: ~int) {
 
 pub fn main() {
     let i = ~100;
-    f(move i);
+    f(i);
 }
index fd86d5aa6fefaa2a16ee43080ca67f009c97d9ba..5988a3e8658dce09836d80bac517009cbe358c51 100644 (file)
@@ -11,6 +11,6 @@
 pub fn main() {
     let i = ~100;
     let j = ~200;
-    let j = move i;
+    let j = i;
     assert *j == 100;
 }
index eaa8a1cf7bd409eb5028f68b6ab98cd1208408b6..08a496987c0a629801d19104352c5916baed735f 100644 (file)
@@ -10,6 +10,6 @@
 
 pub fn main() {
     let mut i;
-    i = move ~100;
+    i = ~100;
     assert *i == 100;
 }
index be0426edbe2e40a035fcf1dbbe3625bcfb65a66e..5e778d581d340a7031c743a37d538e056572bdc2 100644 (file)
@@ -11,6 +11,6 @@
 pub fn main() {
     let i = ~100;
     let mut j;
-    j = move i;
+    j = i;
     assert *j == 100;
 }
index 8e900aa7ff3c427ef8fa8e8a2298f651bb2f03ad..9c658fdc252760f55df4b26c62b00c1158f6cea4 100644 (file)
@@ -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
 }
 
index 75b2bf090ba6542c7168393170d6f7262ec67968..fa93dfd0fe135a41db8764c6ef890adbd54946a0 100644 (file)
@@ -12,7 +12,7 @@
 fn id(x: bool) -> bool { x }
 
 fn call_id() {
-    let c = move fail!();
+    let c = fail!();
     id(c);
 }
 
index 8f3a6f91d173f45b6e74b21dc9d1830a84d66133..665abe23ee8935fd43fb22c58306c9b370d47be1 100644 (file)
@@ -10,6 +10,6 @@
 
 pub fn main() {
     let x = ~1;
-    let lam_move = fn@(move x) { };
+    let lam_move = fn@() { };
     lam_move();
 }
index 785eb691459d6ffa41d92f21d4d696cf66091863..69ce791c1a35aa56c8a93b08a5276b80ef2d39f0 100644 (file)
@@ -15,5 +15,5 @@
 pub fn main()
 {
     let y = ~1;
-    move y;
+    y;
 }
index 62673fc134d19c8a51746b9af9dcdc9e4a4333a6..93f1c7b5b45090a0f9a09d835bc88309883f5c9d 100644 (file)
@@ -33,7 +33,7 @@ fn complainer(c: SharedChan<bool>) -> complainer {
 }
 
 fn f(c: SharedChan<bool>) {
-    let _c = move complainer(c);
+    let _c = complainer(c);
     fail!();
 }
 
index 967ed727aa535c35bf0b79d61819bd47fcfc73fc..75ce797cfc842955d00ee2a89344ee86d5237c4a 100644 (file)
@@ -26,7 +26,7 @@ fn complainer(c: @int) -> complainer {
 }
 
 fn f() {
-    let c = move complainer(@0);
+    let c = complainer(@0);
     fail!();
 }
 
index 28a5a5ca47b5533617755aa2750e6a0fce175801..5b515ae5434767bd2d8db372301c31825176a7a8 100644 (file)
@@ -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();
index 3d44cf2669b27c0ce022e016e59914b2d293dccd..df5f5904793dad7529fbebc15b5b891c8d8c0c05 100644 (file)
@@ -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);
index d5c58bbd0fabfd2967cc43142a22cbbe2b974958..16f43016b8e673b0220b166459c9c2190d028e9e 100644 (file)
 
 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() {
index 1f6170624346b787866514ba9a886844c702547a..ae1271f64e4dc3d84ba5fc621a5e28032e1eeed9 100644 (file)
 
 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"); }