diff options
| author | bors <bors@rust-lang.org> | 2014-10-20 16:07:43 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-10-20 16:07:43 +0000 |
| commit | 7d0cc44f873ac338b400b20bcb62618aa5d36b70 (patch) | |
| tree | 411feaee5e6f1a35f5ddb3167d560b5422b8a473 /src/libstd/task.rs | |
| parent | dcbd49ff88d55f703e5a307e34e408d387a8a312 (diff) | |
| parent | 96445a533e8ea40701e2a9bbd25347141e63c115 (diff) | |
| download | rust-7d0cc44f873ac338b400b20bcb62618aa5d36b70.tar.gz rust-7d0cc44f873ac338b400b20bcb62618aa5d36b70.zip | |
auto merge of #18070 : alexcrichton/rust/spring-cleaning, r=aturon
This is a large spring-cleaning commit now that the 0.12.0 release has passed removing an amount of deprecated functionality. This removes a number of deprecated crates (all still available as cargo packages in the rust-lang organization) as well as a slew of deprecated functions. All `#[crate_id]` support has also been removed. I tried to avoid anything that was recently deprecated, but I may have missed something! The major pain points of this commit is the fact that rustc/syntax have `#[allow(deprecated)]`, but I've removed that annotation so moving forward they should be cleaned up as we go.
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()); |
