Skip to content

Commit

Permalink
Remove deprecated functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
cramertj committed Feb 5, 2018
1 parent a45249c commit 05f9b0e
Show file tree
Hide file tree
Showing 24 changed files with 14 additions and 2,284 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ appveyor = { repository = "alexcrichton/futures-rs" }

[features]
use_std = []
with-deprecated = []
default = ["use_std", "with-deprecated"]
default = ["use_std"]

[workspace]
members = ["futures-cpupool"]
4 changes: 0 additions & 4 deletions futures-cpupool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,3 @@ path = ".."
version = "0.1"
default-features = false
features = ["use_std"]

[features]
default = ["with-deprecated"]
with-deprecated = ["futures/with-deprecated"]
2 changes: 1 addition & 1 deletion src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#[allow(deprecated)]
#[cfg(feature = "use_std")]
pub use task_impl::{Unpark, Executor, Run};
pub use task_impl::{Executor, Run};

pub use task_impl::{Spawn, spawn, Notify, with_notify};

Expand Down
69 changes: 0 additions & 69 deletions src/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -299,38 +262,6 @@ pub trait Future {
::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.
///
Expand Down
8 changes: 0 additions & 8 deletions src/future/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
50 changes: 0 additions & 50 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,20 +183,6 @@ 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")]
mod lock;
mod task_impl;
Expand All @@ -207,42 +193,6 @@ pub mod task;
pub mod executor;
#[cfg(feature = "use_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.
///
Expand Down
7 changes: 0 additions & 7 deletions src/sink/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
114 changes: 0 additions & 114 deletions src/stream/channel.rs

This file was deleted.

Loading

0 comments on commit 05f9b0e

Please sign in to comment.