diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-14 23:05:01 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-19 12:59:40 -0700 |
| commit | 9d5d97b55d6487ee23b805bc1acbaa0669b82116 (patch) | |
| tree | b72dcf7045e331e94ea0f8658d088ab42d917935 /src/libstd/task.rs | |
| parent | fb169d5543c84e11038ba2d07b538ec88fb49ca6 (diff) | |
Remove a large amount of deprecated functionality
Spring cleaning is here! In the Fall! This commit removes quite a large amount of deprecated functionality from the standard libraries. I tried to ensure that only old deprecated functionality was removed. This is removing lots and lots of deprecated features, so this is a breaking change. Please consult the deprecation messages of the deleted code to see how to migrate code forward if it still needs migration. [breaking-change]
Diffstat (limited to 'src/libstd/task.rs')
| -rw-r--r-- | src/libstd/task.rs | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/src/libstd/task.rs b/src/libstd/task.rs index 04d3bb8b3a7..1d1e6ae4feb 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -225,26 +225,6 @@ impl<S: Spawner> TaskBuilder<S> { } } - /// Add a wrapper to the body of the spawned task. - /// - /// Before the task is spawned it is passed through a 'body generator' - /// function that may perform local setup operations as well as wrap - /// the task body in remote setup operations. With this the behavior - /// of tasks can be extended in simple ways. - /// - /// This function augments the current body generator with a new body - /// generator by applying the task body which results from the - /// existing body generator to the new body generator. - #[deprecated = "this function will be removed soon"] - pub fn with_wrapper(mut self, wrapper: proc(v: proc():Send):Send -> proc():Send) - -> TaskBuilder<S> { - self.gen_body = match self.gen_body.take() { - Some(prev) => Some(proc(body) { wrapper(prev(body)) }), - None => Some(wrapper) - }; - self - } - // Where spawning actually happens (whether yielding a future or not) fn spawn_internal(self, f: proc():Send, on_exit: Option<proc(Result<(), Box<Any + Send>>):Send>) { @@ -354,18 +334,6 @@ pub fn try_future<T:Send>(f: proc():Send -> T) -> Future<Result<T, Box<Any + Sen /* Lifecycle functions */ /// Read the name of the current task. -#[deprecated = "Use `task::name()`."] -pub fn with_task_name<U>(blk: |Option<&str>| -> U) -> U { - use rt::task::Task; - - let task = Local::borrow(None::<Task>); - match task.name { - Some(ref name) => blk(Some(name.as_slice())), - None => blk(None) - } -} - -/// Read the name of the current task. #[stable] pub fn name() -> Option<String> { use rt::task::Task; @@ -447,20 +415,6 @@ mod test { } #[test] - #[allow(deprecated)] - fn test_with_wrapper() { - let (tx, rx) = channel(); - TaskBuilder::new().with_wrapper(proc(body) { - let result: proc():Send = proc() { - body(); - tx.send(()); - }; - result - }).spawn(proc() { }); - rx.recv(); - } - - #[test] fn test_try_future() { let result = TaskBuilder::new().try_future(proc() {}); assert!(result.unwrap().is_ok()); |
