Remove dead futures2 code. (#538)

The futures 0.2 crate is not intended for widespread usage. Also, the
futures team is exploring the compat shim route.

If futures 0.3 support is added to Tokio 0.1, then a different
integration route will be explored, making the current code unhelpful.
This commit is contained in:
Carl Lerche
2018-08-09 21:56:53 -07:00
committed by GitHub
parent 96b556fbff
commit d91c775f36
31 changed files with 67 additions and 1380 deletions
-18
View File
@@ -37,9 +37,6 @@
extern crate futures;
#[cfg(feature = "unstable-futures")]
extern crate futures2;
mod enter;
mod global;
pub mod park;
@@ -47,9 +44,6 @@ pub mod park;
pub use enter::{enter, Enter, EnterError};
pub use global::{spawn, with_default, DefaultExecutor};
#[cfg(feature = "unstable-futures")]
pub use global::spawn2;
use futures::Future;
use std::error::Error;
@@ -142,11 +136,6 @@ pub trait Executor {
fn spawn(&mut self, future: Box<Future<Item = (), Error = ()> + Send>)
-> Result<(), SpawnError>;
/// Like `spawn`, but compatible with futures 0.2
#[cfg(feature = "unstable-futures")]
fn spawn2(&mut self, future: Box<futures2::Future<Item = (), Error = futures2::Never> + Send>)
-> Result<(), futures2::executor::SpawnError>;
/// Provides a best effort **hint** to whether or not `spawn` will succeed.
///
/// This function may return both false positives **and** false negatives.
@@ -194,13 +183,6 @@ impl<E: Executor + ?Sized> Executor for Box<E> {
(**self).spawn(future)
}
#[cfg(feature = "unstable-futures")]
fn spawn2(&mut self, future: Box<futures2::Future<Item = (), Error = futures2::Never> + Send>)
-> Result<(), futures2::executor::SpawnError>
{
(**self).spawn2(future)
}
fn status(&self) -> Result<(), SpawnError> {
(**self).status()
}