]> git.lizzy.rs Git - rust.git/commitdiff
Remove do keyword from test/
authorScott Lawrence <bytbox@gmail.com>
Mon, 27 Jan 2014 23:29:50 +0000 (18:29 -0500)
committerScott Lawrence <bytbox@gmail.com>
Wed, 29 Jan 2014 14:15:42 +0000 (09:15 -0500)
92 files changed:
src/test/auxiliary/cci_capture_clause.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-rw-arcs.rs
src/test/bench/rt-messaging-ping-pong.rs
src/test/bench/rt-parfib.rs
src/test/bench/rt-spawn-rate.rs
src/test/bench/shootout-binarytrees.rs
src/test/bench/shootout-chameneos-redux.rs
src/test/bench/shootout-k-nucleotide-pipes.rs
src/test/bench/shootout-pfib.rs
src/test/bench/shootout-spectralnorm.rs
src/test/bench/shootout-threadring.rs
src/test/bench/silly-test-spawn.rs
src/test/bench/spawnone.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/bench/task-perf-one-million.rs
src/test/compile-fail/arc-rw-read-mode-shouldnt-escape.rs
src/test/compile-fail/arc-rw-write-mode-shouldnt-escape.rs
src/test/compile-fail/borrowck-loan-blocks-move-cc.rs
src/test/compile-fail/do-lambda-requires-braces.rs [deleted file]
src/test/compile-fail/do1.rs [deleted file]
src/test/compile-fail/do2.rs [deleted file]
src/test/compile-fail/issue-3044.rs
src/test/compile-fail/keyword-do-as-identifier.rs [deleted file]
src/test/compile-fail/moves-based-on-type-capture-clause-bad.rs
src/test/compile-fail/mutex-arc-nested.rs
src/test/compile-fail/no-capture-arc.rs
src/test/compile-fail/no-reuse-move-arc.rs
src/test/compile-fail/no-send-res-ports.rs
src/test/compile-fail/once-cant-call-twice-on-heap.rs
src/test/compile-fail/sync-rwlock-read-mode-shouldnt-escape.rs
src/test/compile-fail/sync-rwlock-write-mode-shouldnt-escape.rs
src/test/run-fail/extern-fail.rs
src/test/run-fail/fail-task-name-none.rs
src/test/run-fail/fail-task-name-owned.rs
src/test/run-fail/fail-task-name-send-str.rs
src/test/run-fail/fail-task-name-static.rs
src/test/run-fail/morestack2.rs
src/test/run-fail/morestack3.rs
src/test/run-fail/morestack4.rs
src/test/run-fail/native-failure.rs
src/test/run-fail/rt-set-exit-status-fail2.rs
src/test/run-make/bootstrap-from-c-with-green/lib.rs
src/test/run-make/bootstrap-from-c-with-native/lib.rs
src/test/run-make/static-unwinding/main.rs
src/test/run-pass-fulldeps/qquote.rs
src/test/run-pass/block-arg-can-be-followed-by-binop.rs [deleted file]
src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs [deleted file]
src/test/run-pass/block-arg-can-be-followed-by-call.rs [deleted file]
src/test/run-pass/block-arg-in-parentheses.rs [deleted file]
src/test/run-pass/block-arg-used-as-any.rs [deleted file]
src/test/run-pass/block-arg.rs
src/test/run-pass/capture_nil.rs
src/test/run-pass/capturing-logging.rs
src/test/run-pass/closure-bounds-can-capture-chan.rs
src/test/run-pass/closure-reform.rs
src/test/run-pass/do-empty-args.rs [deleted file]
src/test/run-pass/do-no-args.rs [deleted file]
src/test/run-pass/do1.rs [deleted file]
src/test/run-pass/do2.rs [deleted file]
src/test/run-pass/do3.rs [deleted file]
src/test/run-pass/extern-call-deep2.rs
src/test/run-pass/extern-call-scrub.rs
src/test/run-pass/extern-stress.rs
src/test/run-pass/extern-yield.rs
src/test/run-pass/fail-in-dtor-drops-fields.rs
src/test/run-pass/foreign-call-no-runtime.rs
src/test/run-pass/infinite-loops.rs
src/test/run-pass/issue-2185.rs
src/test/run-pass/issue-3168.rs
src/test/run-pass/issue-3609.rs
src/test/run-pass/issue-4241.rs
src/test/run-pass/issue-4446.rs
src/test/run-pass/issue-4448.rs
src/test/run-pass/kindck-implicit-close-over-mut-var.rs
src/test/run-pass/logging-only-prints-once.rs
src/test/run-pass/moves-based-on-type-capture-clause.rs
src/test/run-pass/native-always-waits.rs
src/test/run-pass/no-landing-pads.rs
src/test/run-pass/once-move-out-on-heap.rs
src/test/run-pass/preempt.rs
src/test/run-pass/send-resource.rs
src/test/run-pass/task-comm-12.rs
src/test/run-pass/task-comm-7.rs
src/test/run-pass/task-comm-9.rs
src/test/run-pass/task-killjoin-rsrc.rs
src/test/run-pass/trait-bounds-in-arc.rs
src/test/run-pass/unit-like-struct-drop-run.rs

index ed896af69b41fb1537c1806acfab511715f660d6..3bf084b5fdae7abde835fc93f5ebd5bf767a6c03 100644 (file)
@@ -12,8 +12,8 @@
 
 pub fn foo<T:Send + Clone>(x: T) -> Port<T> {
     let (p, c) = Chan::new();
-    do task::spawn() {
+    task::spawn(proc() {
         c.send(x.clone());
-    }
+    });
     p
 }
index 50cb00b25d4b116ead9b024dc9b2978127c984b5..aa4e0f1ae5809bf5ca10efd4b3293e50777cb2e9 100644 (file)
@@ -64,17 +64,17 @@ fn run(args: &[~str]) {
         let to_child = to_child.clone();
         let mut builder = task::task();
         worker_results.push(builder.future_result());
-        do builder.spawn {
+        builder.spawn(proc() {
             for _ in range(0u, size / workers) {
                 //error!("worker {:?}: sending {:?} bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
             //error!("worker {:?} exiting", i);
-        }
+        });
     }
-    do task::spawn || {
+    task::spawn(proc() {
         server(&from_parent, &to_parent);
-    }
+    });
 
     for r in worker_results.iter() {
         r.recv();
index 3cf1a97a36e041821f6a598c89f3f9d3d0d22d87..6ce0f9de8d0a237772cf5ddca820b794795198e0 100644 (file)
@@ -58,13 +58,13 @@ fn run(args: &[~str]) {
         let (from_parent, to_child) = Chan::new();
         let mut builder = task::task();
         worker_results.push(builder.future_result());
-        do builder.spawn {
+        builder.spawn(proc() {
             for _ in range(0u, size / workers) {
                 //error!("worker {:?}: sending {:?} bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
             //error!("worker {:?} exiting", i);
-        };
+        });
         from_parent
     } else {
         let (from_parent, to_child) = SharedChan::new();
@@ -72,19 +72,19 @@ fn run(args: &[~str]) {
             let to_child = to_child.clone();
             let mut builder = task::task();
             worker_results.push(builder.future_result());
-            do builder.spawn {
+            builder.spawn(proc() {
                 for _ in range(0u, size / workers) {
                     //error!("worker {:?}: sending {:?} bytes", i, num_bytes);
                     to_child.send(bytes(num_bytes));
                 }
                 //error!("worker {:?} exiting", i);
-            };
+            });
         }
         from_parent
     };
-    do task::spawn || {
+    task::spawn(proc() {
         server(&from_parent, &to_parent);
-    }
+    });
 
     for r in worker_results.iter() {
         r.recv();
index a5838f2017385f56bcda105ce7c03b2e8fe7bfec..b1b2300466a5edb5fc56fee613b6dcd20a1dcc1e 100644 (file)
@@ -91,9 +91,9 @@ fn main() {
         //error!("spawning %?", i);
         let (new_chan, num_port) = init();
         let num_chan_2 = num_chan.clone();
-        let new_future = do Future::spawn() {
+        let new_future = Future::spawn(proc() {
             thread_ring(i, msg_per_task, num_chan_2, num_port)
-        };
+        });
         futures.push(new_future);
         num_chan = new_chan;
     };
index fa7026b6569f9dfb16eeb6e463b406e267e1a440..d7bd0f2f6bd3da361f406fd23a18f98c47443513 100644 (file)
@@ -87,9 +87,9 @@ fn main() {
         //error!("spawning %?", i);
         let (new_chan, num_port) = init();
         let num_chan_2 = num_chan.clone();
-        let new_future = do Future::spawn {
+        let new_future = Future::spawn(proc() {
             thread_ring(i, msg_per_task, num_chan_2, num_port)
-        };
+        });
         futures.push(new_future);
         num_chan = new_chan;
     };
index 6eef71622c5c6232b656d13dc142e295e9af278e..29904de897eba7782accc4b1299d90ba171e9b15 100644 (file)
@@ -26,23 +26,23 @@ fn run_pair(n: uint) {
         // Create a stream B->A
         let (pb,cb) = Chan::<()>::new();
 
-        do spawn() || {
+        spawn(proc() {
             let chan = ca;
             let port = pb;
             n.times(|| {
                 chan.send(());
                 port.recv();
             })
-        }
+        });
 
-        do spawn() || {
+        spawn(proc() {
             let chan = cb;
             let port = pa;
             n.times(|| {
                 port.recv();
                 chan.send(());
             })
-        }
+        });
     }
 
     m.times(|| {
index 6e3c42f2a4dea031194717995a7cfd31e626f7ae..59f5afa47dafd130151c709a82212d2065ffcb4a 100644 (file)
@@ -23,9 +23,9 @@ fn parfib(n: uint) -> uint {
     }
 
     let (port,chan) = Chan::new();
-    do spawn {
+    spawn(proc() {
         chan.send(parfib(n-1));
-    };
+    });
     let m2 = parfib(n-2);
     return (port.recv() + m2);
 }
index e057d6862e6a91685d02bda9e64c291973b9fd99..f3bb168f65117febd5c48d0a1e1cddaa49658b4d 100644 (file)
@@ -27,7 +27,7 @@ fn main() {
     };
 
     n.times(|| {
-        do spawn || {};
+        spawn(proc() {});
     })
 
 }
index 7abbbdd278cff0a70eaaed680ee218a94f63e0b1..1a4ad2297181c0584bfff1cd248ca006c4699564 100644 (file)
@@ -64,7 +64,7 @@ fn main() {
     let mut messages = range_step(min_depth, max_depth + 1, 2).map(|depth| {
             use std::num::pow;
             let iterations = pow(2, (max_depth - depth + min_depth) as uint);
-            do Future::spawn {
+            Future::spawn(proc() {
                 let mut chk = 0;
                 for i in range(1, iterations + 1) {
                     let arena = TypedArena::new();
@@ -74,7 +74,7 @@ fn main() {
                 }
                 format!("{}\t trees of depth {}\t check: {}",
                         iterations * 2, depth, chk)
-            }
+            })
         }).to_owned_vec();
 
     for message in messages.mut_iter() {
index 2a5f7f0b87e98285c95444a62ea34337226ad2ed..7281667e6769a62a4c4ffcd16415cca3e11d3cf4 100644 (file)
@@ -152,13 +152,13 @@ fn rendezvous(nn: uint, set: ~[color]) {
             let to_rendezvous = to_rendezvous.clone();
             let to_rendezvous_log = to_rendezvous_log.clone();
             let (from_rendezvous, to_creature) = Chan::new();
-            do task::spawn {
+            task::spawn(proc() {
                 creature(ii,
                          col,
                          from_rendezvous,
                          to_rendezvous.clone(),
                          to_rendezvous_log.clone());
-            }
+            });
             to_creature
         }).collect();
 
index 83eb1388c6b173f13fcf4cb1baf78c3576b5037f..375f9154841f4b73620c8bc27f718ebba4cb8472 100644 (file)
@@ -168,9 +168,9 @@ fn main() {
 
         let (from_parent, to_child) = Chan::new();
 
-        do spawn {
+        spawn(proc() {
             make_sequence_processor(sz, &from_parent, &to_parent_);
-        }
+        });
 
         to_child
     }).collect::<~[Chan<~[u8]>]>();
index aa060ceb0973f1ab7c97ce64795b3516a324358c..040c8526ee04fdfedabfbe1b972c3638f86ca9df 100644 (file)
@@ -79,9 +79,9 @@ fn stress(num_tasks: int) {
     for i in range(0, num_tasks) {
         let mut builder = task::task();
         results.push(builder.future_result());
-        do builder.spawn {
+        builder.spawn(proc() {
             stress_task(i);
-        }
+        });
     }
     for r in results.iter() {
         r.recv();
index 8174347e3869e1fb38ee14ca546df91e4c3d8fc1..d68ca4e0abbae800980bb452569c70bec031621c 100644 (file)
@@ -41,13 +41,13 @@ fn mult(v: RWArc<~[f64]>, out: RWArc<~[f64]>, f: fn(&~[f64], uint) -> f64) {
         let w = wait.clone();
         let v = v.clone();
         let out = out.clone();
-        do spawn {
+        spawn(proc() {
             for i in range(chk, min(len, chk + chunk)) {
                 let val = v.read(|v| f(v, i));
                 out.write(|out| out[i] = val);
             }
             let _ = w;
-        }
+        });
     }
     let _ = wait.unwrap();
 }
index 862b047db22f464c81b219aa81e39a81d9007019..7063194eab862d43fb794209c509ccf3ddcb45d0 100644 (file)
@@ -23,17 +23,17 @@ fn start(n_tasks: int, token: int) {
         let (next_p, ch) = Chan::new();
         let imm_i = i;
         let imm_p = p;
-        do spawn {
+        spawn(proc() {
             roundtrip(imm_i, n_tasks, &imm_p, &ch);
-        };
+        });
         p = next_p;
         i += 1;
     }
     let imm_p = p;
     let imm_ch = ch1;
-    do spawn {
+    spawn(proc() {
         roundtrip(1, n_tasks, &imm_p, &imm_ch);
-    }
+    });
 }
 
 fn roundtrip(id: int, n_tasks: int, p: &Port<int>, ch: &Chan<int>) {
index 900796efe33d37e8dd4ffad8f829cdae0faf2fc9..16a9c03225adb52656ea9703b7b9d7eca1a0a015 100644 (file)
@@ -11,6 +11,6 @@
 // Useful smoketest for scheduler performance.
 fn main() {
     for _ in range(1, 100_000) {
-        do spawn { }
+        spawn(proc() {})
     }
 }
index 75485a7fb9ecb12a1fdfe10515058b2ea380f000..b55f471bdb24d40f6f7619b4b592c18dcd6eca8e 100644 (file)
@@ -10,5 +10,5 @@
 
 // Useful for checking syscall usage of baseline scheduler usage
 fn main() {
-    do spawn { }
+    spawn(proc() {});
 }
index db46c3db439a7ef0508138d9a171df205b534d09..58fdadc2064da35485a61f74fb7a312883b13ee5 100644 (file)
@@ -34,9 +34,9 @@ fn main() {
 fn run(repeat: int, depth: int) {
     for _ in range(0, repeat) {
         info!("starting {:.4f}", precise_time_s());
-        do task::try {
+        task::try(proc() {
             recurse_or_fail(depth, None)
-        };
+        });
         info!("stopping {:.4f}", precise_time_s());
     }
 }
index dc31ef06fa6f20143f2b1dd8fbd0e19922d34ceb..b41f6bcc50ad85cb31d6a6f146e1c17a4760c8f3 100644 (file)
@@ -26,7 +26,7 @@ fn child_generation(gens_left: uint, c: comm::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,
-    do spawn {
+    spawn(proc() {
         if gens_left & 1 == 1 {
             task::deschedule(); // shake things up a bit
         }
@@ -35,7 +35,7 @@ fn child_generation(gens_left: uint, c: comm::Chan<()>) {
         } else {
             c.send(())
         }
-    }
+    });
 }
 
 fn main() {
index eb0e64268f351fece2d7215a7d99c67bc3ca3848..052900102c9a27f8a06c6e600335580b995bca79 100644 (file)
@@ -36,11 +36,11 @@ fn grandchild_group(num_tasks: uint) {
     for _ in range(0, num_tasks) {
         let ch = ch.clone();
         let mut t = task::task();
-        do t.spawn { // linked
+        t.spawn(proc() { // linked
             ch.send(());
             let (p, _c) = stream::<()>();
             p.recv(); // block forever
-        }
+        });
     }
     error!("Grandchild group getting started");
     for _ in range(0, num_tasks) {
@@ -77,17 +77,17 @@ fn main() {
     // Main group #0 waits for unsupervised group #1.
     // Grandparent group #1 waits for middle group #2, then fails, killing #3.
     // Middle group #2 creates grandchild_group #3, waits for it to be ready, exits.
-    let x: result::Result<(), ~Any> = do task::try { // unlinked
-        do spawn_supervised_blocking("grandparent") {
-            do spawn_supervised_blocking("middle") {
+    let x: result::Result<(), ~Any> = task::try(proc() { // unlinked
+        spawn_supervised_blocking("grandparent", proc() {
+            spawn_supervised_blocking("middle", proc() {
                 grandchild_group(num_tasks);
-            }
+            });
             // When grandchild group is ready to go, make the middle group exit.
             error!("Middle group wakes up and exits");
-        }
+        });
         // Grandparent group waits for middle group to be gone, then fails
         error!("Grandparent group wakes up and fails");
         fail!();
-    };
+    });
     assert!(x.is_err());
 }
index e9a9ed194749d5d770bf4755c5b83b7de2c671d2..454c7e45cc163d9b0af20449579c408c623f76cc 100644 (file)
@@ -21,9 +21,9 @@ fn calc(children: uint, parent_wait_chan: &Chan<Chan<Chan<int>>>) {
 
     let wait_ports: ~[Port<Chan<Chan<int>>>] = vec::from_fn(children, |_| {
         let (wait_port, wait_chan) = stream::<Chan<Chan<int>>>();
-        do task::spawn {
+        task::spawn(proc() {
             calc(children / 2, &wait_chan);
-        }
+        });
         wait_port
     });
 
@@ -58,9 +58,9 @@ fn main() {
 
     let children = from_str::<uint>(args[1]).unwrap();
     let (wait_port, wait_chan) = stream();
-    do task::spawn {
+    task::spawn(proc() {
         calc(children, &wait_chan);
-    };
+    });
 
     let start_chan = wait_port.recv();
     let (sum_port, sum_chan) = stream::<int>();
index 2fe2095ca879efd22bad0529c5d3dfbf97c57267..716dfe2c8b5c54e2b89af8f032d8615ac01fae77 100644 (file)
@@ -19,5 +19,5 @@ fn main() {
     });
     y.unwrap();
     // Adding this line causes a method unification failure instead
-    // do (&option::unwrap(y)).read |state| { assert!(*state == 1); }
+    // (&option::unwrap(y)).read(|state| { assert!(*state == 1); })
 }
index d9247ab4fc170d16c31a592be1e35132bb7ed5c6..213bf48a08750446aa6220ce09e65a24f71cc739 100644 (file)
@@ -17,5 +17,5 @@ fn main() {
     x.write_downgrade(|write_mode| y = Some(write_mode));
     y.unwrap();
     // Adding this line causes a method unification failure instead
-    // do (&option::unwrap(y)).write |state| { assert!(*state == 1); }
+    // (&option::unwrap(y)).write(|state| { assert!(*state == 1); })
 }
index c935c9deeac1ce3de65c51107473cf519dfbbcbb..c193288468a20ba3aa120c884469d332a2867b16 100644 (file)
@@ -17,10 +17,10 @@ fn borrow(v: &int, f: |x: &int|) {
 fn box_imm() {
     let v = ~3;
     let _w = &v;
-    do task::spawn {
+    task::spawn(proc() {
         info!("v={}", *v);
         //~^ ERROR cannot move `v` into closure
-    }
+    });
 
     let v = ~3;
     let _w = &v;
diff --git a/src/test/compile-fail/do-lambda-requires-braces.rs b/src/test/compile-fail/do-lambda-requires-braces.rs
deleted file mode 100644 (file)
index a836556..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    do something
-        |x| do somethingelse //~ ERROR: expected `{` but found `do`
-        |y| say(x, y)
-}
diff --git a/src/test/compile-fail/do1.rs b/src/test/compile-fail/do1.rs
deleted file mode 100644 (file)
index d16fa4e..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main() {
-    let x = do y; //~ ERROR: expected `{` but found
-}
diff --git a/src/test/compile-fail/do2.rs b/src/test/compile-fail/do2.rs
deleted file mode 100644 (file)
index 309abe2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(f: proc(int) -> bool) -> bool { f(10i) }
-
-fn main() {
-    assert!(do f() |i| { i == 10i } == 10i);
-    //~^ ERROR: expected `bool` but found `int`
-}
index 310de3657b385e06bc2b7177cd20c85aa7d3d8a2..5fab2ed195cecdd0a1cd469effa23a82d48b2321 100644 (file)
@@ -10,9 +10,9 @@
 
 fn main() {
     let needlesArr: ~[char] = ~['a', 'f'];
-    do needlesArr.iter().fold() |x, y| {
-    }
-    //~^^ ERROR 1 parameter was supplied (including the closure passed by the `do` keyword)
+    needlesArr.iter().fold(|x, y| {
+    });
+    //~^^ ERROR this function takes 2 parameters but 1 parameter was supplied
     //
     // the first error is, um, non-ideal.
 }
diff --git a/src/test/compile-fail/keyword-do-as-identifier.rs b/src/test/compile-fail/keyword-do-as-identifier.rs
deleted file mode 100644 (file)
index b2a0c8a..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// This file was auto-generated using 'src/etc/generate-keyword-tests.py do'
-
-fn main() {
-    let do = "foo"; //~ error: ident
-}
index dd68cb8e994e93a1ecf7f0cbb76e6508267bc0df..fe9c7ede83a0883e75c40fb38210e7ac907da88e 100644 (file)
@@ -2,8 +2,8 @@
 
 fn main() {
     let x = ~"Hello world!";
-    do task::spawn {
+    task::spawn(proc() {
         println!("{}", x);
-    }
+    });
     println!("{}", x); //~ ERROR use of moved value
 }
index 476b890efcd6b8618aef8963dfd8dcf544be7952..24a141c4799d520708ea88020c67da576935e005 100644 (file)
@@ -17,10 +17,10 @@ fn test_mutex_arc_nested() {
     let arc = ~MutexArc::new(1);
     let arc2 = ~MutexArc::new(*arc);
 
-    do task::spawn || {
+    task::spawn(proc() {
         (*arc2).access(|mutex| { //~ ERROR instantiating a type parameter with an incompatible type
         })
-    };
+    });
 }
 
 fn main() {}
index 65e0c07b3580e127ee8edfd6baa96d30b4cf10aa..5ae38e69ec0e30c52ba492dec58694705566a3c2 100644 (file)
@@ -19,10 +19,10 @@ fn main() {
     let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
     let arc_v = arc::Arc::new(v);
 
-    do task::spawn() {
+    task::spawn(proc() {
         let v = arc_v.get();
         assert_eq!(v[3], 4);
-    };
+    });
 
     assert_eq!((arc_v.get())[2], 3);
 
index 3cd048040c6f5647e5b7d56b8fc6bc978ebdd7dd..c6c0ba41ab91a45ba21e0fb8af43b6566b61e662 100644 (file)
@@ -17,10 +17,10 @@ fn main() {
     let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
     let arc_v = arc::Arc::new(v);
 
-    do task::spawn() {
+    task::spawn(proc() {
         let v = arc_v.get();
         assert_eq!(v[3], 4);
-    };
+    });
 
     assert_eq!((arc_v.get())[2], 3); //~ ERROR use of moved value: `arc_v`
 
index 87173d779240f9c4f55f9eb348b1400d076c6319..9e564e997e6739c91245e0f775d78f3f68be3788 100644 (file)
@@ -32,8 +32,8 @@ fn foo(x: Port<()>) -> foo {
 
     let x = foo(Port(@()));
 
-    do task::spawn {
+    task::spawn(proc() {
         let y = x;   //~ ERROR does not fulfill `Send`
         error!("{:?}", y);
-    }
+    });
 }
index e2220355980e76421474b832380df148b6ab842c..8d5e2229b2e5dc0a10d99eb772db3c6aba21af20 100644 (file)
@@ -22,8 +22,8 @@ fn foo(blk: proc()) {
 
 fn main() {
     let x = arc::Arc::new(true);
-    do foo {
+    foo(proc() {
         assert!(*x.get());
         drop(x);
-    }
+    });
 }
index e71dfc588161fbcf7404c8d3062f85f7c50ba112..0078841acb139b54a3a1c6c59c915ce4c20670be 100644 (file)
@@ -18,5 +18,5 @@ fn main() {
         y = Some(x.downgrade(write_mode));
     })
     // Adding this line causes a method unification failure instead
-    // do (&option::unwrap(y)).read { }
+    // (&option::unwrap(y)).read(proc() { });
 }
index af0149182aeba1b8b5a81fe8fe973ce380773a3c..6e9216830750b1d729d119a8ea32370860b14f6e 100644 (file)
@@ -18,5 +18,5 @@ fn main() {
         y = Some(write_mode);
     });
     // Adding this line causes a method unification failure instead
-    // do (&option::unwrap(y)).write { }
+    // (&option::unwrap(y)).write(proc() { })
 }
index ce5ea56502cc7bb1bdefe63bfb41958110e3001b..b998056176e39fd087b0cbca2d4462200d37b100 100644 (file)
@@ -41,11 +41,11 @@ fn count(n: uint) -> uint {
 }
 
 fn main() {
-    do 10u.times {
-        do task::spawn {
+    10u.times(proc() {
+        task::spawn(proc() {
             let result = count(5u);
             info!("result = %?", result);
             fail!();
-        };
-    }
+        });
+    });
 }
index 9d58c1820087631da317e5c22b10a54d2f070ec0..3f662e6d0e3e4ca673d4203253405ee42e9dc236 100644 (file)
@@ -13,8 +13,8 @@
 use std::task;
 
 fn main() {
-    do task::try {
+    task::try(proc() {
         fail!("test");
         1
-    }.unwrap()
+    }).unwrap()
 }
index 9e87b59db64940216aac261d0c161e4d7988dfd3..a1115a09fb1765d08fa2742a9c9dfe1acab04e15 100644 (file)
@@ -15,8 +15,8 @@
 fn main() {
     let mut t = task::task();
     t.name(~"owned name");
-    do t.try {
+    t.try(proc() {
         fail!("test");
         1
-    }.unwrap()
+    }).unwrap()
 }
index 0e3ef39cd1db347589ca4a534e060549fc445685..ca2472cfa55f159f2ac5b507f13befebbee3b92a 100644 (file)
@@ -13,8 +13,8 @@
 fn main() {
     let mut t = ::std::task::task();
     t.name("send name".to_send_str());
-    do t.try {
+    t.try(proc() {
         fail!("test");
         3
-    }.unwrap()
+    }).unwrap()
 }
index 4fd19fb2a6f22c05751664c54c24d41fb9c269a6..2303ab102d409bedc5d5cc50fe753d353d07772d 100644 (file)
@@ -13,7 +13,7 @@
 fn main() {
     let mut t = ::std::task::task();
     t.name("static name");
-    do t.try {
+    t.try(proc() {
         fail!("test");
-    }.unwrap()
+    }).unwrap()
 }
index 5ac3092640038ae3f4d78a85c81ac2d87041fee3..1094227770efd9e6a63eee7dcd7fc9138bf585d8 100644 (file)
@@ -62,8 +62,8 @@ fn and_then_get_big_again(x:int) -> and_then_get_big_again {
 }
 
 fn main() {
-    do task::spawn {
+    task::spawn(proc() {
         let r = and_then_get_big_again(4);
         getbig_call_c_and_fail(10000);
-    };
+    });
 }
index e6f219710b37bc0b5a43089c3ef224b3aebe0f8f..6acfa0b79f4100a750b40a505ad437f679fa5ebf 100644 (file)
@@ -48,7 +48,7 @@ fn and_then_get_big_again(x:int) -> and_then_get_big_again {
 }
 
 fn main() {
-    do task::spawn {
+    task::spawn(proc() {
         getbig_and_fail(400);
-    };
+    });
 }
index 02a65e91d04456e0890d25a7f2f08f6bd3bcb0cd..8be8e6b44f6afe9232bac06178105987058c4ef7 100644 (file)
@@ -41,7 +41,7 @@ fn and_then_get_big_again(x:int) -> and_then_get_big_again {
 }
 
 fn main() {
-    do task::spawn {
+    task::spawn(proc() {
         getbig_and_fail(1);
-    };
+    });
 }
index 807ee94ce09a45e2eb28f925574286f9241cb85e..20d8a543ae1966483a0695311e50f2483efdda58 100644 (file)
@@ -17,7 +17,7 @@
 
 #[start]
 fn start(argc: int, argv: **u8) -> int {
-    do native::start(argc, argv) {
+    native::start(argc, argv, proc() {
         fail!();
-    }
+    })
 }
index ea70bb0eab9a5ab1a3f73b763953807b50d0c4c4..d19788d8b5b84f72fa9faf00e7f2b5e2f7f3796b 100644 (file)
@@ -34,8 +34,8 @@ fn r(x:int) -> r {
 
 fn main() {
     error!("whatever");
-    do task::spawn {
+    task::spawn(proc() {
       let _i = r(5);
-    };
+    });
     fail!();
 }
index 452ee837d1296cb12c4c51a1360ebe013684fb1c..94119cc0278dab39aff0fb42326c403acaafe35e 100644 (file)
@@ -17,9 +17,9 @@
 
 #[no_mangle] // this needs to get called from C
 pub extern "C" fn foo(argc: int, argv: **u8) -> int {
-    do green::start(argc, argv) {
-        do spawn {
+    green::start(argc, argv, proc() {
+        spawn(proc() {
             println!("hello");
-        }
-    }
+        });
+    })
 }
index 4f931bdb8011e5ef0f2ccaf0b4b49cb220bdeb87..2a783606d944acd2ac5589e5776135b0a97c4655 100644 (file)
@@ -16,9 +16,9 @@
 
 #[no_mangle] // this needs to get called from C
 pub extern "C" fn foo(argc: int, argv: **u8) -> int {
-    do native::start(argc, argv) {
-        do spawn {
+    native::start(argc, argv, proc() {
+        spawn(proc() {
             println!("hello");
-        }
-    }
+        });
+    })
 }
index 029933a819cc55195a195e8aad9ccc4891e2673f..96dabf8f07699c6fa01fc362b65dbea69f6f13ce 100644 (file)
@@ -12,11 +12,11 @@ fn drop(&mut self) {
 }
 
 fn main() {
-    do task::try {
+    task::try(proc() {
         let _a = A;
         lib::callback(|| fail!());
         1
-    };
+    });
 
     unsafe {
         assert!(lib::statik == 1);
index 0fcd49790e072604bb373e0d6ccfb3bd65e51990..05225eb0e7adabdadd77e2c22a0e9133929ac73a 100644 (file)
@@ -75,11 +75,11 @@ fn main() {
 
 fn check_pp<T>(cx: fake_ext_ctxt,
                expr: T, f: |pprust::ps, T|, expect: ~str) {
-    let s = do io::with_str_writer |wr| {
+    let s = io::with_str_writer(|wr| {
         let pp = pprust::rust_printer(wr, cx.parse_sess().interner);
         f(pp, expr);
         pp::eof(pp.s);
-    };
+    });
     stdout().write_line(s);
     if expect != ~"" {
         error!("expect: '%s', got: '%s'", expect, s);
diff --git a/src/test/run-pass/block-arg-can-be-followed-by-binop.rs b/src/test/run-pass/block-arg-can-be-followed-by-binop.rs
deleted file mode 100644 (file)
index f2149e2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn add(x: proc(f64) -> f64) -> f64 {
-    x(10.0)
-}
-
-pub fn main() {
-    // Trailing expressions don't require parentheses:
-    let y = do add |x| { x + 10.0 } + 10.0;
-
-    assert_eq!(y, 30.0);
-}
diff --git a/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs b/src/test/run-pass/block-arg-can-be-followed-by-block-arg.rs
deleted file mode 100644 (file)
index 2cdf0a1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(_: proc()) -> proc(proc() -> uint) {
-    proc(_: proc() -> uint) {}
-}
-
-pub fn main() {
-    do do f {} { 20 };
-}
diff --git a/src/test/run-pass/block-arg-can-be-followed-by-call.rs b/src/test/run-pass/block-arg-can-be-followed-by-call.rs
deleted file mode 100644 (file)
index 544367b..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(_: proc()) -> proc(uint) -> uint {
-    proc(x: uint) { x }
-}
-
-pub fn main() {
-    let z = do f {} (22u);
-    assert_eq!(z, 22u);
-}
diff --git a/src/test/run-pass/block-arg-in-parentheses.rs b/src/test/run-pass/block-arg-in-parentheses.rs
deleted file mode 100644 (file)
index 0832171..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(_: proc(int, int) -> int) -> int {
-    10
-}
-
-fn w_semi() {
-    // the semicolon causes compiler not to
-    // complain about the ignored return value:
-    do f |x, y| { x+y };
-}
-
-fn w_paren1() -> int {
-    (do f |x, y| { x+y }) - 10
-}
-
-fn w_paren2() -> int {
-    (do f |x, y| { x+y } - 10)
-}
-
-fn w_ret() -> int {
-    return do f |x, y| { x+y } - 10;
-}
-
-pub fn main() {
-    w_semi();
-    w_paren1();
-    w_paren2();
-    w_ret();
-}
diff --git a/src/test/run-pass/block-arg-used-as-any.rs b/src/test/run-pass/block-arg-used-as-any.rs
deleted file mode 100644 (file)
index 87a6cbd..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn call_any(f: proc() -> uint) -> uint {
-    return f();
-}
-
-pub fn main() {
-    let x_r = do call_any { 22u };
-    assert_eq!(x_r, 22u);
-}
index afe7747457a8cc320a5ef7ebc8fe2c88b4e19883..d59804b23954e17fa380451779e55eef48c7cf51 100644 (file)
@@ -25,49 +25,4 @@ pub fn main() {
         info!("{:?}", *i);
     }
 
-    // Usable at all:
-    do inty |x| { x };
-
-    // Higher precedence than assignments:
-    let result = do inty |e| { e };
-    assert_eq!(result, 100);
-
-    // Higher precedence than unary operations:
-    let stringy = do inty |e| { e }.to_str();
-    assert!(do booly |_| { true });
-    assert!(!do booly |_| { false });
-
-    // Usable in funny statement-like forms:
-    if !do booly |_| { true } {
-        assert!(false);
-    }
-    match do booly |_| { false } {
-        true => { fail!("incorrect answer."); }
-        false => { }
-    }
-    match 3 {
-      _ if do booly |_| { true } => {
-      }
-      _ => {
-        fail!("wrong answer.");
-      }
-    }
-
-
-    // Lower precedence than binary operations:
-    let w = do inty |_| { 10 } + 10;
-    let y = do inty |_| { 10 } + 10;
-    let z = 10 + do inty |_| { 10 };
-    assert_eq!(w, y);
-    assert_eq!(y, z);
-
-    // In the tail of a block
-    let w = if true {
-        do booly |_| {
-            true
-        }
-    } else {
-        false
-    };
-    assert!(w);
 }
index 0d9fdea4a9d51027f313dfaac49f15a0f81449ee..874075e8c1400bb1a71f4c45ffbecd06de298218 100644 (file)
@@ -28,9 +28,9 @@
 
 fn foo(x: ()) -> Port<()> {
     let (p, c) = Chan::<()>::new();
-    do task::spawn() {
+    task::spawn(proc() {
         c.send(x);
-    }
+    });
     p
 }
 
index b810bfd1c6b71ddcee2d7d4a96a01d37878202ef..171424d8b3b6905ffb0bd4f14be850ac6f0c8c43 100644 (file)
@@ -30,18 +30,18 @@ fn log(&mut self, _level: u32, args: &fmt::Arguments) {
 
 #[start]
 fn start(argc: int, argv: **u8) -> int {
-    do native::start(argc, argv) {
+    native::start(argc, argv, proc() {
         main();
-    }
+    })
 }
 
 fn main() {
     let (p, c) = Chan::new();
     let (mut r, w) = (PortReader::new(p), ChanWriter::new(c));
-    do spawn {
+    spawn(proc() {
         set_logger(~MyWriter(w) as ~Logger);
         debug!("debug");
         info!("info");
-    }
+    });
     assert_eq!(r.read_to_str(), ~"info\n");
 }
index 3a92f4ba3f401412545f1f2661c2dd2aab8e5455..66fac94ba51e1b41c61af71caeb5d4b0c8a03f09 100644 (file)
@@ -16,8 +16,8 @@ fn foo(blk: proc()) {
 
 pub fn main() {
     let (p,c) = Chan::new();
-    do foo {
+    foo(proc() {
         c.send(());
-    }
+    });
     p.recv();
 }
index 61175a401abe269495918e47eaa5ec5a5d46b044..3ed77cd9fb767cdccfc621e0e8f966b108ebd339 100644 (file)
@@ -38,11 +38,6 @@ fn call_bare_again(f: extern "Rust" fn(&str)) {
 pub fn main() {
     // Procs
 
-    let greeting = ~"Hi ";
-    do call_it |s| {
-        greeting + s
-    }
-
     let greeting = ~"Hello ";
     call_it(proc(s) {
         greeting + s
diff --git a/src/test/run-pass/do-empty-args.rs b/src/test/run-pass/do-empty-args.rs
deleted file mode 100644 (file)
index 56ba2ff..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// no-reformat
-// Testing various forms of `do` with empty arg lists
-
-fn f(_f: proc() -> bool) -> bool {
-    true
-}
-
-pub fn main() {
-    do f() || { true };
-    do f() { true };
-    do f || { true };
-    do f { true };
-}
diff --git a/src/test/run-pass/do-no-args.rs b/src/test/run-pass/do-no-args.rs
deleted file mode 100644 (file)
index 0df5c82..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Testing that we can drop the || in do exprs
-
-fn f(_f: proc() -> bool) -> bool { true }
-
-fn d(_f: proc()) { }
-
-pub fn main() {
-    do d { }
-}
diff --git a/src/test/run-pass/do1.rs b/src/test/run-pass/do1.rs
deleted file mode 100644 (file)
index bdbad74..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(f: proc(int)) { f(10) }
-
-pub fn main() {
-    do f() |i| { assert!(i == 10) }
-}
diff --git a/src/test/run-pass/do2.rs b/src/test/run-pass/do2.rs
deleted file mode 100644 (file)
index f509f7b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(f: proc(int) -> int) -> int { f(10) }
-
-pub fn main() {
-    assert_eq!(do f() |i| { i }, 10);
-}
diff --git a/src/test/run-pass/do3.rs b/src/test/run-pass/do3.rs
deleted file mode 100644 (file)
index cdba14f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn f(f: proc(int) -> int) -> int { f(10) }
-
-pub fn main() {
-    assert_eq!(do f |i| { i }, 10);
-}
index 00ac0bfa118eb19763a092219d45b25d2f84bec8..500ae8951ec4aa72459d3f84f251f2e03808b92d 100644 (file)
@@ -40,9 +40,9 @@ fn count(n: uint) -> uint {
 pub fn main() {
     // Make sure we're on a task with small Rust stacks (main currently
     // has a large stack)
-    do task::spawn {
+    task::spawn(proc() {
         let result = count(1000u);
         info!("result = {}", result);
         assert_eq!(result, 1000u);
-    };
+    });
 }
index 0044f0f468f306a28b6507bfb10b37ce208cf10c..c35e84154d80ba48bc9eede4d36fab66ce068a64 100644 (file)
@@ -44,9 +44,9 @@ fn count(n: uint) -> uint {
 pub fn main() {
     // Make sure we're on a task with small Rust stacks (main currently
     // has a large stack)
-    do task::spawn {
+    task::spawn(proc() {
         let result = count(12u);
         info!("result = {}", result);
         assert_eq!(result, 2048u);
-    };
+    });
 }
index 7c16ae74c4a91a1dc65c23a30a6adeeecc79ed61..26c7e6881a6c42134b5117339f81e1248936117a 100644 (file)
@@ -42,8 +42,8 @@ fn count(n: uint) -> uint {
 
 pub fn main() {
     100u.times(|| {
-        do task::spawn {
+        task::spawn(proc() {
             assert_eq!(count(5u), 16u);
-        };
+        });
     })
 }
index a4ac197ac6aed522f2dcc9ce575e3391b72b3874..da26f92ecdf3233048edf7d884da6f022718e8a1 100644 (file)
@@ -39,10 +39,10 @@ fn count(n: uint) -> uint {
 
 pub fn main() {
     10u.times(|| {
-        do task::spawn {
+        task::spawn(proc() {
             let result = count(5u);
             info!("result = {}", result);
             assert_eq!(result, 16u);
-        };
+        });
     })
 }
index 7c6bb1fa379b4d1b5c51ddb265fb7e1064ad6c5e..be4a497989ce8d239ed6f2d1a1e19c88ca65a4a9 100644 (file)
@@ -33,9 +33,9 @@ fn drop(&mut self) {
 }
 
 pub fn main() {
-    let ret = do task::try {
+    let ret = task::try(proc() {
         let _a = A { b: B { foo: 3 } };
-    };
+    });
     assert!(ret.is_err());
     unsafe { assert!(dropped); }
 }
index ee54423a97d7d6d998e4faeff5cf922cf1165565..daaaac93791bd38b8da3e0c7d21bf94c6f3f2d3b 100644 (file)
@@ -10,10 +10,10 @@ fn rust_dbg_call(cb: extern "C" fn(libc::uintptr_t),
 
 pub fn main() {
     unsafe {
-        do run_in_bare_thread() {
+        run_in_bare_thread(proc() {
             let i = &100;
             rust_dbg_call(callback, cast::transmute(i));
-        }
+        });
     }
 }
 
index dea0df2e52b348034c41ab2ddf282c78634017db..633c096b689201fb491e2dd836bcfecd9a5f0e81 100644 (file)
@@ -17,7 +17,7 @@
 extern mod extra;
 
 fn loopy(n: int) {
-    if n > 0 { do spawn { loopy(n - 1) }; do spawn { loopy(n - 1) }; }
+    if n > 0 { spawn(proc() { loopy(n - 1) }); spawn(proc() { loopy(n - 1) }); }
     loop { }
 }
 
@@ -25,5 +25,5 @@ pub fn main() {
     // Commenting this out, as this will hang forever otherwise.
     // Even after seeing the comment above, I'm not sure what the
     // intention of this test is.
-    // do spawn { loopy(5) };
+    // spawn(proc() { loopy(5) });
 }
index 9ebeec092cf15876b2f08fca0b2c9e2cc03a0594..cef183e5f33c772fc333b6df4dbd6a74c3f85270 100644 (file)
@@ -51,16 +51,16 @@ fn iter(&self, blk: |v: uint|) { self( |i| blk(i) ) }
 }
 
 fn filter<A,IA:iterable<A>>(self: IA, prd: 'static |A| -> bool, blk: |A|) {
-    do self.iter |a| {
+    self.iter(|a| {
         if prd(a) { blk(a) }
-    }
+    });
 }
 
 fn foldl<A,B,IA:iterable<A>>(self: IA, b0: B, blk: |B, A| -> B) -> B {
     let mut b = b0;
-    do self.iter |a| {
+    self.iter(|a| {
         b = blk(b, a);
-    }
+    });
     b
 }
 
index 978cd586975f91e5e1b408b482cb328a0eafd88b..49b7e50c01e61b942b1f1abb9ca1d654ef90c5e1 100644 (file)
 
 pub fn main() {
     let (p,c) = comm::stream();
-    do task::try || {
+    task::try(|| {
         let (p2,c2) = comm::stream();
-        do task::spawn || {
+        task::spawn(|| {
             p2.recv();
             error!("sibling fails");
             fail!();
-        }
+        });
         let (p3,c3) = comm::stream();
         c.send(c3);
         c2.send(());
         error!("child blocks");
         p3.recv();
-    };
+    });
     error!("parent tries");
     assert!(!p.recv().try_send(()));
     error!("all done!");
index 4922ab18f8d45bca609903e0f914c4b48762a96c..bcda2e27614c687f1da1d8a2bebac62d311d7cea 100644 (file)
@@ -12,8 +12,7 @@ enum Msg
 }
 
 fn foo(name: ~str, samples_chan: Chan<Msg>) {
-    do task::spawn
-    {
+    task::spawn(proc() {
         let mut samples_chan = samples_chan;
         let callback: SamplesFn = proc(buffer) {
             for i in range(0u, buffer.len()) {
@@ -21,7 +20,7 @@ fn foo(name: ~str, samples_chan: Chan<Msg>) {
             }
         };
         samples_chan.send(GetSamples(name.clone(), callback));
-    };
+    });
 }
 
 pub fn main() {}
index 4cdf7aa3dd02d385aced665f816116bd06dbe6d9..173f76434d303b0feb0f58296e48e48bad7f1379 100644 (file)
@@ -45,13 +45,13 @@ enum Result {
 
 priv fn parse_list(len: uint, io: @io::Reader) -> Result {
   let mut list: ~[Result] = ~[];
-    do len.times {
+    len.times(proc() {
     let v =
         match io.read_char() {
         '$' => parse_bulk(io),
         ':' => parse_int(io),
          _ => fail!()
-    };
+    });
     list.push(v);
     }
   return List(list);
@@ -119,11 +119,11 @@ fn query(cmd: ~[~str], sb: TcpSocketBuf) -> Result {
 
 fn query2(cmd: ~[~str]) -> Result {
   let _cmd = cmd_to_str(cmd);
-    do io::with_str_reader(~"$3\r\nXXX\r\n") |sb| {
+    io::with_str_reader(~"$3\r\nXXX\r\n")(|sb| {
     let res = parse_response(@sb as @io::Reader);
     println!("{:?}", res);
     res
-    }
+    });
 }
 
 
index baac8d0dcd14c462fe51f36e6b338d45d863bfd5..8f2d9f32440bb186b18d0df39a20b4a309268b11 100644 (file)
@@ -13,9 +13,9 @@
 pub fn main() {
     let (port, chan) = Chan::new();
 
-    do spawn {
+    spawn(proc() {
         println(port.recv());
-    }
+    });
 
     chan.send("hello, world");
 }
index c3f871c79124bae7b74f99610cb09f8f9efff5c8..8fbc35c72005ac673c8c767e7fd6dde6d757a5d7 100644 (file)
@@ -13,9 +13,9 @@
 pub fn main() {
     let (port, chan) = Chan::<&'static str>::new();
 
-    do task::spawn {
+    task::spawn(proc() {
         assert_eq!(port.recv(), "hello, world");
-    }
+    });
 
     chan.send("hello, world");
 }
index e0c1d35b3bc60eb958f9a4e7be65a9acee3a297c..3f45e864da35af1251bf0631f67a453714f49aa0 100644 (file)
@@ -16,10 +16,10 @@ fn foo() {
     // Here, i is *copied* into the proc (heap closure).
     // Requires allocation.  The proc's copy is not mutable.
     let mut i = 0;
-    do task::spawn {
+    task::spawn(proc() {
         user(i);
         println!("spawned {}", i)
-    }
+    });
     i += 1;
     println!("original {}", i)
 }
@@ -29,9 +29,9 @@ fn bar() {
     // mutable outside of the proc.
     let mut i = 0;
     while i < 10 {
-        do task::spawn {
+        task::spawn(proc() {
             user(i);
-        }
+        });
         i += 1;
     }
 }
@@ -40,11 +40,11 @@ fn car() {
     // Here, i must be shadowed in the proc to be mutable.
     let mut i = 0;
     while i < 10 {
-        do task::spawn {
+        task::spawn(proc() {
             let mut i = i;
             i += 1;
             user(i);
-        }
+        });
         i += 1;
     }
 }
index a06d025f6c7a5d0ea6dee7f096a61eb48a53956c..d81b5818d6693a53ea00bd506cb72b5b09a2a5c5 100644 (file)
@@ -26,12 +26,12 @@ fn fmt(f: &Foo, _fmt: &mut fmt::Formatter) {
 
 pub fn main() {
     let (p,c) = Chan::new();
-    do spawn {
+    spawn(proc() {
         let mut f = Foo(Cell::new(0));
         debug!("{}", f);
         let Foo(ref mut f) = f;
         assert!(f.get() == 1);
         c.send(());
-    }
+    });
     p.recv();
 }
index 064fb385dccb3243bbcf4ee16e1e0369887a9ef4..eb347ab28ff97b1688bb5e4725f4dc9479b0dd21 100644 (file)
@@ -2,7 +2,7 @@
 
 pub fn main() {
     let x = ~"Hello world!";
-    do task::spawn {
+    task::spawn(proc() {
         println!("{}", x);
-    }
+    });
 }
index cddee0be18df0d8ff7d6540cc3af7fb0a097c5c9..8907db04dadc0b6230f41275c7d3a707dc7d5219 100644 (file)
 #[start]
 fn start(argc: int, argv: **u8) -> int {
     // make sure that native::start always waits for all children to finish
-    do native::start(argc, argv) {
-        do spawn {
+    native::start(argc, argv, proc() {
+        spawn(proc() {
             unsafe { set = true; }
-        }
-    };
+        });
+    });
 
     // if we didn't set the global, then return a nonzero code
     if unsafe {set} {0} else {1}
index 3459f021f39bb94a1bb2e99859376899a0ea27f5..f9567858022b33d306027fe511cfabc25897a8bd 100644 (file)
@@ -24,9 +24,9 @@ fn drop(&mut self) {
 }
 
 fn main() {
-    do task::try::<()> {
+    task::try::<()>(proc() {
         let _a = A;
         fail!();
-    };
+    });
     assert!(unsafe { !HIT });
 }
index 8c3f889c176cd97c4b59c9e8b4b12c323e11c293..bc56712ee3bc1b2b2947c6e8c564b60f13e6a728 100644 (file)
@@ -22,8 +22,8 @@ fn foo(blk: proc()) {
 
 pub fn main() {
     let x = arc::Arc::new(true);
-    do foo {
+    foo(proc() {
         assert!(*x.get());
         drop(x);
-    }
+    });
 }
index f34cc268a0c255ea2632b93c9456867cf49a2bc7..0527f47c112e012dbf1c9d50640440b269fed496 100644 (file)
@@ -29,9 +29,9 @@ pub fn main() {
     let (port, chan) = stream();
 
     info!("main started");
-    do spawn {
+    spawn(proc() {
         starve_main(port);
-    };
+    });
     let mut i: int = 0;
     info!("main waiting for alive signal");
     chan.send(i);
index 7ede574a4d5bef69a7443cb14c556105148b29b2..474606ad347bd6747933b7509b24f03959021eae 100644 (file)
@@ -27,12 +27,12 @@ fn test(f: int) -> test {
 pub fn main() {
     let (p, c) = Chan::new();
 
-    do task::spawn() {
+    task::spawn(proc() {
         let (pp, cc) = Chan::new();
         c.send(cc);
 
         let _r = pp.recv();
-    }
+    });
 
     p.recv().send(test(42));
 }
index ce30071aaf4456cc2760d86908306036b82a7002..f6f6f3ba240cfd2dcaf1b3ef685442e5d35a1e9d 100644 (file)
@@ -20,9 +20,9 @@ fn test00() {
     let i: int = 0;
     let mut builder = task::task();
     let mut result = builder.future_result();
-    do builder.spawn {
+    builder.spawn(proc() {
         start(i)
-    }
+    });
 
     // Sleep long enough for the task to finish.
     let mut i = 0;
index 43ac3957ae2ed8f3604bae6266b5bc98106846e0..8622ff7608999ed45e77151e7d1e9ae4f1019140 100644 (file)
@@ -31,21 +31,21 @@ fn test00() {
     let number_of_messages: int = 10;
 
     let c = ch.clone();
-    do task::spawn || {
+    task::spawn(proc() {
         test00_start(&c, number_of_messages * 0, number_of_messages);
-    }
+    });
     let c = ch.clone();
-    do task::spawn || {
+    task::spawn(proc() {
         test00_start(&c, number_of_messages * 1, number_of_messages);
-    }
+    });
     let c = ch.clone();
-    do task::spawn || {
+    task::spawn(proc() {
         test00_start(&c, number_of_messages * 2, number_of_messages);
-    }
+    });
     let c = ch.clone();
-    do task::spawn || {
+    task::spawn(proc() {
         test00_start(&c, number_of_messages * 3, number_of_messages);
-    }
+    });
 
     let mut i: int = 0;
     while i < number_of_messages {
index a2463ff76815f2f175bd3e60f1f8572a8f53318e..feae49ffeb83c31d23c317e1b04a0483db2e3ea3 100644 (file)
@@ -29,10 +29,10 @@ fn test00() {
 
     let mut builder = task::task();
     let result = builder.future_result();
-    do builder.spawn {
+    builder.spawn(proc() {
         let mut ch = ch;
         test00_start(&mut ch, number_of_messages);
-    }
+    });
 
     let mut i: int = 0;
     while i < number_of_messages {
index 16e9cb538919cbc173db9a898e51315be0c56a8c..a4be47323e5b99e126d60551f16951a572113d39 100644 (file)
@@ -56,10 +56,10 @@ fn wrapper(c: Chan<bool>, f: ||) {
         *b = true;
     }
     let (p, c) = stream();
-    do task::spawn_unlinked {
+    task::spawn_unlinked(proc() {
         let ccc = c;
         wrapper(ccc, f)
-    }
+    });
     p
 }
 
index b99e6a03bcb3bae24ec5b5bd182c7ab635e2bbc8..2bf18e1ae1d5f67635e4b29eb3c0f8293f8b997f 100644 (file)
@@ -71,13 +71,13 @@ pub fn main() {
                          ~dogge2 as ~Pet:Freeze+Send]);
     let (p1,c1) = Chan::new();
     let arc1 = arc.clone();
-    do task::spawn { check_legs(arc1); c1.send(()); }
+    task::spawn(proc() { check_legs(arc1); c1.send(()); });
     let (p2,c2) = Chan::new();
     let arc2 = arc.clone();
-    do task::spawn { check_names(arc2); c2.send(()); }
+    task::spawn(proc() { check_names(arc2); c2.send(()); });
     let (p3,c3) = Chan::new();
     let arc3 = arc.clone();
-    do task::spawn { check_pedigree(arc3); c3.send(()); }
+    task::spawn(proc() { check_pedigree(arc3); c3.send(()); });
     p1.recv();
     p2.recv();
     p3.recv();
index 5707406de146c4edf822bb23d7989fd84c3ce1fa..04507dd01ce5c0890de6c49014cd7475a584d1f6 100644 (file)
@@ -21,9 +21,9 @@ fn drop(&mut self) {
 }
 
 pub fn main() {
-    let x = do task::try {
+    let x = task::try(proc() {
         let _b = Foo;
-    };
+    });
 
     let s = x.unwrap_err().move::<&'static str>().unwrap();
     assert_eq!(s.as_slice(), "This failure should happen.");