about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-06-19 01:41:43 +0000
committerbors <bors@rust-lang.org>2014-06-19 01:41:43 +0000
commit3770c42a4959cbabc73da52abc7e3db96657974e (patch)
treef16e89715388b6ac30e01c68bee674dafefa8a26 /src/test
parent0dcc9554599750e237119756e03a62fd0a9d8970 (diff)
parent2c3bf8836f6f0cd18d8ac4f7189615f7f4098f5d (diff)
downloadrust-3770c42a4959cbabc73da52abc7e3db96657974e.tar.gz
rust-3770c42a4959cbabc73da52abc7e3db96657974e.zip
auto merge of #15025 : alexcrichton/rust/rollup, r=alexcrichton
Diffstat (limited to 'src/test')
-rw-r--r--src/test/bench/msgsend-pipes-shared.rs11
-rw-r--r--src/test/bench/msgsend-pipes.rs17
-rw-r--r--src/test/bench/shootout-pfib.rs11
-rw-r--r--src/test/bench/sudoku.rs1
-rw-r--r--src/test/compile-fail/borrowck-array-double-move.rs21
-rw-r--r--src/test/compile-fail/macros-nonfatal-errors.rs3
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-non-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs1
-rw-r--r--src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs1
-rw-r--r--src/test/debuginfo/issue14411.rs25
-rw-r--r--src/test/run-pass/issue-14865.rs30
-rw-r--r--src/test/run-pass/issue-14958.rs29
-rw-r--r--src/test/run-pass/issue-2190-1.rs4
-rw-r--r--src/test/run-pass/issue-4333.rs2
-rw-r--r--src/test/run-pass/task-comm-12.rs7
-rw-r--r--src/test/run-pass/task-comm-3.rs10
-rw-r--r--src/test/run-pass/task-comm-9.rs8
-rw-r--r--src/test/run-pass/task-stderr.rs26
-rw-r--r--src/test/run-pass/tcp-stress.rs4
-rw-r--r--src/test/run-pass/tempfile.rs2
-rw-r--r--src/test/run-pass/trait-coercion.rs2
-rw-r--r--src/test/run-pass/yield.rs7
-rw-r--r--src/test/run-pass/yield1.rs7
27 files changed, 172 insertions, 62 deletions
diff --git a/src/test/bench/msgsend-pipes-shared.rs b/src/test/bench/msgsend-pipes-shared.rs
index 03d91cf3aaa..14155d54d73 100644
--- a/src/test/bench/msgsend-pipes-shared.rs
+++ b/src/test/bench/msgsend-pipes-shared.rs
@@ -24,7 +24,6 @@ extern crate debug;
 use std::comm;
 use std::os;
 use std::task;
-use std::task::TaskBuilder;
 use std::uint;
 
 fn move_out<T>(_x: T) {}
@@ -64,22 +63,20 @@ fn run(args: &[String]) {
     let mut worker_results = Vec::new();
     for _ in range(0u, workers) {
         let to_child = to_child.clone();
-        let mut builder = TaskBuilder::new();
-        worker_results.push(builder.future_result());
-        builder.spawn(proc() {
+        worker_results.push(task::try_future(proc() {
             for _ in range(0u, size / workers) {
                 //println!("worker {:?}: sending {:?} bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
             //println!("worker {:?} exiting", i);
-        });
+        }));
     }
     task::spawn(proc() {
         server(&from_parent, &to_parent);
     });
 
-    for r in worker_results.iter() {
-        r.recv();
+    for r in worker_results.move_iter() {
+        r.unwrap();
     }
 
     //println!("sending stop message");
diff --git a/src/test/bench/msgsend-pipes.rs b/src/test/bench/msgsend-pipes.rs
index 4de51c3ab4b..7ec2796b230 100644
--- a/src/test/bench/msgsend-pipes.rs
+++ b/src/test/bench/msgsend-pipes.rs
@@ -19,7 +19,6 @@ extern crate debug;
 
 use std::os;
 use std::task;
-use std::task::TaskBuilder;
 use std::uint;
 
 fn move_out<T>(_x: T) {}
@@ -58,29 +57,25 @@ fn run(args: &[String]) {
     let mut worker_results = Vec::new();
     let from_parent = if workers == 1 {
         let (to_child, from_parent) = channel();
-        let mut builder = TaskBuilder::new();
-        worker_results.push(builder.future_result());
-        builder.spawn(proc() {
+        worker_results.push(task::try_future(proc() {
             for _ in range(0u, size / workers) {
                 //println!("worker {:?}: sending {:?} bytes", i, num_bytes);
                 to_child.send(bytes(num_bytes));
             }
             //println!("worker {:?} exiting", i);
-        });
+        }));
         from_parent
     } else {
         let (to_child, from_parent) = channel();
         for _ in range(0u, workers) {
             let to_child = to_child.clone();
-            let mut builder = TaskBuilder::new();
-            worker_results.push(builder.future_result());
-            builder.spawn(proc() {
+            worker_results.push(task::try_future(proc() {
                 for _ in range(0u, size / workers) {
                     //println!("worker {:?}: sending {:?} bytes", i, num_bytes);
                     to_child.send(bytes(num_bytes));
                 }
                 //println!("worker {:?} exiting", i);
-            });
+            }));
         }
         from_parent
     };
@@ -88,8 +83,8 @@ fn run(args: &[String]) {
         server(&from_parent, &to_parent);
     });
 
-    for r in worker_results.iter() {
-        r.recv();
+    for r in worker_results.move_iter() {
+        r.unwrap();
     }
 
     //println!("sending stop message");
diff --git a/src/test/bench/shootout-pfib.rs b/src/test/bench/shootout-pfib.rs
index 33853a91b76..57a6d0e7c52 100644
--- a/src/test/bench/shootout-pfib.rs
+++ b/src/test/bench/shootout-pfib.rs
@@ -24,7 +24,6 @@ extern crate time;
 use std::os;
 use std::result::{Ok, Err};
 use std::task;
-use std::task::TaskBuilder;
 use std::uint;
 
 fn fib(n: int) -> int {
@@ -79,14 +78,12 @@ fn stress_task(id: int) {
 fn stress(num_tasks: int) {
     let mut results = Vec::new();
     for i in range(0, num_tasks) {
-        let mut builder = TaskBuilder::new();
-        results.push(builder.future_result());
-        builder.spawn(proc() {
+        results.push(task::try_future(proc() {
             stress_task(i);
-        });
+        }));
     }
-    for r in results.iter() {
-        r.recv();
+    for r in results.move_iter() {
+        r.unwrap();
     }
 }
 
diff --git a/src/test/bench/sudoku.rs b/src/test/bench/sudoku.rs
index c0ea6f8617d..af51157bba5 100644
--- a/src/test/bench/sudoku.rs
+++ b/src/test/bench/sudoku.rs
@@ -16,7 +16,6 @@
 use std::io;
 use std::io::stdio::StdReader;
 use std::io::BufferedReader;
-use std::num::Bitwise;
 use std::os;
 
 // Computes a single solution to a given 9x9 sudoku
diff --git a/src/test/compile-fail/borrowck-array-double-move.rs b/src/test/compile-fail/borrowck-array-double-move.rs
new file mode 100644
index 00000000000..c7fb646f585
--- /dev/null
+++ b/src/test/compile-fail/borrowck-array-double-move.rs
@@ -0,0 +1,21 @@
+// Copyright 2014 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() {
+    let mut a = [box 0, box 1];
+    drop(a[0]);
+    a[1] = box 2;
+    drop(a[0]); //~ ERROR use of moved value: `a[..]`
+}
+
+fn main() {
+    f();
+}
+
diff --git a/src/test/compile-fail/macros-nonfatal-errors.rs b/src/test/compile-fail/macros-nonfatal-errors.rs
index df2c40657c8..5f8352d1e52 100644
--- a/src/test/compile-fail/macros-nonfatal-errors.rs
+++ b/src/test/compile-fail/macros-nonfatal-errors.rs
@@ -22,7 +22,8 @@ enum CantDeriveThose {}
 fn main() {
     doesnt_exist!(); //~ ERROR
 
-    bytes!(invalid); //~ ERROR
+    bytes!(invalid); //~ ERROR non-literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 
     asm!(invalid); //~ ERROR
 
diff --git a/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs b/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs
index f5b4342ceb7..d03696cbbbc 100644
--- a/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-non-ascii-char-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!('λ'); //~ ERROR non-ascii char literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-non-literal.rs b/src/test/compile-fail/syntax-extension-bytes-non-literal.rs
index 281a5630f82..3a2e104818f 100644
--- a/src/test/compile-fail/syntax-extension-bytes-non-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-non-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(foo); //~ ERROR non-literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs
index 25688d7d17a..8e7c6147758 100644
--- a/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-too-large-integer-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(1024); //~ ERROR too large integer literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs
index d1c8a2c0913..1a9aa3753ee 100644
--- a/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-too-large-u8-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(1024u8); //~ ERROR too large u8 literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs
index ef45ea06003..c2d49735943 100644
--- a/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-too-small-integer-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(-1024); //~ ERROR non-literal in bytes
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs b/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs
index b8ba73559aa..ac33ffb60e2 100644
--- a/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-too-small-u8-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(-1024u8); //~ ERROR non-literal in bytes
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs b/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs
index 142566fe8ab..f6b3659354c 100644
--- a/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs
+++ b/src/test/compile-fail/syntax-extension-bytes-unsupported-literal.rs
@@ -10,4 +10,5 @@
 
 fn main() {
     let vec = bytes!(45f64); //~ ERROR unsupported literal in bytes!
+    //~^ WARN `bytes!` is deprecated
 }
diff --git a/src/test/debuginfo/issue14411.rs b/src/test/debuginfo/issue14411.rs
new file mode 100644
index 00000000000..16c7dcc34ff
--- /dev/null
+++ b/src/test/debuginfo/issue14411.rs
@@ -0,0 +1,25 @@
+// Copyright 2013-2014 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.
+
+// ignore-android: FIXME(#10381)
+
+// compile-flags:-g
+
+// No debugger interaction required: just make sure it compiles without
+// crashing.
+
+fn test(a: &Vec<u8>) {
+  print!("{}", a.len());
+}
+
+pub fn main() {
+  let data = vec!();
+  test(&data);
+}
diff --git a/src/test/run-pass/issue-14865.rs b/src/test/run-pass/issue-14865.rs
new file mode 100644
index 00000000000..7fa88a7653a
--- /dev/null
+++ b/src/test/run-pass/issue-14865.rs
@@ -0,0 +1,30 @@
+// Copyright 2012-2014 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.
+
+enum X {
+    Foo(uint),
+    Bar(bool)
+}
+
+fn main() {
+    let x = match Foo(42) {
+        Foo(..) => 1,
+        _ if true => 0,
+        Bar(..) => fail!("Oh dear")
+    };
+    assert_eq!(x, 1);
+
+    let x = match Foo(42) {
+        _ if true => 0,
+        Foo(..) => 1,
+        Bar(..) => fail!("Oh dear")
+    };
+    assert_eq!(x, 0);
+}
diff --git a/src/test/run-pass/issue-14958.rs b/src/test/run-pass/issue-14958.rs
new file mode 100644
index 00000000000..045d3cc0458
--- /dev/null
+++ b/src/test/run-pass/issue-14958.rs
@@ -0,0 +1,29 @@
+// Copyright 2014 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.
+
+#![feature(overloaded_calls)]
+
+trait Foo {}
+
+struct Bar;
+
+impl<'a> std::ops::Fn<(&'a Foo,), ()> for Bar {
+    fn call(&self, _: (&'a Foo,)) {}
+}
+
+struct Baz;
+
+impl Foo for Baz {}
+
+fn main() {
+    let bar = Bar;
+    let baz = &Baz;
+    bar(baz);
+}
diff --git a/src/test/run-pass/issue-2190-1.rs b/src/test/run-pass/issue-2190-1.rs
index f1217be3484..4ff735708b5 100644
--- a/src/test/run-pass/issue-2190-1.rs
+++ b/src/test/run-pass/issue-2190-1.rs
@@ -13,9 +13,7 @@ use std::task::TaskBuilder;
 static generations: uint = 1024+256+128+49;
 
 fn spawn(f: proc():Send) {
-    let mut t = TaskBuilder::new();
-    t.opts.stack_size = Some(32 * 1024);
-    t.spawn(f);
+    TaskBuilder::new().stack_size(32 * 1024).spawn(f)
 }
 
 fn child_no(x: uint) -> proc():Send {
diff --git a/src/test/run-pass/issue-4333.rs b/src/test/run-pass/issue-4333.rs
index 6fb66cd3b15..fd67b767104 100644
--- a/src/test/run-pass/issue-4333.rs
+++ b/src/test/run-pass/issue-4333.rs
@@ -12,5 +12,5 @@ use std::io;
 
 pub fn main() {
     let stdout = &mut io::stdout() as &mut io::Writer;
-    stdout.write(bytes!("Hello!"));
+    stdout.write(b"Hello!");
 }
diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs
index a78bbefed44..851f87adfc2 100644
--- a/src/test/run-pass/task-comm-12.rs
+++ b/src/test/run-pass/task-comm-12.rs
@@ -9,7 +9,6 @@
 // except according to those terms.
 
 use std::task;
-use std::task::TaskBuilder;
 
 pub fn main() { test00(); }
 
@@ -17,9 +16,7 @@ fn start(_task_number: int) { println!("Started / Finished task."); }
 
 fn test00() {
     let i: int = 0;
-    let mut builder = TaskBuilder::new();
-    let mut result = builder.future_result();
-    builder.spawn(proc() {
+    let mut result = task::try_future(proc() {
         start(i)
     });
 
@@ -31,7 +28,7 @@ fn test00() {
     }
 
     // Try joining tasks that have already finished.
-    result.recv();
+    result.unwrap();
 
     println!("Joined task.");
 }
diff --git a/src/test/run-pass/task-comm-3.rs b/src/test/run-pass/task-comm-3.rs
index 217bab5c1de..cd31d15db10 100644
--- a/src/test/run-pass/task-comm-3.rs
+++ b/src/test/run-pass/task-comm-3.rs
@@ -10,7 +10,7 @@
 
 extern crate debug;
 
-use std::task::TaskBuilder;
+use std::task;
 
 pub fn main() { println!("===== WITHOUT THREADS ====="); test00(); }
 
@@ -39,14 +39,12 @@ fn test00() {
     let mut results = Vec::new();
     while i < number_of_tasks {
         let tx = tx.clone();
-        let mut builder = TaskBuilder::new();
-        results.push(builder.future_result());
-        builder.spawn({
+        results.push(task::try_future({
             let i = i;
             proc() {
                 test00_start(&tx, i, number_of_messages)
             }
-        });
+        }));
         i = i + 1;
     }
 
@@ -62,7 +60,7 @@ fn test00() {
     }
 
     // Join spawned tasks...
-    for r in results.iter() { r.recv(); }
+    for r in results.mut_iter() { r.get_ref(); }
 
     println!("Completed: Final number is: ");
     println!("{:?}", sum);
diff --git a/src/test/run-pass/task-comm-9.rs b/src/test/run-pass/task-comm-9.rs
index ab6498c0027..a46b4513c5d 100644
--- a/src/test/run-pass/task-comm-9.rs
+++ b/src/test/run-pass/task-comm-9.rs
@@ -10,7 +10,7 @@
 
 extern crate debug;
 
-use std::task::TaskBuilder;
+use std::task;
 
 pub fn main() { test00(); }
 
@@ -25,9 +25,7 @@ fn test00() {
     let (tx, rx) = channel();
     let number_of_messages: int = 10;
 
-    let mut builder = TaskBuilder::new();
-    let result = builder.future_result();
-    builder.spawn(proc() {
+    let result = task::try_future(proc() {
         test00_start(&tx, number_of_messages);
     });
 
@@ -38,7 +36,7 @@ fn test00() {
         i += 1;
     }
 
-    result.recv();
+    result.unwrap();
 
     assert_eq!(sum, number_of_messages * (number_of_messages - 1) / 2);
 }
diff --git a/src/test/run-pass/task-stderr.rs b/src/test/run-pass/task-stderr.rs
new file mode 100644
index 00000000000..6a71f9df6e4
--- /dev/null
+++ b/src/test/run-pass/task-stderr.rs
@@ -0,0 +1,26 @@
+// Copyright 2014 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.
+
+use std::io::{ChanReader, ChanWriter};
+use std::task::TaskBuilder;
+
+fn main() {
+    let (tx, rx) = channel();
+    let mut reader = ChanReader::new(rx);
+    let stderr = ChanWriter::new(tx);
+
+    let res = TaskBuilder::new().stderr(box stderr as Box<Writer + Send>).try(proc() -> () {
+        fail!("Hello, world!")
+    });
+    assert!(res.is_err());
+
+    let output = reader.read_to_str().unwrap();
+    assert!(output.as_slice().contains("Hello, world!"));
+}
diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs
index 9c4716e5f4d..99bf247229e 100644
--- a/src/test/run-pass/tcp-stress.rs
+++ b/src/test/run-pass/tcp-stress.rs
@@ -60,9 +60,7 @@ fn main() {
     let (tx, rx) = channel();
     for _ in range(0, 1000) {
         let tx = tx.clone();
-        let mut builder = TaskBuilder::new();
-        builder.opts.stack_size = Some(64 * 1024);
-        builder.spawn(proc() {
+        TaskBuilder::new().stack_size(64 * 1024).spawn(proc() {
             let host = addr.ip.to_str();
             let port = addr.port;
             match TcpStream::connect(host.as_slice(), port) {
diff --git a/src/test/run-pass/tempfile.rs b/src/test/run-pass/tempfile.rs
index 316d1facb18..4355bf4127f 100644
--- a/src/test/run-pass/tempfile.rs
+++ b/src/test/run-pass/tempfile.rs
@@ -29,7 +29,7 @@ fn test_tempdir() {
     let path = {
         let p = TempDir::new_in(&Path::new("."), "foobar").unwrap();
         let p = p.path();
-        assert!(p.as_vec().ends_with(bytes!("foobar")));
+        assert!(p.as_vec().ends_with(b"foobar"));
         p.clone()
     };
     assert!(!path.exists());
diff --git a/src/test/run-pass/trait-coercion.rs b/src/test/run-pass/trait-coercion.rs
index 1d229a8ae83..55beebbf2bc 100644
--- a/src/test/run-pass/trait-coercion.rs
+++ b/src/test/run-pass/trait-coercion.rs
@@ -26,7 +26,7 @@ impl Trait for Struct {
 }
 
 fn foo(mut a: Box<Writer>) {
-    a.write(bytes!("Hello\n"));
+    a.write(b"Hello\n");
 }
 
 pub fn main() {
diff --git a/src/test/run-pass/yield.rs b/src/test/run-pass/yield.rs
index 2662a6c6568..89d204dcecb 100644
--- a/src/test/run-pass/yield.rs
+++ b/src/test/run-pass/yield.rs
@@ -9,18 +9,15 @@
 // except according to those terms.
 
 use std::task;
-use std::task::TaskBuilder;
 
 pub fn main() {
-    let mut builder = TaskBuilder::new();
-    let mut result = builder.future_result();
-    builder.spawn(child);
+    let mut result = task::try_future(child);
     println!("1");
     task::deschedule();
     println!("2");
     task::deschedule();
     println!("3");
-    result.recv();
+    result.unwrap();
 }
 
 fn child() {
diff --git a/src/test/run-pass/yield1.rs b/src/test/run-pass/yield1.rs
index 8c5504725bb..d882b1abd29 100644
--- a/src/test/run-pass/yield1.rs
+++ b/src/test/run-pass/yield1.rs
@@ -9,15 +9,12 @@
 // except according to those terms.
 
 use std::task;
-use std::task::TaskBuilder;
 
 pub fn main() {
-    let mut builder = TaskBuilder::new();
-    let mut result = builder.future_result();
-    builder.spawn(child);
+    let mut result = task::try_future(child);
     println!("1");
     task::deschedule();
-    result.recv();
+    result.unwrap();
 }
 
 fn child() { println!("2"); }