From 992cfc16839d701e17f0437585a44102e83d4d14 Mon Sep 17 00:00:00 2001 From: Yoshua Wuyts <2467194+yoshuawuyts@users.noreply.github.com> Date: Thu, 30 Jun 2022 16:54:03 +0200 Subject: [PATCH] Stabilize `into_future` --- library/core/src/future/into_future.rs | 18 +++++------------- library/core/src/future/mod.rs | 2 +- src/test/ui/async-await/await-into-future.rs | 2 -- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/library/core/src/future/into_future.rs b/library/core/src/future/into_future.rs index ad9e80e117f1e..649b433877222 100644 --- a/library/core/src/future/into_future.rs +++ b/library/core/src/future/into_future.rs @@ -13,8 +13,6 @@ use crate::future::Future; /// on all futures. /// /// ```no_run -/// #![feature(into_future)] -/// /// use std::future::IntoFuture; /// /// # async fn foo() { @@ -33,8 +31,6 @@ use crate::future::Future; /// multiple times before being `.await`ed. /// /// ```rust -/// #![feature(into_future)] -/// /// use std::future::{ready, Ready, IntoFuture}; /// /// /// Eventually multiply two numbers @@ -91,8 +87,6 @@ use crate::future::Future; /// `IntoFuture::into_future` to obtain an instance of `Future`: /// /// ```rust -/// #![feature(into_future)] -/// /// use std::future::IntoFuture; /// /// /// Convert the output of a future to a string. @@ -104,14 +98,14 @@ use crate::future::Future; /// format!("{:?}", fut.await) /// } /// ``` -#[unstable(feature = "into_future", issue = "67644")] +#[stable(feature = "into_future", since = "1.64.0")] pub trait IntoFuture { /// The output that the future will produce on completion. - #[unstable(feature = "into_future", issue = "67644")] + #[stable(feature = "into_future", since = "1.64.0")] type Output; /// Which kind of future are we turning this into? - #[unstable(feature = "into_future", issue = "67644")] + #[stable(feature = "into_future", since = "1.64.0")] type IntoFuture: Future; /// Creates a future from a value. @@ -121,8 +115,6 @@ pub trait IntoFuture { /// Basic usage: /// /// ```no_run - /// #![feature(into_future)] - /// /// use std::future::IntoFuture; /// /// # async fn foo() { @@ -131,12 +123,12 @@ pub trait IntoFuture { /// assert_eq!("meow", fut.await); /// # } /// ``` - #[unstable(feature = "into_future", issue = "67644")] + #[stable(feature = "into_future", since = "1.64.0")] #[lang = "into_future"] fn into_future(self) -> Self::IntoFuture; } -#[unstable(feature = "into_future", issue = "67644")] +#[stable(feature = "into_future", since = "1.64.0")] impl IntoFuture for F { type Output = F::Output; type IntoFuture = F; diff --git a/library/core/src/future/mod.rs b/library/core/src/future/mod.rs index 9b89f766c67bf..90eecb9d4a000 100644 --- a/library/core/src/future/mod.rs +++ b/library/core/src/future/mod.rs @@ -29,7 +29,7 @@ pub use self::future::Future; #[unstable(feature = "future_join", issue = "91642")] pub use self::join::join; -#[unstable(feature = "into_future", issue = "67644")] +#[stable(feature = "into_future", since = "1.64.0")] pub use into_future::IntoFuture; #[stable(feature = "future_readiness_fns", since = "1.48.0")] diff --git a/src/test/ui/async-await/await-into-future.rs b/src/test/ui/async-await/await-into-future.rs index 6e1b155e181ee..8bf1385b3c5cd 100644 --- a/src/test/ui/async-await/await-into-future.rs +++ b/src/test/ui/async-await/await-into-future.rs @@ -1,8 +1,6 @@ // run-pass // aux-build: issue-72470-lib.rs // edition:2021 -#![feature(into_future)] - extern crate issue_72470_lib; use std::{future::{Future, IntoFuture}, pin::Pin};