Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions library/core/src/future/into_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ pub trait IntoFuture {

/// Which kind of future are we turning this into?
#[unstable(feature = "into_future", issue = "67644")]
type Future: Future<Output = Self::Output>;
type IntoFuture: Future<Output = Self::Output>;

/// Creates a future from a value.
#[unstable(feature = "into_future", issue = "67644")]
#[lang = "into_future"]
fn into_future(self) -> Self::Future;
fn into_future(self) -> Self::IntoFuture;
}

#[unstable(feature = "into_future", issue = "67644")]
impl<F: Future> IntoFuture for F {
type Output = F::Output;
type Future = F;
type IntoFuture = F;

fn into_future(self) -> Self::Future {
fn into_future(self) -> Self::IntoFuture {
self
}
}
4 changes: 2 additions & 2 deletions src/test/ui/async-await/await-into-future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ struct AwaitMe;

impl IntoFuture for AwaitMe {
type Output = i32;
type Future = Pin<Box<dyn Future<Output = i32>>>;
type IntoFuture = Pin<Box<dyn Future<Output = i32>>>;

fn into_future(self) -> Self::Future {
fn into_future(self) -> Self::IntoFuture {
Box::pin(me())
}
}
Expand Down