summary refs log tree commit diff
path: root/src/test/bench
diff options
context:
space:
mode:
authorMarvin Löbel <loebel.marvin@gmail.com>2013-10-11 23:20:34 +0200
committerMarvin Löbel <loebel.marvin@gmail.com>2013-10-28 08:50:32 +0100
commitfa8e71a8257f4226ab532d4bf268d3ecbfa98eb4 (patch)
tree0b8051814dd8a5ef08e663c172e2b456065d625d /src/test/bench
parentcb5b21eba713ff3888b2741db4c9e7d841cfde02 (diff)
downloadrust-fa8e71a8257f4226ab532d4bf268d3ecbfa98eb4.tar.gz
rust-fa8e71a8257f4226ab532d4bf268d3ecbfa98eb4.zip
Allow fail messages to be caught, and introduce the Any trait
Some code cleanup, sorting of import blocks

Removed std::unstable::UnsafeArc's use of Either

Added run-fail tests for the new FailWithCause impls

Changed future_result and try to return Result<(), ~Any>.

- Internally, there is an enum of possible fail messages passend around.
- In case of linked failure or a string message, the ~Any gets
  lazyly allocated in future_results recv method.
- For that, future result now returns a wrapper around a Port.
- Moved and renamed task::TaskResult into rt::task::UnwindResult
  and made it an internal enum.
- Introduced a replacement typedef `type TaskResult = Result<(), ~Any>`.
Diffstat (limited to 'src/test/bench')
-rw-r--r--src/test/bench/task-perf-linked-failure.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/bench/task-perf-linked-failure.rs b/src/test/bench/task-perf-linked-failure.rs
index 5484a3965b3..54a05c7257e 100644
--- a/src/test/bench/task-perf-linked-failure.rs
+++ b/src/test/bench/task-perf-linked-failure.rs
@@ -60,7 +60,7 @@ fn spawn_supervised_blocking(myname: &str, f: ~fn()) {
     builder.spawn(f);
     error!("{} group waiting", myname);
     let x = res.recv();
-    assert_eq!(x, task::Success);
+    assert!(x.is_ok());
 }
 
 fn main() {
@@ -78,7 +78,7 @@ 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<(),()> = do task::try { // unlinked
+    let x: result::Result<(), ~Any> = do task::try { // unlinked
         do spawn_supervised_blocking("grandparent") {
             do spawn_supervised_blocking("middle") {
                 grandchild_group(num_tasks);