diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2011-12-30 20:46:08 -0800 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2012-01-06 22:40:31 -0800 |
| commit | 98f5109cde838e66d629bf05c804ad1ca9b06c42 (patch) | |
| tree | 097edb4079a90bd4db126927e15494e686b25fd9 /src/libstd | |
| parent | e88905cd2882919f95084f41539ca9601ebf5cfc (diff) | |
| download | rust-98f5109cde838e66d629bf05c804ad1ca9b06c42.tar.gz rust-98f5109cde838e66d629bf05c804ad1ca9b06c42.zip | |
simplify task impl
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/test.rs | 7 |
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 |
