Skip to content

Commit 4587897

Browse files
author
Harry Barber
committed
Remove IntoFuture
1 parent 75e53ff commit 4587897

File tree

4 files changed

+2
-77
lines changed

4 files changed

+2
-77
lines changed

futures-util/src/future/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ pub use self::future::{Shared, WeakShared};
4040

4141
mod try_future;
4242
pub use self::try_future::{
43-
AndThen, ErrInto, InspectErr, InspectOk, IntoFuture, MapErr, MapOk, MapOkOrElse, OkInto,
44-
OrElse, TryFlatten, TryFlattenStream, TryFutureExt, UnwrapOrElse,
43+
AndThen, ErrInto, InspectErr, InspectOk, MapErr, MapOk, MapOkOrElse, OkInto, OrElse,
44+
TryFlatten, TryFlattenStream, TryFutureExt, UnwrapOrElse,
4545
};
4646

4747
#[cfg(feature = "sink")]

futures-util/src/future/try_future/into_future.rs

Lines changed: 0 additions & 36 deletions
This file was deleted.

futures-util/src/future/try_future/mod.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use crate::future::{assert_future, Inspect, Map};
1818
use crate::stream::assert_stream;
1919

2020
// Combinators
21-
mod into_future;
2221
mod try_flatten;
2322
mod try_flatten_err;
2423

@@ -95,9 +94,6 @@ delegate_all!(
9594
): Debug + Future + FusedFuture + New[|x: Fut, f: F| Inspect::new(x, inspect_err_fn(f))]
9695
);
9796

98-
#[allow(unreachable_pub)] // https://github.com/rust-lang/rust/issues/57411
99-
pub use self::into_future::IntoFuture;
100-
10197
delegate_all!(
10298
/// Future for the [`map_ok`](TryFutureExt::map_ok) method.
10399
MapOk<Fut, F>(
@@ -580,32 +576,4 @@ pub trait TryFutureExt: TryFuture {
580576
{
581577
Compat::new(self)
582578
}
583-
584-
/// Wraps a [`TryFuture`] into a type that implements
585-
/// [`Future`](std::future::Future).
586-
///
587-
/// [`TryFuture`]s currently do not implement the
588-
/// [`Future`](std::future::Future) trait due to limitations of the
589-
/// compiler.
590-
///
591-
/// # Examples
592-
///
593-
/// ```
594-
/// use futures::future::{Future, TryFuture, TryFutureExt};
595-
///
596-
/// # type T = i32;
597-
/// # type E = ();
598-
/// fn make_try_future() -> impl TryFuture<Ok = T, Error = E> { // ... }
599-
/// # async { Ok::<i32, ()>(1) }
600-
/// # }
601-
/// fn take_future(future: impl Future<Output = Result<T, E>>) { /* ... */ }
602-
///
603-
/// take_future(make_try_future().into_future());
604-
/// ```
605-
fn into_future(self) -> IntoFuture<Self>
606-
where
607-
Self: Sized,
608-
{
609-
assert_future::<Result<Self::Ok, Self::Error>, _>(IntoFuture::new(self))
610-
}
611579
}

futures/tests/auto_traits.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,6 @@ pub mod future {
333333
assert_impl!(InspectOk<UnpinFuture, PhantomPinned>: Unpin);
334334
assert_not_impl!(InspectOk<PhantomPinned, PhantomPinned>: Unpin);
335335

336-
assert_impl!(IntoFuture<SendFuture>: Send);
337-
assert_not_impl!(IntoFuture<LocalFuture>: Send);
338-
assert_impl!(IntoFuture<SyncFuture>: Sync);
339-
assert_not_impl!(IntoFuture<LocalFuture>: Sync);
340-
assert_impl!(IntoFuture<UnpinFuture>: Unpin);
341-
assert_not_impl!(IntoFuture<PinnedFuture>: Unpin);
342-
343336
assert_impl!(IntoStream<SendFuture>: Send);
344337
assert_not_impl!(IntoStream<LocalFuture>: Send);
345338
assert_impl!(IntoStream<SyncFuture>: Sync);

0 commit comments

Comments
 (0)