about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2011-12-30 20:46:08 -0800
committerNiko Matsakis <niko@alum.mit.edu>2012-01-06 22:40:31 -0800
commit98f5109cde838e66d629bf05c804ad1ca9b06c42 (patch)
tree097edb4079a90bd4db126927e15494e686b25fd9 /src/libstd
parente88905cd2882919f95084f41539ca9601ebf5cfc (diff)
downloadrust-98f5109cde838e66d629bf05c804ad1ca9b06c42.tar.gz
rust-98f5109cde838e66d629bf05c804ad1ca9b06c42.zip
simplify task impl
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/test.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libstd/test.rs b/src/libstd/test.rs
index 43a869f0319..f17029d3fcd 100644
--- a/src/libstd/test.rs
+++ b/src/libstd/test.rs
@@ -49,7 +49,7 @@ type test_name = str;
 // to support isolation of tests into tasks.
 type test_fn<T> = T;
 
-type default_test_fn = test_fn<fn()>;
+type default_test_fn = test_fn<sendfn()>;
 
 // The definition of a single test. A test runner will run a list of
 // these.
@@ -336,11 +336,10 @@ fn run_test<T: copy>(test: test_desc<T>,
 // We need to run our tests in another task in order to trap test failures.
 // This function only works with functions that don't contain closures.
 fn default_test_to_task(&&f: default_test_fn) -> joinable {
-    fn run_task(f: default_test_fn) {
+    ret task::spawn_joinable(sendfn[copy f]() {
         configure_test_task();
         f();
-    }
-    ret task::spawn_joinable(copy f, run_task);
+    });
 }
 
 // Call from within a test task to make sure it's set up correctly