Repository: rust-lang-nursery/futures-rs
Pull request #731 (2018-02-05 19:15:01)

Remove deprecated functionality
@alexcrichton 


Patch:
diff --git a/.travis.yml b/.travis.yml
index f3bf51c6..551d724e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -19,7 +19,7 @@ script:
   - cargo build
   - cargo build --no-default-features
   - cargo test
-  - cargo test --no-default-features --features use_std
+  - cargo test --no-default-features --features std
   - cargo test --manifest-path futures-cpupool/Cargo.toml
   - cargo test --manifest-path futures-cpupool/Cargo.toml --no-default-features
 
diff --git a/Cargo.toml b/Cargo.toml
index c3e7760e..87a4fca2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -21,9 +21,8 @@ appveyor = { repository = "alexcrichton/futures-rs" }
 [dependencies]
 
 [features]
-use_std = []
-with-deprecated = []
-default = ["use_std", "with-deprecated"]
+std = []
+default = ["std"]
 
 [workspace]
 members = ["futures-cpupool"]
diff --git a/README.md b/README.md
index de3b99c0..95036561 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ For more information about how you can use futures with async I/O you can take a
 look at [https://tokio.rs](https://tokio.rs) which is an introduction to both
 the Tokio stack and also futures.
 
-### Feature `use_std`
+### Feature `std`
 
 `futures-rs` works without the standard library, such as in bare metal environments.
 However, it has a significantly reduced API surface. To use `futures-rs` in
diff --git a/appveyor.yml b/appveyor.yml
index b516f608..23bea9e9 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -35,5 +35,5 @@ test_script:
   - cargo build
   - cargo build --no-default-features
   - cargo test
-  - cargo test --no-default-features --features use_std
+  - cargo test --no-default-features --features std
   - cargo test --manifest-path futures-cpupool/Cargo.toml
diff --git a/futures-cpupool/Cargo.toml b/futures-cpupool/Cargo.toml
index fdeb5418..35d9854c 100644
--- a/futures-cpupool/Cargo.toml
+++ b/futures-cpupool/Cargo.toml
@@ -18,8 +18,4 @@ num_cpus = "1.0"
 path = ".."
 version = "0.1"
 default-features = false
-features = ["use_std"]
-
-[features]
-default = ["with-deprecated"]
-with-deprecated = ["futures/with-deprecated"]
+features = ["std"]
diff --git a/src/executor.rs b/src/executor.rs
index b6b6d422..02a3bd29 100644
--- a/src/executor.rs
+++ b/src/executor.rs
@@ -8,8 +8,8 @@
 //! [online]: https://tokio.rs/docs/going-deeper-futures/tasks/
 
 #[allow(deprecated)]
-#[cfg(feature = "use_std")]
-pub use task_impl::{Unpark, Executor, Run};
+#[cfg(feature = "std")]
+pub use task_impl::{Executor, Run};
 
 pub use task_impl::{Spawn, spawn, Notify, with_notify};
 
diff --git a/src/future/mod.rs b/src/future/mod.rs
index 7cccd907..bcab1518 100644
--- a/src/future/mod.rs
+++ b/src/future/mod.rs
@@ -20,27 +20,6 @@ pub use self::poll_fn::{poll_fn, PollFn};
 pub use self::result_::{result, ok, err, FutureResult};
 pub use self::loop_fn::{loop_fn, Loop, LoopFn};
 
-#[doc(hidden)]
-#[deprecated(since = "0.1.4", note = "use `ok` instead")]
-#[cfg(feature = "with-deprecated")]
-pub use self::{ok as finished, Ok as Finished};
-#[doc(hidden)]
-#[deprecated(since = "0.1.4", note = "use `err` instead")]
-#[cfg(feature = "with-deprecated")]
-pub use self::{err as failed, Err as Failed};
-#[doc(hidden)]
-#[deprecated(since = "0.1.4", note = "use `result` instead")]
-#[cfg(feature = "with-deprecated")]
-pub use self::{result as done, FutureResult as Done};
-#[doc(hidden)]
-#[deprecated(since = "0.1.7", note = "use `FutureResult` instead")]
-#[cfg(feature = "with-deprecated")]
-pub use self::{FutureResult as Ok};
-#[doc(hidden)]
-#[deprecated(since = "0.1.7", note = "use `FutureResult` instead")]
-#[cfg(feature = "with-deprecated")]
-pub use self::{FutureResult as Err};
-
 // combinators
 mod and_then;
 mod flatten;
@@ -89,22 +68,6 @@ if_std! {
     pub use self::select_ok::{SelectOk, select_ok};
     pub use self::shared::{Shared, SharedItem, SharedError};
 
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use join_all instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use self::join_all::join_all as collect;
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use JoinAll instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use self::join_all::JoinAll as Collect;
-
-    /// A type alias for `Box<Future + Send>`
-    #[doc(hidden)]
-    #[deprecated(note = "removed without replacement, recommended to use a \
-                         local extension trait or function if needed, more \
-                         details in https://github.com/alexcrichton/futures-rs/issues/228")]
-    pub type BoxFuture<T, E> = ::std::boxed::Box<Future<Item = T, Error = E> + Send>;
-
     impl<F: ?Sized + Future> Future for ::std::boxed::Box<F> {
         type Item = F::Item;
         type Error = F::Error;
@@ -285,52 +248,20 @@ pub trait Future {
     /// >           blocking work associated with this future will be completed
     /// >           by another thread.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Panics
     ///
     /// This function does not attempt to catch panics. If the `poll` function
     /// of this future panics, panics will be propagated to the caller.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn wait(self) -> result::Result<Self::Item, Self::Error>
         where Self: Sized
     {
         ::executor::spawn(self).wait_future()
     }
 
-    /// Convenience function for turning this future into a trait object which
-    /// is also `Send`.
-    ///
-    /// This simply avoids the need to write `Box::new` and can often help with
-    /// type inference as well by always returning a trait object. Note that
-    /// this method requires the `Send` bound and returns a `BoxFuture`, which
-    /// also encodes this. If you'd like to create a `Box<Future>` without the
-    /// `Send` bound, then the `Box::new` function can be used instead.
-    ///
-    /// This method is only available when the `use_std` feature of this
-    /// library is activated, and it is activated by default.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use futures::prelude::*;
-    /// use futures::future::{BoxFuture, result};
-    ///
-    /// let a: BoxFuture<i32, i32> = result(Ok(1)).boxed();
-    /// ```
-    #[cfg(feature = "use_std")]
-    #[doc(hidden)]
-    #[deprecated(note = "removed without replacement, recommended to use a \
-                         local extension trait or function if needed, more \
-                         details in https://github.com/alexcrichton/futures-rs/issues/228")]
-    #[allow(deprecated)]
-    fn boxed(self) -> BoxFuture<Self::Item, Self::Error>
-        where Self: Sized + Send + 'static
-    {
-        ::std::boxed::Box::new(self)
-    }
-
     /// Map this future's result to a different type, returning a new future of
     /// the resulting type.
     ///
@@ -939,7 +870,7 @@ pub trait Future {
     /// after-the fact. To assist using this method, the `Future` trait is also
     /// implemented for `AssertUnwindSafe<F>` where `F` implements `Future`.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Examples
@@ -957,7 +888,7 @@ pub trait Future {
     /// });
     /// assert!(future.catch_unwind().wait().is_err());
     /// ```
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn catch_unwind(self) -> CatchUnwind<Self>
         where Self: Sized + ::std::panic::UnwindSafe
     {
@@ -976,7 +907,7 @@ pub trait Future {
     /// access to the underlying result. Ownership of `Self::Item` and
     /// `Self::Error` cannot currently be reclaimed.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Examples
@@ -1006,7 +937,7 @@ pub trait Future {
     /// assert_eq!(6, *shared1.wait().unwrap());
     /// join_handle.join().unwrap();
     /// ```
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn shared(self) -> Shared<Self>
         where Self: Sized
     {
diff --git a/src/future/shared.rs b/src/future/shared.rs
index 3f7e3afd..9b6081ad 100644
--- a/src/future/shared.rs
+++ b/src/future/shared.rs
@@ -79,14 +79,6 @@ pub fn new<F: Future>(future: F) -> Shared<F> {
 }
 
 impl<F> Shared<F> where F: Future {
-    // TODO: make this private
-    #[deprecated(since = "0.1.12", note = "use `Future::shared` instead")]
-    #[cfg(feature = "with-deprecated")]
-    #[doc(hidden)]
-    pub fn new(future: F) -> Self {
-        new(future)
-    }
-
     /// If any clone of this `Shared` has completed execution, returns its result immediately
     /// without blocking. Otherwise, returns None without triggering the work represented by
     /// this `Shared`.
diff --git a/src/lib.rs b/src/lib.rs
index ac27d3bc..01021940 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -160,12 +160,12 @@
 #![doc(html_root_url = "https://docs.rs/futures/0.1")]
 
 #[macro_use]
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 extern crate std;
 
 macro_rules! if_std {
     ($($i:item)*) => ($(
-        #[cfg(feature = "use_std")]
+        #[cfg(feature = "std")]
         $i
     )*)
 }
@@ -183,21 +183,7 @@ pub use stream::Stream;
 pub mod sink;
 pub use sink::Sink;
 
-#[deprecated(since = "0.1.4", note = "import through the future module instead")]
-#[cfg(feature = "with-deprecated")]
-#[doc(hidden)]
-pub use future::{done, empty, failed, finished, lazy};
-
-#[doc(hidden)]
-#[cfg(feature = "with-deprecated")]
-#[deprecated(since = "0.1.4", note = "import through the future module instead")]
-pub use future::{
-    Done, Empty, Failed, Finished, Lazy, AndThen, Flatten, FlattenStream, Fuse, IntoStream,
-    Join, Join3, Join4, Join5, Map, MapErr, OrElse, Select,
-    SelectNext, Then
-};
-
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 mod lock;
 mod task_impl;
 
@@ -205,44 +191,8 @@ mod resultstream;
 
 pub mod task;
 pub mod executor;
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 pub mod sync;
-#[cfg(feature = "use_std")]
-pub mod unsync;
-
-
-if_std! {
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use sync::oneshot::channel instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use sync::oneshot::channel as oneshot;
-
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use sync::oneshot::Receiver instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use sync::oneshot::Receiver as Oneshot;
-
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use sync::oneshot::Sender instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use sync::oneshot::Sender as Complete;
-
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "use sync::oneshot::Canceled instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use sync::oneshot::Canceled;
-
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "import through the future module instead")]
-    #[cfg(feature = "with-deprecated")]
-    #[allow(deprecated)]
-    pub use future::{BoxFuture, collect, select_all, select_ok};
-
-    #[doc(hidden)]
-    #[deprecated(since = "0.1.4", note = "import through the future module instead")]
-    #[cfg(feature = "with-deprecated")]
-    pub use future::{SelectAll, SelectAllNext, Collect, SelectOk};
-}
 
 /// A "prelude" for crates using the `futures` crate.
 ///
diff --git a/src/sink/mod.rs b/src/sink/mod.rs
index e5ea97f9..fcb18727 100644
--- a/src/sink/mod.rs
+++ b/src/sink/mod.rs
@@ -277,13 +277,6 @@ pub trait Sink {
     /// It is highly recommended to consider this method a required method and
     /// to implement it whenever you implement `Sink` locally. It is especially
     /// crucial to be sure to close inner sinks, if applicable.
-    #[cfg(feature = "with-deprecated")]
-    fn close(&mut self) -> Poll<(), Self::SinkError> {
-        self.poll_complete()
-    }
-
-    /// dox (you should see the above, not this)
-    #[cfg(not(feature = "with-deprecated"))]
     fn close(&mut self) -> Poll<(), Self::SinkError>;
 
     /// Creates a new object which will produce a synchronous sink.
@@ -292,7 +285,7 @@ pub trait Sink {
     /// only has two methods: `send` and `flush`. These two methods correspond
     /// to `start_send` and `poll_complete` above except are executed in a
     /// blocking fashion.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn wait(self) -> Wait<Self>
         where Self: Sized
     {
@@ -400,9 +393,9 @@ pub trait Sink {
     /// Note that this function consumes the given sink, returning a wrapped
     /// version, much like `Iterator::map`.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn buffer(self, amt: usize) -> Buffer<Self>
         where Self: Sized
     {
diff --git a/src/stream/channel.rs b/src/stream/channel.rs
deleted file mode 100644
index 89a419d1..00000000
--- a/src/stream/channel.rs
+++ /dev/null
@@ -1,114 +0,0 @@
-#![cfg(feature = "with-deprecated")]
-#![deprecated(since = "0.1.4", note = "use sync::mpsc::channel instead")]
-#![allow(deprecated)]
-
-use std::any::Any;
-use std::error::Error;
-use std::fmt;
-
-use {Poll, Async, Stream, Future, Sink};
-use sink::Send;
-use sync::mpsc;
-
-/// Creates an in-memory channel implementation of the `Stream` trait.
-///
-/// This method creates a concrete implementation of the `Stream` trait which
-/// can be used to send values across threads in a streaming fashion. This
-/// channel is unique in that it implements back pressure to ensure that the
-/// sender never outpaces the receiver. The `Sender::send` method will only
-/// allow sending one message and the next message can only be sent once the
-/// first was consumed.
-///
-/// The `Receiver` returned implements the `Stream` trait and has access to any
-/// number of the associated combinators for transforming the result.
-pub fn channel<T, E>() -> (Sender<T, E>, Receiver<T, E>) {
-    let (tx, rx) = mpsc::channel(0);
-    (Sender { inner: tx }, Receiver { inner: rx })
-}
-
-/// The transmission end of a channel which is used to send values.
-///
-/// This is created by the `channel` method in the `stream` module.
-#[derive(Debug)]
-pub struct Sender<T, E> {
-    inner: mpsc::Sender<Result<T, E>>,
-}
-
-/// The receiving end of a channel which implements the `Stream` trait.
-///
-/// This is a concrete implementation of a stream which can be used to represent
-/// a stream of values being computed elsewhere. This is created by the
-/// `channel` method in the `stream` module.
-#[must_use = "streams do nothing unless polled"]
-#[derive(Debug)]
-pub struct Receiver<T, E> {
-    inner: mpsc::Receiver<Result<T, E>>,
-}
-
-/// Error type for sending, used when the receiving end of the channel is dropped
-pub struct SendError<T, E>(Result<T, E>);
-
-/// Future returned by `Sender::send`.
-#[derive(Debug)]
-pub struct FutureSender<T, E> {
-    inner: Send<mpsc::Sender<Result<T, E>>>,
-}
-
-impl<T, E> fmt::Debug for SendError<T, E> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-        fmt.debug_tuple("SendError")
-            .field(&"...")
-            .finish()
-    }
-}
-
-impl<T, E> fmt::Display for SendError<T, E> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-        write!(fmt, "send failed because receiver is gone")
-    }
-}
-
-impl<T, E> Error for SendError<T, E>
-    where T: Any, E: Any
-{
-    fn description(&self) -> &str {
-        "send failed because receiver is gone"
-    }
-}
-
-
-impl<T, E> Stream for Receiver<T, E> {
-    type Item = T;
-    type Error = E;
-
-    fn poll(&mut self) -> Poll<Option<T>, E> {
-        match self.inner.poll().expect("cannot fail") {
-            Async::Ready(Some(Ok(e))) => Ok(Async::Ready(Some(e))),
-            Async::Ready(Some(Err(e))) => Err(e),
-            Async::Ready(None) => Ok(Async::Ready(None)),
-            Async::NotReady => Ok(Async::NotReady),
-        }
-    }
-}
-
-impl<T, E> Sender<T, E> {
-    /// Sends a new value along this channel to the receiver.
-    ///
-    /// This method consumes the sender and returns a future which will resolve
-    /// to the sender again when the value sent has been consumed.
-    pub fn send(self, t: Result<T, E>) -> FutureSender<T, E> {
-        FutureSender { inner: self.inner.send(t) }
-    }
-}
-
-impl<T, E> Future for FutureSender<T, E> {
-    type Item = Sender<T, E>;
-    type Error = SendError<T, E>;
-
-    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
-        match self.inner.poll() {
-            Ok(a) => Ok(a.map(|a| Sender { inner: a })),
-            Err(e) => Err(SendError(e.into_inner())),
-        }
-    }
-}
diff --git a/src/stream/concat.rs b/src/stream/concat.rs
index aae5623e..164a50f7 100644
--- a/src/stream/concat.rs
+++ b/src/stream/concat.rs
@@ -11,62 +11,12 @@ use stream::Stream;
 ///
 /// This structure is produced by the `Stream::concat` method.
 #[must_use = "streams do nothing unless polled"]
-pub struct Concat2<S>
-    where S: Stream,
-{
-    inner: ConcatSafe<S>
-}
-
-impl<S: Debug> Debug for Concat2<S> where S: Stream, S::Item: Debug {
-    fn fmt(&self, fmt: &mut Formatter) -> FmtResult {
-        fmt.debug_struct("Concat2")
-            .field("inner", &self.inner)
-            .finish()
-    }
-}
-
-pub fn new2<S>(s: S) -> Concat2<S>
-    where S: Stream,
-          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
-{
-    Concat2 {
-        inner: new_safe(s)
-    }
-}
-
-impl<S> Future for Concat2<S>
-    where S: Stream,
-          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
-
-{
-    type Item = S::Item;
-    type Error = S::Error;
-
-    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
-        self.inner.poll().map(|a| {
-            match a {
-                Async::NotReady => Async::NotReady,
-                Async::Ready(None) => Async::Ready(Default::default()),
-                Async::Ready(Some(e)) => Async::Ready(e)
-            }
-        })
-    }
-}
-
-
-/// A stream combinator to concatenate the results of a stream into the first
-/// yielded item.
-///
-/// This structure is produced by the `Stream::concat` method.
-#[deprecated(since="0.1.18", note="please use `Stream::Concat2` instead")]
-#[must_use = "streams do nothing unless polled"]
 pub struct Concat<S>
     where S: Stream,
 {
     inner: ConcatSafe<S>
 }
 
-#[allow(deprecated)]
 impl<S: Debug> Debug for Concat<S> where S: Stream, S::Item: Debug {
     fn fmt(&self, fmt: &mut Formatter) -> FmtResult {
         fmt.debug_struct("Concat")
@@ -75,20 +25,18 @@ impl<S: Debug> Debug for Concat<S> where S: Stream, S::Item: Debug {
     }
 }
 
-#[allow(deprecated)]
 pub fn new<S>(s: S) -> Concat<S>
     where S: Stream,
-          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator,
+          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
 {
     Concat {
         inner: new_safe(s)
     }
 }
 
-#[allow(deprecated)]
 impl<S> Future for Concat<S>
     where S: Stream,
-          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator,
+          S::Item: Extend<<<S as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
 
 {
     type Item = S::Item;
@@ -98,7 +46,7 @@ impl<S> Future for Concat<S>
         self.inner.poll().map(|a| {
             match a {
                 Async::NotReady => Async::NotReady,
-                Async::Ready(None) => panic!("attempted concatenation of empty stream"),
+                Async::Ready(None) => Async::Ready(Default::default()),
                 Async::Ready(Some(e)) => Async::Ready(e)
             }
         })
@@ -169,4 +117,4 @@ enum Inner<E> {
     First,
     Extending(E),
     Done,
-}
\ No newline at end of file
+}
diff --git a/src/stream/iter.rs b/src/stream/iter.rs
deleted file mode 100644
index e0b93793..00000000
--- a/src/stream/iter.rs
+++ /dev/null
@@ -1,46 +0,0 @@
-#![deprecated(note = "implementation moved to `iter_ok` and `iter_result`")]
-#![allow(deprecated)]
-
-use Poll;
-use stream::{iter_result, IterResult, Stream};
-
-/// A stream which is just a shim over an underlying instance of `Iterator`.
-///
-/// This stream will never block and is always ready.
-#[derive(Debug)]
-#[must_use = "streams do nothing unless polled"]
-pub struct Iter<I>(IterResult<I>);
-
-/// Converts an `Iterator` over `Result`s into a `Stream` which is always ready
-/// to yield the next value.
-///
-/// Iterators in Rust don't express the ability to block, so this adapter simply
-/// always calls `iter.next()` and returns that.
-///
-/// ```rust
-/// use futures::*;
-///
-/// let mut stream = stream::iter(vec![Ok(17), Err(false), Ok(19)]);
-/// assert_eq!(Ok(Async::Ready(Some(17))), stream.poll());
-/// assert_eq!(Err(false), stream.poll());
-/// assert_eq!(Ok(Async::Ready(Some(19))), stream.poll());
-/// assert_eq!(Ok(Async::Ready(None)), stream.poll());
-/// ```
-#[inline]
-pub fn iter<J, T, E>(i: J) -> Iter<J::IntoIter>
-    where J: IntoIterator<Item=Result<T, E>>,
-{
-    Iter(iter_result(i))
-}
-
-impl<I, T, E> Stream for Iter<I>
-    where I: Iterator<Item=Result<T, E>>,
-{
-    type Item = T;
-    type Error = E;
-
-    #[inline]
-    fn poll(&mut self) -> Poll<Option<T>, E> {
-        self.0.poll()
-    }
-}
diff --git a/src/stream/merge.rs b/src/stream/merge.rs
deleted file mode 100644
index af7505e6..00000000
--- a/src/stream/merge.rs
+++ /dev/null
@@ -1,82 +0,0 @@
-#![deprecated(note = "functionality provided by `select` now")]
-#![allow(deprecated)]
-
-use {Poll, Async};
-use stream::{Stream, Fuse};
-
-/// An adapter for merging the output of two streams.
-///
-/// The merged stream produces items from one or both of the underlying
-/// streams as they become available. Errors, however, are not merged: you
-/// get at most one error at a time.
-#[derive(Debug)]
-#[must_use = "streams do nothing unless polled"]
-pub struct Merge<S1, S2: Stream> {
-    stream1: Fuse<S1>,
-    stream2: Fuse<S2>,
-    queued_error: Option<S2::Error>,
-}
-
-pub fn new<S1, S2>(stream1: S1, stream2: S2) -> Merge<S1, S2>
-    where S1: Stream, S2: Stream<Error = S1::Error>
-{
-    Merge {
-        stream1: stream1.fuse(),
-        stream2: stream2.fuse(),
-        queued_error: None,
-    }
-}
-
-/// An item returned from a merge stream, which represents an item from one or
-/// both of the underlying streams.
-#[derive(Debug)]
-pub enum MergedItem<I1, I2> {
-    /// An item from the first stream
-    First(I1),
-    /// An item from the second stream
-    Second(I2),
-    /// Items from both streams
-    Both(I1, I2),
-}
-
-impl<S1, S2> Stream for Merge<S1, S2>
-    where S1: Stream, S2: Stream<Error = S1::Error>
-{
-    type Item = MergedItem<S1::Item, S2::Item>;
-    type Error = S1::Error;
-
-    fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
-        if let Some(e) = self.queued_error.take() {
-            return Err(e)
-        }
-
-        match self.stream1.poll()? {
-            Async::NotReady => {
-                match try_ready!(self.stream2.poll()) {
-                    Some(item2) => Ok(Async::Ready(Some(MergedItem::Second(item2)))),
-                    None => Ok(Async::NotReady),
-                }
-            }
-            Async::Ready(None) => {
-                match try_ready!(self.stream2.poll()) {
-                    Some(item2) => Ok(Async::Ready(Some(MergedItem::Second(item2)))),
-                    None => Ok(Async::Ready(None)),
-                }
-            }
-            Async::Ready(Some(item1)) => {
-                match self.stream2.poll() {
-                    Err(e) => {
-                        self.queued_error = Some(e);
-                        Ok(Async::Ready(Some(MergedItem::First(item1))))
-                    }
-                    Ok(Async::NotReady) | Ok(Async::Ready(None)) => {
-                        Ok(Async::Ready(Some(MergedItem::First(item1))))
-                    }
-                    Ok(Async::Ready(Some(item2))) => {
-                        Ok(Async::Ready(Some(MergedItem::Both(item1, item2))))
-                    }
-                }
-            }
-        }
-    }
-}
diff --git a/src/stream/mod.rs b/src/stream/mod.rs
index 7ef18094..3a53a12f 100644
--- a/src/stream/mod.rs
+++ b/src/stream/mod.rs
@@ -17,12 +17,6 @@
 
 use {IntoFuture, Poll};
 
-mod iter;
-#[allow(deprecated)]
-pub use self::iter::{iter, Iter};
-#[cfg(feature = "with-deprecated")]
-#[allow(deprecated)]
-pub use self::Iter as IterStream;
 mod iter_ok;
 pub use self::iter_ok::{iter_ok, IterOk};
 mod iter_result;
@@ -47,7 +41,6 @@ mod inspect;
 mod inspect_err;
 mod map;
 mod map_err;
-mod merge;
 mod once;
 mod or_else;
 mod peek;
@@ -63,9 +56,7 @@ mod zip;
 mod forward;
 pub use self::and_then::AndThen;
 pub use self::chain::Chain;
-#[allow(deprecated)]
 pub use self::concat::Concat;
-pub use self::concat::Concat2;
 pub use self::empty::{Empty, empty};
 pub use self::filter::Filter;
 pub use self::filter_map::FilterMap;
@@ -79,8 +70,6 @@ pub use self::inspect::Inspect;
 pub use self::inspect_err::InspectErr;
 pub use self::map::Map;
 pub use self::map_err::MapErr;
-#[allow(deprecated)]
-pub use self::merge::{Merge, MergedItem};
 pub use self::once::{Once, once};
 pub use self::or_else::OrElse;
 pub use self::peek::Peekable;
@@ -105,7 +94,6 @@ if_std! {
     mod chunks;
     mod collect;
     mod wait;
-    mod channel;
     mod split;
     pub mod futures_unordered;
     mod futures_ordered;
@@ -119,18 +107,6 @@ if_std! {
     pub use self::futures_unordered::FuturesUnordered;
     pub use self::futures_ordered::{futures_ordered, FuturesOrdered};
 
-    #[doc(hidden)]
-    #[cfg(feature = "with-deprecated")]
-    #[allow(deprecated)]
-    pub use self::channel::{channel, Sender, Receiver, FutureSender, SendError};
-
-    /// A type alias for `Box<Stream + Send>`
-    #[doc(hidden)]
-    #[deprecated(note = "removed without replacement, recommended to use a \
-                         local extension trait or function if needed, more \
-                         details in https://github.com/alexcrichton/futures-rs/issues/228")]
-    pub type BoxStream<T, E> = ::std::boxed::Box<Stream<Item = T, Error = E> + Send>;
-
     impl<S: ?Sized + Stream> Stream for ::std::boxed::Box<S> {
         type Item = S::Item;
         type Error = S::Error;
@@ -233,52 +209,20 @@ pub trait Stream {
     /// >           blocking work associated with this stream will be completed
     /// >           by another thread.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Panics
     ///
     /// The returned iterator does not attempt to catch panics. If the `poll`
     /// function panics, panics will be propagated to the caller of `next`.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn wait(self) -> Wait<Self>
         where Self: Sized
     {
         wait::new(self)
     }
 
-    /// Convenience function for turning this stream into a trait object.
-    ///
-    /// This simply avoids the need to write `Box::new` and can often help with
-    /// type inference as well by always returning a trait object. Note that
-    /// this method requires the `Send` bound and returns a `BoxStream`, which
-    /// also encodes this. If you'd like to create a `Box<Stream>` without the
-    /// `Send` bound, then the `Box::new` function can be used instead.
-    ///
-    /// This method is only available when the `use_std` feature of this
-    /// library is activated, and it is activated by default.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use futures::stream::*;
-    /// use futures::sync::mpsc;
-    ///
-    /// let (_tx, rx) = mpsc::channel(1);
-    /// let a: BoxStream<i32, ()> = rx.boxed();
-    /// ```
-    #[cfg(feature = "use_std")]
-    #[doc(hidden)]
-    #[deprecated(note = "removed without replacement, recommended to use a \
-                         local extension trait or function if needed, more \
-                         details in https://github.com/alexcrichton/futures-rs/issues/228")]
-    #[allow(deprecated)]
-    fn boxed(self) -> BoxStream<Self::Item, Self::Error>
-        where Self: Sized + Send + 'static,
-    {
-        ::std::boxed::Box::new(self)
-    }
-
     /// Converts this stream into a `Future`.
     ///
     /// A stream can be viewed as a future which will resolve to a pair containing
@@ -543,7 +487,7 @@ pub trait Stream {
     /// The returned future will be resolved whenever an error happens or when
     /// the stream returns `Ok(None)`.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Examples
@@ -565,7 +509,7 @@ pub trait Stream {
     /// let mut result = rx.collect();
     /// assert_eq!(result.wait(), Ok(vec![5, 4, 3, 2, 1]));
     /// ```
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn collect(self) -> Collect<Self>
         where Self: Sized
     {
@@ -580,42 +524,6 @@ pub trait Stream {
     /// empty, the default value will be returned. If an error occurs,
     /// all the results will be dropped and the error will be returned.
     ///
-    /// The name `concat2` is an intermediate measure until the release of
-    /// futures 0.2, at which point it will be renamed back to `concat`.
-    ///
-    /// # Examples
-    ///
-    /// ```
-    /// use std::thread;
-    ///
-    /// use futures::prelude::*;
-    /// use futures::sync::mpsc;
-    ///
-    /// let (mut tx, rx) = mpsc::channel(1);
-    ///
-    /// thread::spawn(move || {
-    ///     for i in (0..3).rev() {
-    ///         let n = i * 3;
-    ///         tx = tx.send(vec![n + 1, n + 2, n + 3]).wait().unwrap();
-    ///     }
-    /// });
-    /// let result = rx.concat2();
-    /// assert_eq!(result.wait(), Ok(vec![7, 8, 9, 4, 5, 6, 1, 2, 3]));
-    /// ```
-    fn concat2(self) -> Concat2<Self>
-        where Self: Sized,
-              Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
-    {
-        concat::new2(self)
-    }
-
-    /// Concatenate all results of a stream into a single extendable
-    /// destination, returning a future representing the end result.
-    ///
-    /// This combinator will extend the first item with the contents
-    /// of all the successful results of the stream. If an error occurs,
-    /// all the results will be dropped and the error will be returned.
-    ///
     /// # Examples
     ///
     /// ```
@@ -635,16 +543,9 @@ pub trait Stream {
     /// let result = rx.concat();
     /// assert_eq!(result.wait(), Ok(vec![7, 8, 9, 4, 5, 6, 1, 2, 3]));
     /// ```
-    ///
-    /// # Panics
-    ///
-    /// It's important to note that this function will panic if the stream
-    /// is empty, which is the reason for its deprecation.
-    #[deprecated(since="0.1.14", note="please use `Stream::concat2` instead")]
-    #[allow(deprecated)]
     fn concat(self) -> Concat<Self>
         where Self: Sized,
-              Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator,
+              Self::Item: Extend<<<Self as Stream>::Item as IntoIterator>::Item> + IntoIterator + Default,
     {
         concat::new(self)
     }
@@ -882,7 +783,7 @@ pub trait Stream {
     /// after-the fact. To assist using this method, the `Stream` trait is also
     /// implemented for `AssertUnwindSafe<S>` where `S` implements `Stream`.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Examples
@@ -900,7 +801,7 @@ pub trait Stream {
     /// assert!(iter.next().unwrap().is_err());
     /// assert!(iter.next().is_none());
     /// ```
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn catch_unwind(self) -> CatchUnwind<Self>
         where Self: Sized + std::panic::UnwindSafe
     {
@@ -918,9 +819,9 @@ pub trait Stream {
     /// The returned stream will be a stream of each future's result, with
     /// errors passed through whenever they occur.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn buffered(self, amt: usize) -> Buffered<Self>
         where Self::Item: IntoFuture<Error = <Self as Stream>::Error>,
               Self: Sized
@@ -939,9 +840,9 @@ pub trait Stream {
     /// The returned stream will be a stream of each future's result, with
     /// errors passed through whenever they occur.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn buffer_unordered(self, amt: usize) -> BufferUnordered<Self>
         where Self::Item: IntoFuture<Error = <Self as Stream>::Error>,
               Self: Sized
@@ -949,20 +850,6 @@ pub trait Stream {
         buffer_unordered::new(self, amt)
     }
 
-    /// An adapter for merging the output of two streams.
-    ///
-    /// The merged stream produces items from one or both of the underlying
-    /// streams as they become available. Errors, however, are not merged: you
-    /// get at most one error at a time.
-    #[deprecated(note = "functionality provided by `select` now")]
-    #[allow(deprecated)]
-    fn merge<S>(self, other: S) -> Merge<Self, S>
-        where S: Stream<Error = Self::Error>,
-              Self: Sized,
-    {
-        merge::new(self, other)
-    }
-
     /// An adapter for zipping two streams together.
     ///
     /// The zipped stream waits for both streams to produce an item, and then
@@ -1024,13 +911,13 @@ pub trait Stream {
     ///
     /// Errors are passed through the stream unbuffered.
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
     ///
     /// # Panics
     ///
     /// This method will panic of `capacity` is zero.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn chunks(self, capacity: usize) -> Chunks<Self>
         where Self: Sized
     {
@@ -1084,9 +971,9 @@ pub trait Stream {
     /// allow direct interaction between the two objects (e.g. via
     /// `Sink::send_all`).
     ///
-    /// This method is only available when the `use_std` feature of this
+    /// This method is only available when the `std` feature of this
     /// library is activated, and it is activated by default.
-    #[cfg(feature = "use_std")]
+    #[cfg(feature = "std")]
     fn split(self) -> (SplitSink<Self>, SplitStream<Self>)
         where Self: super::sink::Sink + Sized
     {
@@ -1137,7 +1024,7 @@ impl<'a, S: ?Sized + Stream> Stream for &'a mut S {
 ///
 /// Note that the returned set can also be used to dynamically push more
 /// futures into the set as they become available.
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 pub fn futures_unordered<I>(futures: I) -> FuturesUnordered<<I::Item as IntoFuture>::Future>
     where I: IntoIterator,
         I::Item: IntoFuture
diff --git a/src/sync/mpsc/mod.rs b/src/sync/mpsc/mod.rs
index 71875796..63a17f8c 100644
--- a/src/sync/mpsc/mod.rs
+++ b/src/sync/mpsc/mod.rs
@@ -658,17 +658,6 @@ impl<T> Sink for Sender<T> {
 }
 
 impl<T> UnboundedSender<T> {
-    /// Sends the provided message along this channel.
-    ///
-    /// This is an unbounded sender, so this function differs from `Sink::send`
-    /// by ensuring the return type reflects that the channel is always ready to
-    /// receive messages.
-    #[deprecated(note = "renamed to `unbounded_send`")]
-    #[doc(hidden)]
-    pub fn send(&self, msg: T) -> Result<(), SendError<T>> {
-        self.unbounded_send(msg)
-    }
-
     /// Sends the provided message along this channel.
     ///
     /// This is an unbounded sender, so this function differs from `Sink::send`
diff --git a/src/sync/oneshot.rs b/src/sync/oneshot.rs
index d95883d3..9542bdcc 100644
--- a/src/sync/oneshot.rs
+++ b/src/sync/oneshot.rs
@@ -303,13 +303,6 @@ impl<T> Inner<T> {
 }
 
 impl<T> Sender<T> {
-    #[deprecated(note = "renamed to `send`", since = "0.1.11")]
-    #[doc(hidden)]
-    #[cfg(feature = "with-deprecated")]
-    pub fn complete(self, t: T) {
-        drop(self.send(t));
-    }
-
     /// Completes this oneshot with a successful result.
     ///
     /// This function will consume `self` and indicate to the other end, the
diff --git a/src/task.rs b/src/task.rs
index 941f227d..e89a1391 100644
--- a/src/task.rs
+++ b/src/task.rs
@@ -26,21 +26,7 @@
 //! `current` function returns a handle to the currently running task, panicking
 //! if one isn't present. This handle is then used to later notify the task that
 //! it's ready to make progress through the `Task::notify` method.
-
-#[doc(hidden)]
-#[deprecated(since = "0.1.4", note = "import through the executor module instead")]
-#[cfg(all(feature = "with-deprecated", feature = "use_std"))]
-#[allow(deprecated)]
-pub use task_impl::{Spawn, spawn, Unpark, Executor, Run, park};
-
 pub use task_impl::{Task, AtomicTask, current, init};
 
-#[allow(deprecated)]
-#[cfg(feature = "use_std")]
-pub use task_impl::{LocalKey, with_unpark_event, UnparkEvent, EventSet};
-
-#[doc(hidden)]
-#[deprecated(since = "0.1.4", note = "import through the executor module instead")]
-#[cfg(all(feature = "with-deprecated", feature = "use_std"))]
-#[allow(deprecated)]
-pub use task_impl::TaskRc;
+#[cfg(feature = "std")]
+pub use task_impl::LocalKey;
diff --git a/src/task_impl/core.rs b/src/task_impl/core.rs
index 9a77a2ae..bb4b78be 100644
--- a/src/task_impl/core.rs
+++ b/src/task_impl/core.rs
@@ -1,4 +1,4 @@
-#![cfg_attr(feature = "use_std", allow(dead_code))]
+#![cfg_attr(feature = "std", allow(dead_code))]
 
 use core::marker;
 use core::mem;
@@ -144,7 +144,7 @@ pub fn get_ptr() -> Option<*mut u8> {
     }
 }
 
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 #[inline]
 pub fn is_get_ptr(f: usize) -> bool {
     GET.load(Relaxed) == f
diff --git a/src/task_impl/mod.rs b/src/task_impl/mod.rs
index 13217345..331a3322 100644
--- a/src/task_impl/mod.rs
+++ b/src/task_impl/mod.rs
@@ -8,36 +8,19 @@ pub use self::atomic_task::AtomicTask;
 
 mod core;
 
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 mod std;
-#[cfg(feature = "use_std")]
+#[cfg(feature = "std")]
 pub use self::std::*;
-#[cfg(not(feature = "use_std"))]
+#[cfg(not(feature = "std"))]
 pub use self::core::*;
 
 pub struct BorrowedTask<'a> {
-    id: usize,
     unpark: BorrowedUnpark<'a>,
-    events: BorrowedEvents<'a>,
     // Task-local storage
     map: &'a LocalMap,
 }
 
-fn fresh_task_id() -> usize {
-    use core::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
-
-    // TODO: this assert is a real bummer, need to figure out how to reuse
-    //       old IDs that are no longer in use.
-    //
-    // Note, though, that it is intended that these ids go away entirely
-    // eventually, see the comment on `is_current` below.
-    static NEXT_ID: AtomicUsize = ATOMIC_USIZE_INIT;
-    let id = NEXT_ID.fetch_add(1, Ordering::Relaxed);
-    assert!(id < usize::max_value() / 2,
-            "too many previous tasks have been allocated");
-    id
-}
-
 fn with<F: FnOnce(&BorrowedTask) -> R, R>(f: F) -> R {
     unsafe {
         let task = get_ptr().expect("no Task is currently running");
@@ -56,9 +39,7 @@ fn with<F: FnOnce(&BorrowedTask) -> R, R>(f: F) -> R {
 /// This is obtained by the `task::current` function.
 #[derive(Clone)]
 pub struct Task {
-    id: usize,
     unpark: TaskUnpark,
-    events: UnparkEvents,
 }
 
 trait AssertSend: Send {}
@@ -89,22 +70,13 @@ impl AssertSend for Task {}
 pub fn current() -> Task {
     with(|borrowed| {
         let unpark = borrowed.unpark.to_owned();
-        let events = borrowed.events.to_owned();
 
         Task {
-            id: borrowed.id,
             unpark: unpark,
-            events: events,
         }
     })
 }
 
-#[doc(hidden)]
-#[deprecated(note = "renamed to `current`")]
-pub fn park() -> Task {
-    current()
-}
-
 impl Task {
     /// Indicate that the task should attempt to poll its future in a timely
     /// fashion.
@@ -115,57 +87,9 @@ impl Task {
     /// must poll the future *again* afterwards, ensuring that all relevant
     /// events are eventually observed by the future.
     pub fn notify(&self) {
-        self.events.notify();
         self.unpark.notify();
     }
 
-    #[doc(hidden)]
-    #[deprecated(note = "renamed to `notify`")]
-    pub fn unpark(&self) {
-        self.notify()
-    }
-
-    /// Returns `true` when called from within the context of the task.
-    ///
-    /// In other words, the task is currently running on the thread calling the
-    /// function. Note that this is currently, and has historically, been
-    /// implemented by tracking an `id` on every instance of `Spawn` created.
-    /// When a `Spawn` is being polled it stores in thread-local-storage the id
-    /// of the instance, and then `task::current` will return a `Task` that also
-    /// stores this id.
-    ///
-    /// The intention of this function was to answer questions like "if I
-    /// `notify` this task, is it equivalent to `task::current().notify()`?"
-    /// The answer "yes" may be able to avoid some extra work to block the
-    /// current task, such as sending a task along a channel or updating a
-    /// stored `Task` somewhere. An answer of "no" typically results in doing
-    /// the work anyway.
-    ///
-    /// Unfortunately this function has been somewhat buggy in the past and is
-    /// not intended to be supported in the future. By simply matching `id` the
-    /// intended question above isn't accurately taking into account, for
-    /// example, unpark events (now deprecated, but still a feature). Thus many
-    /// old users of this API weren't fully accounting for the question it was
-    /// intended they were asking.
-    ///
-    /// This API continues to be implemented but will in the future, e.g. in the
-    /// 0.1.x series of this crate, eventually return `false` unconditionally.
-    /// It is intended that this function will be removed in the next breaking
-    /// change of this crate. If you'd like to continue to be able to answer the
-    /// example question above, it's recommended you use the
-    /// `will_notify_current` method.
-    ///
-    /// If you've got questions about this though please let us know! We'd like
-    /// to learn about other use cases here that we did not consider.
-    ///
-    /// # Panics
-    ///
-    /// This function will panic if no current future is being polled.
-    #[deprecated(note = "intended to be removed, see docs for details")]
-    pub fn is_current(&self) -> bool {
-        with(|current| current.id == self.id)
-    }
-
     /// This function is intended as a performance optimization for structures
     /// which store a `Task` internally.
     ///
@@ -187,8 +111,7 @@ impl Task {
     #[allow(deprecated)]
     pub fn will_notify_current(&self) -> bool {
         with(|current| {
-            self.unpark.will_notify(&current.unpark) &&
-                self.events.will_notify(&current.events)
+            self.unpark.will_notify(&current.unpark)
         })
     }
 }
@@ -211,7 +134,6 @@ impl fmt::Debug for Task {
 /// with either futures or streams, with different methods being available on
 /// `Spawn` depending which is used.
 pub struct Spawn<T: ?Sized> {
-    id: usize,
     data: LocalMap,
     obj: T,
 }
@@ -228,7 +150,6 @@ pub struct Spawn<T: ?Sized> {
 /// until the methods on `Spawn` are called in turn.
 pub fn spawn<T>(obj: T) -> Spawn<T> {
     Spawn {
-        id: fresh_task_id(),
         obj: obj,
         data: local_map(),
     }
@@ -354,9 +275,7 @@ impl<T: ?Sized> Spawn<T> {
         where F: FnOnce(&mut T) -> R
     {
         let borrowed = BorrowedTask {
-            id: self.id,
             unpark: unpark,
-            events: BorrowedEvents::new(),
             map: &self.data,
         };
         let obj = &mut self.obj;
@@ -471,9 +390,7 @@ pub fn with_notify<F, T, R>(notify: &T, id: usize, f: F) -> R
     with(|task| {
         let mk = || notify.clone().into();
         let new_task = BorrowedTask {
-            id: task.id,
             unpark: BorrowedUnpark::new(&mk, id),
-            events: task.events,
             map: task.map,
         };
 
@@ -508,7 +425,7 @@ pub fn with_notify<F, T, R>(notify: &T, id: usize, f: F) -> R
 /// of memory management, allowing external implementations.
 ///
 /// A default implementation of the `UnsafeNotify` trait is provided for the
-/// `Arc` type in the standard library. If the `use_std` feature of this crate
+/// `Arc` type in the standard library. If the `std` feature of this crate
 /// is not available however, you'll be required to implement your own
 /// instance of this trait to pass it into `NotifyHandle::new`.
 ///
diff --git a/src/task_impl/std/mod.rs b/src/task_impl/std/mod.rs
index 2472c812..b051b49a 100644
--- a/src/task_impl/std/mod.rs
+++ b/src/task_impl/std/mod.rs
@@ -8,9 +8,10 @@ use std::ptr;
 use std::sync::{Arc, Mutex, Condvar, Once, ONCE_INIT};
 use std::sync::atomic::{AtomicUsize, Ordering};
 
-use {Future, Stream, Sink, Poll, Async, StartSend, AsyncSink};
+use {Future, Stream, Sink, Async, AsyncSink};
 use super::core;
 use super::{BorrowedTask, NotifyHandle, Spawn, spawn, Notify, UnsafeNotify};
+pub use super::core::{BorrowedUnpark, TaskUnpark};
 
 mod unpark_mutex;
 pub use self::unpark_mutex::UnparkMutex;
@@ -18,11 +19,6 @@ pub use self::unpark_mutex::UnparkMutex;
 mod data;
 pub use self::data::*;
 
-mod task_rc;
-#[allow(deprecated)]
-#[cfg(feature = "with-deprecated")]
-pub use self::task_rc::TaskRc;
-
 pub use task_impl::core::init;
 
 thread_local!(static CURRENT_TASK: Cell<*mut u8> = Cell::new(ptr::null_mut()));
@@ -82,154 +78,7 @@ pub fn set<'a, F, R>(task: &BorrowedTask<'a>, f: F) -> R
     }
 }
 
-#[derive(Copy, Clone)]
-#[allow(deprecated)]
-pub enum BorrowedUnpark<'a> {
-    Old(&'a Arc<Unpark>),
-    New(core::BorrowedUnpark<'a>),
-}
-
-#[derive(Copy, Clone)]
-#[allow(deprecated)]
-pub enum BorrowedEvents<'a> {
-    None,
-    One(&'a UnparkEvent, &'a BorrowedEvents<'a>),
-}
-
-#[derive(Clone)]
-pub enum TaskUnpark {
-    #[allow(deprecated)]
-    Old(Arc<Unpark>),
-    New(core::TaskUnpark),
-}
-
-#[derive(Clone)]
-#[allow(deprecated)]
-pub enum UnparkEvents {
-    None,
-    One(UnparkEvent),
-    Many(Box<[UnparkEvent]>),
-}
-
-impl<'a> BorrowedUnpark<'a> {
-    #[inline]
-    pub fn new(f: &'a Fn() -> NotifyHandle, id: usize) -> BorrowedUnpark<'a> {
-        BorrowedUnpark::New(core::BorrowedUnpark::new(f, id))
-    }
-
-    #[inline]
-    pub fn to_owned(&self) -> TaskUnpark {
-        match *self {
-            BorrowedUnpark::Old(old) => TaskUnpark::Old(old.clone()),
-            BorrowedUnpark::New(new) => TaskUnpark::New(new.to_owned()),
-        }
-    }
-}
-
-impl<'a> BorrowedEvents<'a> {
-    #[inline]
-    pub fn new() -> BorrowedEvents<'a> {
-        BorrowedEvents::None
-    }
-
-    #[inline]
-    pub fn to_owned(&self) -> UnparkEvents {
-        let mut one_event = None;
-        let mut list = Vec::new();
-        let mut cur = self;
-        while let BorrowedEvents::One(event, next) = *cur {
-            let event = event.clone();
-            match one_event.take() {
-                None if list.len() == 0 => one_event = Some(event),
-                None => list.push(event),
-                Some(event2) =>  {
-                    list.push(event2);
-                    list.push(event);
-                }
-            }
-            cur = next;
-        }
-
-        match one_event {
-            None if list.len() == 0 => UnparkEvents::None,
-            None => UnparkEvents::Many(list.into_boxed_slice()),
-            Some(e) => UnparkEvents::One(e),
-        }
-    }
-}
-
-impl UnparkEvents {
-    pub fn notify(&self) {
-        match *self {
-            UnparkEvents::None => {}
-            UnparkEvents::One(ref e) => e.unpark(),
-            UnparkEvents::Many(ref list) => {
-                for event in list.iter() {
-                    event.unpark();
-                }
-            }
-        }
-    }
-
-    pub fn will_notify(&self, events: &BorrowedEvents) -> bool {
-        // Pessimistically assume that any unpark events mean that we're not
-        // equivalent to the current task.
-        match *self {
-            UnparkEvents::None => {}
-            _ => return false,
-        }
-
-        match *events {
-            BorrowedEvents::None => return true,
-            _ => {},
-        }
-
-        return false
-    }
-}
-
-#[allow(deprecated)]
-impl TaskUnpark {
-    pub fn notify(&self) {
-        match *self {
-            TaskUnpark::Old(ref old) => old.unpark(),
-            TaskUnpark::New(ref new) => new.notify(),
-        }
-    }
-
-    pub fn will_notify(&self, unpark: &BorrowedUnpark) -> bool {
-        match (unpark, self) {
-            (&BorrowedUnpark::Old(old1), &TaskUnpark::Old(ref old2)) => {
-                &**old1 as *const Unpark == &**old2 as *const Unpark
-            }
-            (&BorrowedUnpark::New(ref new1), &TaskUnpark::New(ref new2)) => {
-                new2.will_notify(new1)
-            }
-            _ => false,
-        }
-    }
-}
-
 impl<F: Future> Spawn<F> {
-    /// Polls the internal future, scheduling notifications to be sent to the
-    /// `unpark` argument.
-    ///
-    /// This method will poll the internal future, testing if it's completed
-    /// yet. The `unpark` argument is used as a sink for notifications sent to
-    /// this future. That is, while the future is being polled, any call to
-    /// `task::park()` will return a handle that contains the `unpark`
-    /// specified.
-    ///
-    /// If this function returns `NotReady`, then the `unpark` should have been
-    /// scheduled to receive a notification when poll can be called again.
-    /// Otherwise if `Ready` or `Err` is returned, the `Spawn` task can be
-    /// safely destroyed.
-    #[deprecated(note = "recommended to use `poll_future_notify` instead")]
-    #[allow(deprecated)]
-    pub fn poll_future(&mut self, unpark: Arc<Unpark>) -> Poll<F::Item, F::Error> {
-        self.enter(BorrowedUnpark::Old(&unpark), |f| f.poll())
-    }
-
     /// Waits for the internal future to complete, blocking this thread's
     /// execution until it does.
     ///
@@ -285,14 +134,6 @@ impl<F: Future> Spawn<F> {
 }
 
 impl<S: Stream> Spawn<S> {
-    /// Like `poll_future`, except polls the underlying stream.
-    #[deprecated(note = "recommended to use `poll_stream_notify` instead")]
-    #[allow(deprecated)]
-    pub fn poll_stream(&mut self, unpark: Arc<Unpark>)
-                       -> Poll<Option<S::Item>, S::Error> {
-        self.enter(BorrowedUnpark::Old(&unpark), |s| s.poll())
-    }
-
     /// Like `wait_future`, except only waits for the next element to arrive on
     /// the underlying stream.
     pub fn wait_stream(&mut self) -> Option<Result<S::Item, S::Error>> {
@@ -311,30 +152,6 @@ impl<S: Stream> Spawn<S> {
 }
 
 impl<S: Sink> Spawn<S> {
-    /// Invokes the underlying `start_send` method with this task in place.
-    ///
-    /// If the underlying operation returns `NotReady` then the `unpark` value
-    /// passed in will receive a notification when the operation is ready to be
-    /// attempted again.
-    #[deprecated(note = "recommended to use `start_send_notify` instead")]
-    #[allow(deprecated)]
-    pub fn start_send(&mut self, value: S::SinkItem, unpark: &Arc<Unpark>)
-                       -> StartSend<S::SinkItem, S::SinkError> {
-        self.enter(BorrowedUnpark::Old(unpark), |s| s.start_send(value))
-    }
-
-    /// Invokes the underlying `poll_complete` method with this task in place.
-    ///
-    /// If the underlying operation returns `NotReady` then the `unpark` value
-    /// passed in will receive a notification when the operation is ready to be
-    /// attempted again.
-    #[deprecated(note = "recommended to use `poll_flush_notify` instead")]
-    #[allow(deprecated)]
-    pub fn poll_flush(&mut self, unpark: &Arc<Unpark>)
-                       -> Poll<(), S::SinkError> {
-        self.enter(BorrowedUnpark::Old(unpark), |s| s.poll_complete())
-    }
-
     /// Blocks the current thread until it's able to send `value` on this sink.
     ///
     /// This function will send the `value` on the sink that this task wraps. If
@@ -392,23 +209,6 @@ impl<S: Sink> Spawn<S> {
     }
 }
 
-/// A trait which represents a sink of notifications that a future is ready to
-/// make progress.
-///
-/// This trait is provided as an argument to the `Spawn::poll_future` and
-/// `Spawn::poll_stream` functions. It's transitively used as part of the
-/// `Task::unpark` method to internally deliver notifications of readiness of a
-/// future to move forward.
-#[deprecated(note = "recommended to use `Notify` instead")]
-pub trait Unpark: Send + Sync {
-    /// Indicates that an associated future and/or task are ready to make
-    /// progress.
-    ///
-    /// Typically this means that the receiver of the notification should
-    /// arrange for the future to get poll'd in a prompt fashion.
-    fn unpark(&self);
-}
-
 /// A trait representing requests to poll futures.
 ///
 /// This trait is an argument to the `Spawn::execute` which is used to run a
@@ -567,88 +367,6 @@ impl Notify for ThreadNotify {
     }
 }
 
-// ===== UnparkEvent =====
-
-/// For the duration of the given callback, add an "unpark event" to be
-/// triggered when the task handle is used to unpark the task.
-///
-/// Unpark events are used to pass information about what event caused a task to
-/// be unparked. In some cases, tasks are waiting on a large number of possible
-/// events, and need precise information about the wakeup to avoid extraneous
-/// polling.
-///
-/// Every `Task` handle comes with a set of unpark events which will fire when
-/// `unpark` is called. When fired, these events insert an identifier into a
-/// concurrent set, which the task can read from to determine what events
-/// occurred.
-///
-/// This function immediately invokes the closure, `f`, but arranges things so
-/// that `task::park` will produce a `Task` handle that includes the given
-/// unpark event.
-///
-/// # Panics
-///
-/// This function will panic if a task is not currently being executed. That
-/// is, this method can be dangerous to call outside of an implementation of
-/// `poll`.
-#[deprecated(note = "recommended to use `FuturesUnordered` instead")]
-#[allow(deprecated)]
-pub fn with_unpark_event<F, R>(event: UnparkEvent, f: F) -> R
-    where F: FnOnce() -> R
-{
-    super::with(|task| {
-        let new_task = BorrowedTask {
-            id: task.id,
-            unpark: task.unpark,
-            events: BorrowedEvents::One(&event, &task.events),
-            map: task.map,
-        };
-
-        super::set(&new_task, f)
-    })
-}
-
-/// A set insertion to trigger upon `unpark`.
-///
-/// Unpark events are used to communicate information about *why* an unpark
-/// occurred, in particular populating sets with event identifiers so that the
-/// unparked task can avoid extraneous polling. See `with_unpark_event` for
-/// more.
-#[derive(Clone)]
-#[deprecated(note = "recommended to use `FuturesUnordered` instead")]
-#[allow(deprecated)]
-pub struct UnparkEvent {
-    set: Arc<EventSet>,
-    item: usize,
-}
-
-#[allow(deprecated)]
-impl UnparkEvent {
-    /// Construct an unpark event that will insert `id` into `set` when
-    /// triggered.
-    #[deprecated(note = "recommended to use `FuturesUnordered` instead")]
-    pub fn new(set: Arc<EventSet>, id: usize) -> UnparkEvent {
-        UnparkEvent {
-            set: set,
-            item: id,
-        }
-    }
-
-    fn unpark(&self) {
-        self.set.insert(self.item);
-    }
-}
-
-#[allow(deprecated)]
-impl fmt::Debug for UnparkEvent {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_struct("UnparkEvent")
-         .field("set", &"...")
-         .field("item", &self.item)
-         .finish()
-    }
-}
-
 /// A concurrent set which allows for the insertion of `usize` values.
 ///
 /// `EventSet`s are used to communicate precise information about the event(s)
diff --git a/src/task_impl/std/task_rc.rs b/src/task_impl/std/task_rc.rs
deleted file mode 100644
index 51bb4487..00000000
--- a/src/task_impl/std/task_rc.rs
+++ /dev/null
@@ -1,129 +0,0 @@
-#![cfg(feature = "with-deprecated")]
-#![allow(deprecated)]
-#![deprecated(since = "0.1.4",
-              note = "replaced with `BiLock` in many cases, otherwise slated \
-                      for removal due to confusion")]
-
-use std::prelude::v1::*;
-use std::sync::Arc;
-use std::cell::UnsafeCell;
-use task_impl;
-
-// One critical piece of this module's contents are the `TaskRc<A>` handles.
-// The purpose of this is to conceptually be able to store data in a task,
-// allowing it to be accessed within multiple futures at once. For example if
-// you have some concurrent futures working, they may all want mutable access to
-// some data. We already know that when the futures are being poll'd that we're
-// entirely synchronized (aka `&mut Task`), so you shouldn't require an
-// `Arc<Mutex<T>>` to share as the synchronization isn't necessary!
-//
-// So the idea here is that you insert data into a task via `Task::insert`, and
-// a handle to that data is then returned to you. That handle can later get
-// presented to the task itself to actually retrieve the underlying data. The
-// invariant is that the data can only ever be accessed with the task present,
-// and the lifetime of the actual data returned is connected to the lifetime of
-// the task itself.
-//
-// Conceptually I at least like to think of this as "dynamically adding more
-// struct fields to a `Task`". Each call to insert creates a new "name" for the
-// struct field, a `TaskRc<A>`, and then you can access the fields of a struct
-// with the struct itself (`Task`) as well as the name of the field
-// (`TaskRc<A>`). If that analogy doesn't make sense then oh well, it at least
-// helped me!
-//
-// So anyway, we do some interesting trickery here to actually get it to work.
-// Each `TaskRc<A>` handle stores `Arc<UnsafeCell<A>>`. So it turns out, we're
-// not even adding data to the `Task`! Each `TaskRc<A>` contains a reference
-// to this `Arc`, and `TaskRc` handles can be cloned which just bumps the
-// reference count on the `Arc` itself.
-//
-// As before, though, you can present the `Arc` to a `Task` and if they
-// originated from the same place you're allowed safe access to the internals.
-// We allow but shared and mutable access without the `Sync` bound on the data,
-// crucially noting that a `Task` itself is not `Sync`.
-//
-// So hopefully I've convinced you of this point that the `get` and `get_mut`
-// methods below are indeed safe. The data is always valid as it's stored in an
-// `Arc`, and access is only allowed with the proof of the associated `Task`.
-// One thing you might be asking yourself though is what exactly is this "proof
-// of a task"? Right now it's a `usize` corresponding to the `Task`'s
-// `TaskHandle` arc allocation.
-//
-// Wait a minute, isn't that the ABA problem! That is, we create a task A, add
-// some data to it, destroy task A, do some work, create a task B, and then ask
-// to get the data from task B. In this case though the point of the
-// `task_inner` "proof" field is simply that there's some non-`Sync` token
-// proving that you can get access to the data. So while weird, this case should
-// still be safe, as the data's not stored in the task itself.
-
-/// A reference to a piece of data that's accessible only within a specific
-/// `Task`.
-///
-/// This data is `Send` even when `A` is not `Sync`, because the data stored
-/// within is accessed in a single-threaded way. The thread accessing it may
-/// change over time, if the task migrates, so `A` must be `Send`.
-#[derive(Debug)]
-pub struct TaskRc<A> {
-    task: task_impl::Task,
-    ptr: Arc<UnsafeCell<A>>,
-}
-
-// for safety here, see docs at the top of this module
-unsafe impl<A: Send> Send for TaskRc<A> {}
-unsafe impl<A: Sync> Sync for TaskRc<A> {}
-
-impl<A> TaskRc<A> {
-    /// Inserts a new piece of task-local data into this task, returning a
-    /// reference to it.
-    ///
-    /// Ownership of the data will be transferred to the task, and the data will
-    /// be destroyed when the task itself is destroyed. The returned value can
-    /// be passed to the `with` method to get a reference back to the original
-    /// data.
-    ///
-    /// Note that the returned handle is cloneable and copyable and can be sent
-    /// to other futures which will be associated with the same task. All
-    /// futures will then have access to this data when passed the reference
-    /// back.
-    ///
-    /// # Panics
-    ///
-    /// This function will panic if a task is not currently running.
-    pub fn new(a: A) -> TaskRc<A> {
-        TaskRc {
-            task: task_impl::park(),
-            ptr: Arc::new(UnsafeCell::new(a)),
-        }
-    }
-
-    /// Operate with a reference to the underlying data.
-    ///
-    /// This method should be passed a handle previously returned by
-    /// `Task::insert`. That handle, when passed back into this method, will
-    /// retrieve a reference to the original data.
-    ///
-    /// # Panics
-    ///
-    /// This method will panic if a task is not currently running or if `self`
-    /// does not belong to the task that is currently running. That is, if
-    /// another task generated the `data` handle passed in, this method will
-    /// panic.
-    pub fn with<F, R>(&self, f: F) -> R
-        where F: FnOnce(&A) -> R
-    {
-        if !self.task.is_current() {
-            panic!("TaskRc being accessed on task it does not belong to");
-        }
-
-        f(unsafe { &*self.ptr.get() })
-    }
-}
-
-impl<A> Clone for TaskRc<A> {
-    fn clone(&self) -> TaskRc<A> {
-        TaskRc {
-            task: self.task.clone(),
-            ptr: self.ptr.clone(),
-        }
-    }
-}
diff --git a/src/unsync/mod.rs b/src/unsync/mod.rs
deleted file mode 100644
index aaa5a707..00000000
--- a/src/unsync/mod.rs
+++ /dev/null
@@ -1,7 +0,0 @@
-//! Future-aware single-threaded synchronization
-//!
-//! This module contains similar abstractions to `sync`, for communications
-//! between tasks on the same thread only.
-
-pub mod mpsc;
-pub mod oneshot;
diff --git a/src/unsync/mpsc.rs b/src/unsync/mpsc.rs
deleted file mode 100644
index 68cf6b8c..00000000
--- a/src/unsync/mpsc.rs
+++ /dev/null
@@ -1,470 +0,0 @@
-//! A multi-producer, single-consumer, futures-aware, FIFO queue with back
-//! pressure, for use communicating between tasks on the same thread.
-//!
-//! These queues are the same as those in `futures::sync`, except they're not
-//! intended to be sent across threads.
-
-use std::any::Any;
-use std::cell::RefCell;
-use std::collections::VecDeque;
-use std::error::Error;
-use std::fmt;
-use std::mem;
-use std::rc::{Rc, Weak};
-
-use task::{self, Task};
-use future::Executor;
-use sink::SendAll;
-use resultstream::{self, Results};
-use unsync::oneshot;
-use {Async, AsyncSink, Future, Poll, StartSend, Sink, Stream};
-
-/// Creates a bounded in-memory channel with buffered storage.
-///
-/// This method creates concrete implementations of the `Stream` and `Sink`
-/// traits which can be used to communicate a stream of values between tasks
-/// with backpressure. The channel capacity is exactly `buffer`. On average,
-/// sending a message through this channel performs no dynamic allocation.
-pub fn channel<T>(buffer: usize) -> (Sender<T>, Receiver<T>) {
-    channel_(Some(buffer))
-}
-
-fn channel_<T>(buffer: Option<usize>) -> (Sender<T>, Receiver<T>) {
-    let shared = Rc::new(RefCell::new(Shared {
-        buffer: VecDeque::new(),
-        capacity: buffer,
-        blocked_senders: VecDeque::new(),
-        blocked_recv: None,
-    }));
-    let sender = Sender { shared: Rc::downgrade(&shared) };
-    let receiver = Receiver { state: State::Open(shared) };
-    (sender, receiver)
-}
-
-#[derive(Debug)]
-struct Shared<T> {
-    buffer: VecDeque<T>,
-    capacity: Option<usize>,
-    blocked_senders: VecDeque<Task>,
-    blocked_recv: Option<Task>,
-}
-
-/// The transmission end of a channel.
-///
-/// This is created by the `channel` function.
-#[derive(Debug)]
-pub struct Sender<T> {
-    shared: Weak<RefCell<Shared<T>>>,
-}
-
-impl<T> Sender<T> {
-    fn do_send(&self, msg: T) -> StartSend<T, SendError<T>> {
-        let shared = match self.shared.upgrade() {
-            Some(shared) => shared,
-            None => return Err(SendError(msg)), // receiver was dropped
-        };
-        let mut shared = shared.borrow_mut();
-
-        match shared.capacity {
-            Some(capacity) if shared.buffer.len() == capacity => {
-                shared.blocked_senders.push_back(task::current());
-                Ok(AsyncSink::NotReady(msg))
-            }
-            _ => {
-                shared.buffer.push_back(msg);
-                if let Some(task) = shared.blocked_recv.take() {
-                    task.notify();
-                }
-                Ok(AsyncSink::Ready)
-            }
-        }
-    }
-}
-
-impl<T> Clone for Sender<T> {
-    fn clone(&self) -> Self {
-        Sender { shared: self.shared.clone() }
-    }
-}
-
-impl<T> Sink for Sender<T> {
-    type SinkItem = T;
-    type SinkError = SendError<T>;
-
-    fn start_send(&mut self, msg: T) -> StartSend<T, SendError<T>> {
-        self.do_send(msg)
-    }
-
-    fn poll_complete(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-
-    fn close(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-}
-
-impl<T> Drop for Sender<T> {
-    fn drop(&mut self) {
-        let shared = match self.shared.upgrade() {
-            Some(shared) => shared,
-            None => return,
-        };
-        if Rc::weak_count(&shared) == 0 {
-            if let Some(task) = shared.borrow_mut().blocked_recv.take() {
-                // Wake up receiver as its stream has ended
-                task.notify();
-            }
-        }
-    }
-}
-
-/// The receiving end of a channel which implements the `Stream` trait.
-///
-/// This is created by the `channel` function.
-#[derive(Debug)]
-pub struct Receiver<T> {
-    state: State<T>,
-}
-
-/// Possible states of a receiver. We're either Open (can receive more messages)
-/// or we're closed with a list of messages we have left to receive.
-#[derive(Debug)]
-enum State<T> {
-    Open(Rc<RefCell<Shared<T>>>),
-    Closed(VecDeque<T>),
-}
-
-impl<T> Receiver<T> {
-    /// Closes the receiving half
-    ///
-    /// This prevents any further messages from being sent on the channel while
-    /// still enabling the receiver to drain messages that are buffered.
-    pub fn close(&mut self) {
-        let (blockers, items) = match self.state {
-            State::Open(ref state) => {
-                let mut state = state.borrow_mut();
-                let items = mem::replace(&mut state.buffer, VecDeque::new());
-                let blockers = mem::replace(&mut state.blocked_senders, VecDeque::new());
-                (blockers, items)
-            }
-            State::Closed(_) => return,
-        };
-        self.state = State::Closed(items);
-        for task in blockers {
-            task.notify();
-        }
-    }
-}
-
-impl<T> Stream for Receiver<T> {
-    type Item = T;
-    type Error = ();
-
-    fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
-        let me = match self.state {
-            State::Open(ref mut me) => me,
-            State::Closed(ref mut items) => {
-                return Ok(Async::Ready(items.pop_front()))
-            }
-        };
-
-        if let Some(shared) = Rc::get_mut(me) {
-            // All senders have been dropped, so drain the buffer and end the
-            // stream.
-            return Ok(Async::Ready(shared.borrow_mut().buffer.pop_front()));
-        }
-
-        let mut shared = me.borrow_mut();
-        if let Some(msg) = shared.buffer.pop_front() {
-            if let Some(task) = shared.blocked_senders.pop_front() {
-                drop(shared);
-                task.notify();
-            }
-            Ok(Async::Ready(Some(msg)))
-        } else {
-            shared.blocked_recv = Some(task::current());
-            Ok(Async::NotReady)
-        }
-    }
-}
-
-impl<T> Drop for Receiver<T> {
-    fn drop(&mut self) {
-        self.close();
-    }
-}
-
-/// The transmission end of an unbounded channel.
-///
-/// This is created by the `unbounded` function.
-#[derive(Debug)]
-pub struct UnboundedSender<T>(Sender<T>);
-
-impl<T> Clone for UnboundedSender<T> {
-    fn clone(&self) -> Self {
-        UnboundedSender(self.0.clone())
-    }
-}
-
-impl<T> Sink for UnboundedSender<T> {
-    type SinkItem = T;
-    type SinkError = SendError<T>;
-
-    fn start_send(&mut self, msg: T) -> StartSend<T, SendError<T>> {
-        self.0.start_send(msg)
-    }
-    fn poll_complete(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-    fn close(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-}
-
-impl<'a, T> Sink for &'a UnboundedSender<T> {
-    type SinkItem = T;
-    type SinkError = SendError<T>;
-
-    fn start_send(&mut self, msg: T) -> StartSend<T, SendError<T>> {
-        self.0.do_send(msg)
-    }
-
-    fn poll_complete(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-
-    fn close(&mut self) -> Poll<(), SendError<T>> {
-        Ok(Async::Ready(()))
-    }
-}
-
-impl<T> UnboundedSender<T> {
-    /// Sends the provided message along this channel.
-    ///
-    /// This is an unbounded sender, so this function differs from `Sink::send`
-    /// by ensuring the return type reflects that the channel is always ready to
-    /// receive messages.
-    #[deprecated(note = "renamed to `unbounded_send`")]
-    #[doc(hidden)]
-    pub fn send(&self, msg: T) -> Result<(), SendError<T>> {
-        self.unbounded_send(msg)
-    }
-
-    /// Sends the provided message along this channel.
-    ///
-    /// This is an unbounded sender, so this function differs from `Sink::send`
-    /// by ensuring the return type reflects that the channel is always ready to
-    /// receive messages.
-    pub fn unbounded_send(&self, msg: T) -> Result<(), SendError<T>> {
-        let shared = match self.0.shared.upgrade() {
-            Some(shared) => shared,
-            None => return Err(SendError(msg)),
-        };
-        let mut shared = shared.borrow_mut();
-        shared.buffer.push_back(msg);
-        if let Some(task) = shared.blocked_recv.take() {
-            drop(shared);
-            task.notify();
-        }
-        Ok(())
-    }
-}
-
-/// The receiving end of an unbounded channel.
-///
-/// This is created by the `unbounded` function.
-#[derive(Debug)]
-pub struct UnboundedReceiver<T>(Receiver<T>);
-
-impl<T> UnboundedReceiver<T> {
-    /// Closes the receiving half
-    ///
-    /// This prevents any further messages from being sent on the channel while
-    /// still enabling the receiver to drain messages that are buffered.
-    pub fn close(&mut self) {
-        self.0.close();
-    }
-}
-
-impl<T> Stream for UnboundedReceiver<T> {
-    type Item = T;
-    type Error = ();
-
-    fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
-        self.0.poll()
-    }
-}
-
-/// Creates an unbounded in-memory channel with buffered storage.
-///
-/// Identical semantics to `channel`, except with no limit to buffer size.
-pub fn unbounded<T>() -> (UnboundedSender<T>, UnboundedReceiver<T>) {
-    let (send, recv) = channel_(None);
-    (UnboundedSender(send), UnboundedReceiver(recv))
-}
-
-/// Error type for sending, used when the receiving end of a channel is
-/// dropped
-pub struct SendError<T>(T);
-
-impl<T> fmt::Debug for SendError<T> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-        fmt.debug_tuple("SendError")
-            .field(&"...")
-            .finish()
-    }
-}
-
-impl<T> fmt::Display for SendError<T> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
-        write!(fmt, "send failed because receiver is gone")
-    }
-}
-
-impl<T: Any> Error for SendError<T> {
-    fn description(&self) -> &str {
-        "send failed because receiver is gone"
-    }
-}
-
-impl<T> SendError<T> {
-    /// Returns the message that was attempted to be sent but failed.
-    pub fn into_inner(self) -> T {
-        self.0
-    }
-}
-
-/// Handle returned from the `spawn` function.
-///
-/// This handle is a stream that proxies a stream on a separate `Executor`.
-/// Created through the `mpsc::spawn` function, this handle will produce
-/// the same values as the proxied stream, as they are produced in the executor,
-/// and uses a limited buffer to exert back-pressure on the remote stream.
-///
-/// If this handle is dropped, then the stream will no longer be polled and is
-/// scheduled to be dropped.
-pub struct SpawnHandle<Item, Error> {
-    inner: Receiver<Result<Item, Error>>,
-    _cancel_tx: oneshot::Sender<()>,
-}
-
-/// Type of future which `Executor` instances must be able to execute for `spawn`.
-pub struct Execute<S: Stream> {
-    inner: SendAll<Sender<Result<S::Item, S::Error>>, Results<S, SendError<Result<S::Item, S::Error>>>>,
-    cancel_rx: oneshot::Receiver<()>,
-}
-
-/// Spawns a `stream` onto the instance of `Executor` provided, `executor`,
-/// returning a handle representing the remote stream.
-///
-/// The `stream` will be canceled if the `SpawnHandle` is dropped.
-///
-/// The `SpawnHandle` returned is a stream that is a proxy for `stream` itself.
-/// When `stream` has additional items available, then the `SpawnHandle`
-/// will have those same items available.
-///
-/// At most `buffer + 1` elements will be buffered at a time. If the buffer
-/// is full, then `stream` will stop progressing until more space is available.
-/// This allows the `SpawnHandle` to exert backpressure on the `stream`.
-///
-/// # Panics
-///
-/// This function will panic if `executor` is unable spawn a `Future` containing
-/// the entirety of the `stream`.
-pub fn spawn<S, E>(stream: S, executor: &E, buffer: usize) -> SpawnHandle<S::Item, S::Error>
-    where S: Stream,
-          E: Executor<Execute<S>>
-{
-    let (cancel_tx, cancel_rx) = oneshot::channel();
-    let (tx, rx) = channel(buffer);
-    executor.execute(Execute {
-        inner: tx.send_all(resultstream::new(stream)),
-        cancel_rx: cancel_rx,
-    }).expect("failed to spawn stream");
-    SpawnHandle {
-        inner: rx,
-        _cancel_tx: cancel_tx,
-    }
-}
-
-/// Spawns a `stream` onto the instance of `Executor` provided, `executor`,
-/// returning a handle representing the remote stream, with unbounded buffering.
-///
-/// The `stream` will be canceled if the `SpawnHandle` is dropped.
-///
-/// The `SpawnHandle` returned is a stream that is a proxy for `stream` itself.
-/// When `stream` has additional items available, then the `SpawnHandle`
-/// will have those same items available.
-///
-/// An unbounded buffer is used, which means that values will be buffered as
-/// fast as `stream` can produce them, without any backpressure. Therefore, if
-/// `stream` is an infinite stream, it can use an unbounded amount of memory, and
-/// potentially hog CPU resources. In particular, if `stream` is infinite
-/// and doesn't ever yield (by returning `Async::NotReady` from `poll`), it
-/// will result in an infinite loop.
-///
-/// # Panics
-///
-/// This function will panic if `executor` is unable spawn a `Future` containing
-/// the entirety of the `stream`.
-pub fn spawn_unbounded<S,E>(stream: S, executor: &E) -> SpawnHandle<S::Item, S::Error>
-    where S: Stream,
-          E: Executor<Execute<S>>
-{
-    let (cancel_tx, cancel_rx) = oneshot::channel();
-    let (tx, rx) = channel_(None);
-    executor.execute(Execute {
-        inner: tx.send_all(resultstream::new(stream)),
-        cancel_rx: cancel_rx,
-    }).expect("failed to spawn stream");
-    SpawnHandle {
-        inner: rx,
-        _cancel_tx: cancel_tx,
-    }
-}
-
-impl<I, E> Stream for SpawnHandle<I, E> {
-    type Item = I;
-    type Error = E;
-
-    fn poll(&mut self) -> Poll<Option<I>, E> {
-        match self.inner.poll() {
-            Ok(Async::Ready(Some(Ok(t)))) => Ok(Async::Ready(Some(t.into()))),
-            Ok(Async::Ready(Some(Err(e)))) => Err(e),
-            Ok(Async::Ready(None)) => Ok(Async::Ready(None)),
-            Ok(Async::NotReady) => Ok(Async::NotReady),
-            Err(_) => unreachable!("mpsc::Receiver should never return Err"),
-        }
-    }
-}
-
-impl<I, E> fmt::Debug for SpawnHandle<I, E> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_struct("SpawnHandle")
-            .finish()
-    }
-}
-
-impl<S: Stream> Future for Execute<S> {
-    type Item = ();
-    type Error = ();
-
-    fn poll(&mut self) -> Poll<(), ()> {
-        match self.cancel_rx.poll() {
-            Ok(Async::NotReady) => (),
-            _ => return Ok(Async::Ready(())),
-        }
-        match self.inner.poll() {
-            Ok(Async::NotReady) => Ok(Async::NotReady),
-            _ => Ok(Async::Ready(()))
-        }
-    }
-}
-
-impl<S: Stream> fmt::Debug for Execute<S> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_struct("Execute")
-         .finish()
-    }
-}
diff --git a/src/unsync/oneshot.rs b/src/unsync/oneshot.rs
deleted file mode 100644
index 7ae2890f..00000000
--- a/src/unsync/oneshot.rs
+++ /dev/null
@@ -1,351 +0,0 @@
-//! A one-shot, futures-aware channel
-//!
-//! This channel is similar to that in `sync::oneshot` but cannot be sent across
-//! threads.
-
-use std::cell::{Cell, RefCell};
-use std::fmt;
-use std::rc::{Rc, Weak};
-
-use {Future, Poll, Async};
-use future::{Executor, IntoFuture, Lazy, lazy};
-use task::{self, Task};
-
-/// Creates a new futures-aware, one-shot channel.
-///
-/// This function is the same as `sync::oneshot::channel` except that the
-/// returned values cannot be sent across threads.
-pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
-    let inner = Rc::new(RefCell::new(Inner {
-        value: None,
-        tx_task: None,
-        rx_task: None,
-    }));
-    let tx = Sender {
-        inner: Rc::downgrade(&inner),
-    };
-    let rx = Receiver {
-        state: State::Open(inner),
-    };
-    (tx, rx)
-}
-
-/// Represents the completion half of a oneshot through which the result of a
-/// computation is signaled.
-///
-/// This is created by the `unsync::oneshot::channel` function and is equivalent
-/// in functionality to `sync::oneshot::Sender` except that it cannot be sent
-/// across threads.
-#[derive(Debug)]
-pub struct Sender<T> {
-    inner: Weak<RefCell<Inner<T>>>,
-}
-
-/// A future representing the completion of a computation happening elsewhere in
-/// memory.
-///
-/// This is created by the `unsync::oneshot::channel` function and is equivalent
-/// in functionality to `sync::oneshot::Receiver` except that it cannot be sent
-/// across threads.
-#[derive(Debug)]
-#[must_use = "futures do nothing unless polled"]
-pub struct Receiver<T> {
-    state: State<T>,
-}
-
-#[derive(Debug)]
-enum State<T> {
-    Open(Rc<RefCell<Inner<T>>>),
-    Closed(Option<T>),
-}
-
-pub use sync::oneshot::Canceled;
-
-#[derive(Debug)]
-struct Inner<T> {
-    value: Option<T>,
-    tx_task: Option<Task>,
-    rx_task: Option<Task>,
-}
-
-impl<T> Sender<T> {
-    /// Completes this oneshot with a successful result.
-    ///
-    /// This function will consume `self` and indicate to the other end, the
-    /// `Receiver`, that the error provided is the result of the computation this
-    /// represents.
-    ///
-    /// If the value is successfully enqueued for the remote end to receive,
-    /// then `Ok(())` is returned. If the receiving end was deallocated before
-    /// this function was called, however, then `Err` is returned with the value
-    /// provided.
-    pub fn send(self, val: T) -> Result<(), T> {
-        if let Some(inner) = self.inner.upgrade() {
-            inner.borrow_mut().value = Some(val);
-            Ok(())
-        } else {
-            Err(val)
-        }
-    }
-
-    /// Polls this `Sender` half to detect whether the `Receiver` this has
-    /// paired with has gone away.
-    ///
-    /// This function can be used to learn about when the `Receiver` (consumer)
-    /// half has gone away and nothing will be able to receive a message sent
-    /// from `complete`.
-    ///
-    /// Like `Future::poll`, this function will panic if it's not called from
-    /// within the context of a task. In other words, this should only ever be
-    /// called from inside another future.
-    ///
-    /// If `Ready` is returned then it means that the `Receiver` has disappeared
-    /// and the result this `Sender` would otherwise produce should no longer
-    /// be produced.
-    ///
-    /// If `NotReady` is returned then the `Receiver` is still alive and may be
-    /// able to receive a message if sent. The current task, however, is
-    /// scheduled to receive a notification if the corresponding `Receiver` goes
-    /// away.
-    pub fn poll_cancel(&mut self) -> Poll<(), ()> {
-        match self.inner.upgrade() {
-            Some(inner) => {
-                inner.borrow_mut().tx_task = Some(task::current());
-                Ok(Async::NotReady)
-            }
-            None => Ok(().into()),
-        }
-    }
-
-    /// Tests to see whether this `Sender`'s corresponding `Receiver`
-    /// has gone away.
-    ///
-    /// This function can be used to learn about when the `Receiver` (consumer)
-    /// half has gone away and nothing will be able to receive a message sent
-    /// from `send`.
-    ///
-    /// Note that this function is intended to *not* be used in the context of a
-    /// future. If you're implementing a future you probably want to call the
-    /// `poll_cancel` function which will block the current task if the
-    /// cancellation hasn't happened yet. This can be useful when working on a
-    /// non-futures related thread, though, which would otherwise panic if
-    /// `poll_cancel` were called.
-    pub fn is_canceled(&self) -> bool {
-        !self.inner.upgrade().is_some()
-    }
-}
-
-impl<T> Drop for Sender<T> {
-    fn drop(&mut self) {
-        let inner = match self.inner.upgrade() {
-            Some(inner) => inner,
-            None => return,
-        };
-        let rx_task = {
-            let mut borrow = inner.borrow_mut();
-            borrow.tx_task.take();
-            borrow.rx_task.take()
-        };
-        if let Some(task) = rx_task {
-            task.notify();
-        }
-    }
-}
-
-impl<T> Receiver<T> {
-    /// Gracefully close this receiver, preventing sending any future messages.
-    ///
-    /// Any `send` operation which happens after this method returns is
-    /// guaranteed to fail. Once this method is called the normal `poll` method
-    /// can be used to determine whether a message was actually sent or not. If
-    /// `Canceled` is returned from `poll` then no message was sent.
-    pub fn close(&mut self) {
-        let (item, task) = match self.state {
-            State::Open(ref inner) => {
-                let mut inner = inner.borrow_mut();
-                drop(inner.rx_task.take());
-                (inner.value.take(), inner.tx_task.take())
-            }
-            State::Closed(_) => return,
-        };
-        self.state = State::Closed(item);
-        if let Some(task) = task {
-            task.notify();
-        }
-    }
-}
-
-impl<T> Future for Receiver<T> {
-    type Item = T;
-    type Error = Canceled;
-
-    fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
-        let inner = match self.state {
-            State::Open(ref mut inner) => inner,
-            State::Closed(ref mut item) => {
-                match item.take() {
-                    Some(item) => return Ok(item.into()),
-                    None => return Err(Canceled),
-                }
-            }
-        };
-
-        // If we've got a value, then skip the logic below as we're done.
-        if let Some(val) = inner.borrow_mut().value.take() {
-            return Ok(Async::Ready(val))
-        }
-
-        // If we can get mutable access, then the sender has gone away. We
-        // didn't see a value above, so we're canceled. Otherwise we park
-        // our task and wait for a value to come in.
-        if Rc::get_mut(inner).is_some() {
-            Err(Canceled)
-        } else {
-            inner.borrow_mut().rx_task = Some(task::current());
-            Ok(Async::NotReady)
-        }
-    }
-}
-
-impl<T> Drop for Receiver<T> {
-    fn drop(&mut self) {
-        self.close();
-    }
-}
-
-/// Handle returned from the `spawn` function.
-///
-/// This handle is a future representing the completion of a different future on
-/// a separate executor. Created through the `oneshot::spawn` function this
-/// handle will resolve when the future provided to `spawn` resolves on the
-/// `Executor` instance provided to that function.
-///
-/// If this handle is dropped then the future will automatically no longer be
-/// polled and is scheduled to be dropped. This can be canceled with the
-/// `forget` function, however.
-pub struct SpawnHandle<T, E> {
-    rx: Receiver<Result<T, E>>,
-    keep_running: Rc<Cell<bool>>,
-}
-
-/// Type of future which `Spawn` instances below must be able to spawn.
-pub struct Execute<F: Future> {
-    future: F,
-    tx: Option<Sender<Result<F::Item, F::Error>>>,
-    keep_running: Rc<Cell<bool>>,
-}
-
-/// Spawns a `future` onto the instance of `Executor` provided, `executor`,
-/// returning a handle representing the completion of the future.
-///
-/// The `SpawnHandle` returned is a future that is a proxy for `future` itself.
-/// When `future` completes on `executor` then the `SpawnHandle` will itself be
-/// resolved.  Internally `SpawnHandle` contains a `oneshot` channel and is
-/// thus not safe to send across threads.
-///
-/// The `future` will be canceled if the `SpawnHandle` is dropped. If this is
-/// not desired then the `SpawnHandle::forget` function can be used to continue
-/// running the future to completion.
-///
-/// # Panics
-///
-/// This function will panic if the instance of `Spawn` provided is unable to
-/// spawn the `future` provided.
-///
-/// If the provided instance of `Spawn` does not actually run `future` to
-/// completion, then the returned handle may panic when polled. Typically this
-/// is not a problem, though, as most instances of `Spawn` will run futures to
-/// completion.
-pub fn spawn<F, E>(future: F, executor: &E) -> SpawnHandle<F::Item, F::Error>
-    where F: Future,
-          E: Executor<Execute<F>>,
-{
-    let flag = Rc::new(Cell::new(false));
-    let (tx, rx) = channel();
-    executor.execute(Execute {
-        future: future,
-        tx: Some(tx),
-        keep_running: flag.clone(),
-    }).expect("failed to spawn future");
-    SpawnHandle {
-        rx: rx,
-        keep_running: flag,
-    }
-}
-
-/// Spawns a function `f` onto the `Spawn` instance provided `s`.
-///
-/// For more information see the `spawn` function in this module. This function
-/// is just a thin wrapper around `spawn` which will execute the closure on the
-/// executor provided and then complete the future that the closure returns.
-pub fn spawn_fn<F, R, E>(f: F, executor: &E) -> SpawnHandle<R::Item, R::Error>
-    where F: FnOnce() -> R,
-          R: IntoFuture,
-          E: Executor<Execute<Lazy<F, R>>>,
-{
-    spawn(lazy(f), executor)
-}
-
-impl<T, E> SpawnHandle<T, E> {
-    /// Drop this future without canceling the underlying future.
-    ///
-    /// When `SpawnHandle` is dropped, the spawned future will be canceled as
-    /// well if the future hasn't already resolved. This function can be used
-    /// when to drop this future but keep executing the underlying future.
-    pub fn forget(self) {
-        self.keep_running.set(true);
-    }
-}
-
-impl<T, E> Future for SpawnHandle<T, E> {
-    type Item = T;
-    type Error = E;
-
-    fn poll(&mut self) -> Poll<T, E> {
-        match self.rx.poll() {
-            Ok(Async::Ready(Ok(t))) => Ok(t.into()),
-            Ok(Async::Ready(Err(e))) => Err(e),
-            Ok(Async::NotReady) => Ok(Async::NotReady),
-            Err(_) => panic!("future was canceled before completion"),
-        }
-    }
-}
-
-impl<T: fmt::Debug, E: fmt::Debug> fmt::Debug for SpawnHandle<T, E> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_struct("SpawnHandle")
-         .finish()
-    }
-}
-
-impl<F: Future> Future for Execute<F> {
-    type Item = ();
-    type Error = ();
-
-    fn poll(&mut self) -> Poll<(), ()> {
-        // If we're canceled then we may want to bail out early.
-        //
-        // If the `forget` function was called, though, then we keep going.
-        if self.tx.as_mut().unwrap().poll_cancel().unwrap().is_ready() {
-            if !self.keep_running.get() {
-                return Ok(().into())
-            }
-        }
-
-        let result = match self.future.poll() {
-            Ok(Async::NotReady) => return Ok(Async::NotReady),
-            Ok(Async::Ready(t)) => Ok(t),
-            Err(e) => Err(e),
-        };
-        drop(self.tx.take().unwrap().send(result));
-        Ok(().into())
-    }
-}
-
-impl<F: Future + fmt::Debug> fmt::Debug for Execute<F> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        f.debug_struct("Execute")
-         .field("future", &self.future)
-         .finish()
-    }
-}


Test patch:
diff --git a/tests/mpsc.rs b/tests/mpsc.rs
index 8df98d49..86e44fee 100644
--- a/tests/mpsc.rs
+++ b/tests/mpsc.rs
@@ -1,4 +1,4 @@
-#![cfg(feature = "use_std")]
+#![cfg(feature = "std")]
 
 #[macro_use]
 extern crate futures;
diff --git a/tests/stream.rs b/tests/stream.rs
index 8f5d250a..3bf68c19 100644
--- a/tests/stream.rs
+++ b/tests/stream.rs
@@ -375,13 +375,13 @@ fn concat() {
 #[test]
 fn concat2() {
     let a = iter_ok::<_, ()>(vec![vec![1, 2, 3], vec![4, 5, 6], vec![7, 8, 9]]);
-    assert_done(move || a.concat2(), Ok(vec![1, 2, 3, 4, 5, 6, 7, 8, 9]));
+    assert_done(move || a.concat(), Ok(vec![1, 2, 3, 4, 5, 6, 7, 8, 9]));
 
     let b = iter(vec![Ok::<_, ()>(vec![1, 2, 3]), Err(()), Ok(vec![7, 8, 9])]);
-    assert_done(move || b.concat2(), Err(()));
+    assert_done(move || b.concat(), Err(()));
 
     let c = empty::<Vec<()>, ()>();
-    assert_done(move || c.concat2(), Ok(vec![]))
+    assert_done(move || c.concat(), Ok(vec![]))
 }
 
 #[test]
diff --git a/tests/unsync-oneshot.rs b/tests/unsync-oneshot.rs
deleted file mode 100644
index 55b0ca5a..00000000
--- a/tests/unsync-oneshot.rs
+++ /dev/null
@@ -1,189 +0,0 @@
-extern crate futures;
-
-use futures::prelude::*;
-use futures::future;
-use futures::unsync::oneshot::{channel, Canceled, spawn};
-
-mod support;
-use support::local_executor;
-
-#[test]
-fn smoke() {
-    let (tx, rx) = channel();
-    tx.send(33).unwrap();
-    assert_eq!(rx.wait().unwrap(), 33);
-}
-
-#[test]
-fn canceled() {
-    let (_, rx) = channel::<()>();
-    assert_eq!(rx.wait().unwrap_err(), Canceled);
-}
-
-#[test]
-fn poll_cancel() {
-    let (mut tx, _) = channel::<()>();
-    assert!(tx.poll_cancel().unwrap().is_ready());
-}
-
-#[test]
-fn tx_complete_rx_unparked() {
-    let (tx, rx) = channel();
-
-    let res = rx.join(future::lazy(move || {
-        tx.send(55).unwrap();
-        Ok(11)
-    }));
-    assert_eq!(res.wait().unwrap(), (55, 11));
-}
-
-#[test]
-fn tx_dropped_rx_unparked() {
-    let (tx, rx) = channel::<i32>();
-
-    let res = rx.join(future::lazy(move || {
-        let _tx = tx;
-        Ok(11)
-    }));
-    assert_eq!(res.wait().unwrap_err(), Canceled);
-}
-
-
-#[test]
-fn is_canceled() {
-    let (tx, rx) = channel::<u32>();
-    assert!(!tx.is_canceled());
-    drop(rx);
-    assert!(tx.is_canceled());
-}
-
-#[test]
-fn spawn_sends_items() {
-    let core = local_executor::Core::new();
-    let future = future::ok::<_, ()>(1);
-    let rx = spawn(future, &core);
-    assert_eq!(core.run(rx).unwrap(), 1);
-}
-
-#[test]
-fn spawn_kill_dead_stream() {
-    use std::thread;
-    use std::time::Duration;
-    use futures::future::Either;
-    use futures::sync::oneshot;
-
-    // a future which never returns anything (forever accepting incoming
-    // connections), but dropping it leads to observable side effects
-    // (like closing listening sockets, releasing limited resources,
-    // ...)
-    #[derive(Debug)]
-    struct Dead {
-        // when dropped you should get Err(oneshot::Canceled) on the
-        // receiving end
-        done: oneshot::Sender<()>,
-    }
-    impl Future for Dead {
-        type Item = ();
-        type Error = ();
-
-        fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
-            Ok(Async::NotReady)
-        }
-    }
-
-    // need to implement a timeout for the test, as it would hang
-    // forever right now
-    let (timeout_tx, timeout_rx) = oneshot::channel();
-    thread::spawn(move || {
-        thread::sleep(Duration::from_millis(1000));
-        let _ = timeout_tx.send(());
-    });
-
-    let core = local_executor::Core::new();
-    let (done_tx, done_rx) = oneshot::channel();
-    let future = Dead{done: done_tx};
-    let rx = spawn(future, &core);
-    let res = core.run(
-        Ok::<_, ()>(())
-        .into_future()
-        .then(move |_| {
-            // now drop the spawned future: maybe some timeout exceeded,
-            // or some connection on this end was closed by the remote
-            // end.
-            drop(rx);
-            // and wait for the spawned future to release its resources
-            done_rx
-        })
-        .select2(timeout_rx)
-    );
-    match res {
-        Err(Either::A((oneshot::Canceled, _))) => (),
-        Ok(Either::B(((), _))) => {
-            panic!("dead future wasn't canceled (timeout)");
-        },
-        _ => {
-            panic!("dead future wasn't canceled (unexpected result)");
-        },
-    }
-}
-
-#[test]
-fn spawn_dont_kill_forgot_dead_stream() {
-    use std::thread;
-    use std::time::Duration;
-    use futures::future::Either;
-    use futures::sync::oneshot;
-
-    // a future which never returns anything (forever accepting incoming
-    // connections), but dropping it leads to observable side effects
-    // (like closing listening sockets, releasing limited resources,
-    // ...)
-    #[derive(Debug)]
-    struct Dead {
-        // when dropped you should get Err(oneshot::Canceled) on the
-        // receiving end
-        done: oneshot::Sender<()>,
-    }
-    impl Future for Dead {
-        type Item = ();
-        type Error = ();
-
-        fn poll(&mut self) -> Poll<Self::Item, Self::Error> {
-            Ok(Async::NotReady)
-        }
-    }
-
-    // need to implement a timeout for the test, as it would hang
-    // forever right now
-    let (timeout_tx, timeout_rx) = oneshot::channel();
-    thread::spawn(move || {
-        thread::sleep(Duration::from_millis(1000));
-        let _ = timeout_tx.send(());
-    });
-
-    let core = local_executor::Core::new();
-    let (done_tx, done_rx) = oneshot::channel();
-    let future = Dead{done: done_tx};
-    let rx = spawn(future, &core);
-    let res = core.run(
-        Ok::<_, ()>(())
-        .into_future()
-        .then(move |_| {
-            // forget the spawned future: should keep running, i.e. hit
-            // the timeout below.
-            rx.forget();
-            // and wait for the spawned future to release its resources
-            done_rx
-        })
-        .select2(timeout_rx)
-    );
-    match res {
-        Err(Either::A((oneshot::Canceled, _))) => {
-            panic!("forgotten dead future was canceled");
-        },
-        Ok(Either::B(((), _))) => (), // reached timeout
-        _ => {
-            panic!("forgotten dead future was canceled (unexpected result)");
-        },
-    }
-}
diff --git a/tests/unsync.rs b/tests/unsync.rs
deleted file mode 100644
index b5ae8d0f..00000000
--- a/tests/unsync.rs
+++ /dev/null
@@ -1,203 +0,0 @@
-#![cfg(feature = "use_std")]
-
-extern crate futures;
-
-mod support;
-
-use futures::prelude::*;
-use futures::unsync::oneshot;
-use futures::unsync::mpsc::{self, SendError};
-use futures::future::lazy;
-use futures::stream::{iter_ok, unfold};
-
-use support::local_executor::Core;
-
-#[test]
-fn mpsc_send_recv() {
-    let (tx, rx) = mpsc::channel::<i32>(1);
-    let mut rx = rx.wait();
-
-    tx.send(42).wait().unwrap();
-
-    assert_eq!(rx.next(), Some(Ok(42)));
-    assert_eq!(rx.next(), None);
-}
-
-#[test]
-fn mpsc_rx_notready() {
-    let (_tx, mut rx) = mpsc::channel::<i32>(1);
-
-    lazy(|| {
-        assert_eq!(rx.poll().unwrap(), Async::NotReady);
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_rx_end() {
-    let (_, mut rx) = mpsc::channel::<i32>(1);
-
-    lazy(|| {
-        assert_eq!(rx.poll().unwrap(), Async::Ready(None));
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_tx_clone_weak_rc() {
-    let (tx, mut rx) = mpsc::channel::<i32>(1); // rc = 1
-
-    let tx_clone = tx.clone(); // rc = 2
-    lazy(|| {
-        assert_eq!(rx.poll().unwrap(), Async::NotReady);
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-
-    drop(tx); // rc = 1
-    lazy(|| {
-        assert_eq!(rx.poll().unwrap(), Async::NotReady);
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-
-    drop(tx_clone); // rc = 0
-    lazy(|| {
-        assert_eq!(rx.poll().unwrap(), Async::Ready(None));
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_tx_notready() {
-    let (tx, _rx) = mpsc::channel::<i32>(1);
-    let tx = tx.send(1).wait().unwrap();
-    lazy(move || {
-        assert!(tx.send(2).poll().unwrap().is_not_ready());
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_tx_err() {
-    let (tx, _) = mpsc::channel::<i32>(1);
-    lazy(move || {
-        assert!(tx.send(2).poll().is_err());
-        Ok(()) as Result<(), ()>
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_backpressure() {
-    let (tx, rx) = mpsc::channel::<i32>(1);
-    lazy(move || {
-        iter_ok(vec![1, 2, 3])
-            .forward(tx)
-            .map_err(|e: SendError<i32>| panic!("{}", e))
-            .join(rx.take(3).collect().map(|xs| {
-                assert_eq!(xs, [1, 2, 3]);
-            }))
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_unbounded() {
-    let (tx, rx) = mpsc::unbounded::<i32>();
-    lazy(move || {
-        iter_ok(vec![1, 2, 3])
-            .forward(tx)
-            .map_err(|e: SendError<i32>| panic!("{}", e))
-            .join(rx.take(3).collect().map(|xs| {
-                assert_eq!(xs, [1, 2, 3]);
-            }))
-    }).wait().unwrap();
-}
-
-#[test]
-fn mpsc_recv_unpark() {
-    let core = Core::new();
-    let (tx, rx) = mpsc::channel::<i32>(1);
-    let tx2 = tx.clone();
-    core.spawn(rx.collect().map(|xs| assert_eq!(xs, [1, 2])));
-    core.spawn(lazy(move || tx.send(1).map(|_| ()).map_err(|e| panic!("{}", e))));
-    core.run(lazy(move || tx2.send(2))).unwrap();
-}
-
-#[test]
-fn mpsc_send_unpark() {
-    let core = Core::new();
-    let (tx, rx) = mpsc::channel::<i32>(1);
-    let (donetx, donerx) = oneshot::channel();
-    core.spawn(iter_ok(vec![1, 2]).forward(tx)
-        .then(|x: Result<_, SendError<i32>>| {
-            assert!(x.is_err());
-            donetx.send(()).unwrap();
-            Ok(())
-        }));
-    core.spawn(lazy(move || { let _ = rx; Ok(()) }));
-    core.run(donerx).unwrap();
-}
-
-#[test]
-fn spawn_sends_items() {
-    let core = Core::new();
-    let stream = unfold(0, |i| Some(Ok::<_,u8>((i, i + 1))));
-    let rx = mpsc::spawn(stream, &core, 1);
-    assert_eq!(core.run(rx.take(4).collect()).unwrap(),
-               [0, 1, 2, 3]);
-}
-
-#[test]
-fn spawn_kill_dead_stream() {
-    use std::thread;
-    use std::time::Duration;
-    use futures::future::Either;
-
-    // a stream which never returns anything (maybe a remote end isn't
-    // responding), but dropping it leads to observable side effects
-    // (like closing connections, releasing limited resources, ...)
-    #[derive(Debug)]
-    struct Dead {
-        // when dropped you should get Err(oneshot::Canceled) on the
-        // receiving end
-        done: oneshot::Sender<()>,
-    }
-    impl Stream for Dead {
-        type Item = ();
-        type Error = ();
-
-        fn poll(&mut self) -> Poll<Option<Self::Item>, Self::Error> {
-            Ok(Async::NotReady)
-        }
-    }
-
-    // need to implement a timeout for the test, as it would hang
-    // forever right now
-    let (timeout_tx, timeout_rx) = futures::sync::oneshot::channel();
-    thread::spawn(move || {
-        thread::sleep(Duration::from_millis(1000));
-        let _ = timeout_tx.send(());
-    });
-
-    let core = Core::new();
-    let (done_tx, done_rx) = oneshot::channel();
-    let stream = Dead{done: done_tx};
-    let rx = mpsc::spawn(stream, &core, 1);
-    let res = core.run(
-        Ok::<_, ()>(())
-        .into_future()
-        .then(move |_| {
-            // now drop the spawned stream: maybe some timeout exceeded,
-            // or some connection on this end was closed by the remote
-            // end.
-            drop(rx);
-            // and wait for the spawned stream to release its resources
-            done_rx
-        })
-        .select2(timeout_rx)
-    );
-    match res {
-        Err(Either::A((oneshot::Canceled, _))) => (),
-        _ => {
-            panic!("dead stream wasn't canceled");
-        },
-    }
-}