]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/task.rs
Register new snapshots
[rust.git] / src / libstd / task.rs
index a4e1ad84252b1295a2154af3f65bac1ad747dd53..f543188af4295a628f946fbf89baa870fe86b11a 100644 (file)
@@ -63,9 +63,9 @@ pub struct TaskOpts {
     /// The size of the stack for the spawned task
     pub stack_size: Option<uint>,
     /// Task-local stdout
-    pub stdout: Option<Box<Writer:Send>>,
+    pub stdout: Option<Box<Writer + Send>>,
     /// Task-local stderr
-    pub stderr: Option<Box<Writer:Send>>,
+    pub stderr: Option<Box<Writer + Send>>,
 }
 
 /**
@@ -83,7 +83,7 @@ pub struct TaskOpts {
 pub struct TaskBuilder {
     /// Options to spawn the new task with
     pub opts: TaskOpts,
-    gen_body: Option<proc(v: proc():Send):Send -> proc():Send>,
+    gen_body: Option<proc(v: proc(): Send): Send -> proc(): Send>,
     nocopy: marker::NoCopy,
 }
 
@@ -146,7 +146,7 @@ pub fn named<S: IntoMaybeOwned<'static>>(mut self, name: S) -> TaskBuilder {
      * existing body generator to the new body generator.
      */
     pub fn with_wrapper(mut self,
-                        wrapper: proc(v: proc():Send):Send -> proc():Send)
+                        wrapper: proc(v: proc(): Send): Send -> proc(): Send)
         -> TaskBuilder
     {
         self.gen_body = match self.gen_body.take() {
@@ -163,7 +163,7 @@ pub fn with_wrapper(mut self,
      * the provided unique closure. The task has the properties and behavior
      * specified by the task_builder.
      */
-    pub fn spawn(mut self, f: proc():Send) {
+    pub fn spawn(mut self, f: proc(): Send) {
         let gen_body = self.gen_body.take();
         let f = match gen_body {
             Some(gen) => gen(f),
@@ -204,8 +204,8 @@ pub fn spawn(mut self, f: proc():Send) {
      * # Failure
      * Fails if a future_result was already set for this task.
      */
-    pub fn try<T:Send>(mut self, f: proc():Send -> T)
-               -> Result<T, Box<Any:Send>> {
+    pub fn try<T: Send>(mut self, f: proc(): Send -> T)
+               -> Result<T, Box<Any + Send>> {
         let (tx, rx) = channel();
 
         let result = self.future_result();
@@ -247,7 +247,7 @@ pub fn new() -> TaskOpts {
 /// the provided unique closure.
 ///
 /// This function is equivalent to `TaskBuilder::new().spawn(f)`.
-pub fn spawn(f: proc():Send) {
+pub fn spawn(f: proc(): Send) {
     TaskBuilder::new().spawn(f)
 }
 
@@ -255,7 +255,7 @@ pub fn spawn(f: proc():Send) {
 /// the function or an error if the task failed
 ///
 /// This is equivalent to TaskBuilder::new().try
-pub fn try<T:Send>(f: proc():Send -> T) -> Result<T, Box<Any:Send>> {
+pub fn try<T: Send>(f: proc(): Send -> T) -> Result<T, Box<Any + Send>> {
     TaskBuilder::new().try(f)
 }
 
@@ -344,7 +344,7 @@ fn test_run_basic() {
 fn test_with_wrapper() {
     let (tx, rx) = channel();
     TaskBuilder::new().with_wrapper(proc(body) {
-        let result: proc():Send = proc() {
+        let result: proc(): Send = proc() {
             body();
             tx.send(());
         };
@@ -430,7 +430,7 @@ fn test_spawn_sched_childs_on_default_sched() {
 }
 
 #[cfg(test)]
-fn avoid_copying_the_body(spawnfn: |v: proc():Send|) {
+fn avoid_copying_the_body(spawnfn: |v: proc(): Send|) {
     let (tx, rx) = channel::<uint>();
 
     let x = box 1;
@@ -476,7 +476,7 @@ fn test_child_doesnt_ref_parent() {
     // (well, it would if the constant were 8000+ - I lowered it to be more
     // valgrind-friendly. try this at home, instead..!)
     static generations: uint = 16;
-    fn child_no(x: uint) -> proc():Send {
+    fn child_no(x: uint) -> proc(): Send {
         return proc() {
             if x < generations {
                 TaskBuilder::new().spawn(child_no(x+1));
@@ -522,10 +522,10 @@ fn test_try_fail_message_owned_str() {
 #[test]
 fn test_try_fail_message_any() {
     match try(proc() {
-        fail!(box 413u16 as Box<Any:Send>);
+        fail!(box 413u16 as Box<Any + Send>);
     }) {
         Err(e) => {
-            type T = Box<Any:Send>;
+            type T = Box<Any + Send>;
             assert!(e.is::<T>());
             let any = e.move::<T>().unwrap();
             assert!(any.is::<u16>());