-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add core::future::IntoFuture #72459
Add core::future::IntoFuture #72459
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
src/libstd/future.rs
Outdated
#[doc(inline)] | ||
#[stable(feature = "futures_api", since = "1.36.0")] | ||
pub use core::future::*; | ||
pub use core::future::Future; | ||
|
||
#[doc(inline)] | ||
#[unstable(feature = "gen_future", issue = "50547")] | ||
pub use core::future::{from_generator, get_context, ResumeTy}; | ||
|
||
#[doc(inline)] | ||
#[unstable(feature = "future_readiness_fns", issue = "70921")] | ||
pub use core::future::{ready, Ready, pending, Pending}; | ||
|
||
#[doc(inline)] | ||
#[unstable(feature = "into_future", issue = "67644")] | ||
pub use core::future::IntoFuture; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CI was failing because the core::future::*
export was exporting more than it promised. This splits up the catch-all export into individual exports and correctly marks their stability guarantees.
This patch adds `core::future::IntoFuture`. However unlike earlier PRs this patch does not integrate it into the `async/.await` lowering. That integration should be done in a follow-up PR.
r? @tmandry |
@bors r+ rollup On the original PRs we already decided that we approve the concept, so I see no reason not to add unstable traits. |
📌 Commit 9ff5020 has been approved by |
Rollup of 7 pull requests Successful merges: - rust-lang#71289 (Allow using `Self::` in doc) - rust-lang#72375 (Improve E0599 explanation) - rust-lang#72385 (Add some teams to prioritization exclude_labels) - rust-lang#72395 (Allow rust-highfive to label issues it creates.) - rust-lang#72453 (Add flag to open docs: x.py doc --open) - rust-lang#72459 (Add core::future::IntoFuture) - rust-lang#72461 (Clean up E0600 explanation) Failed merges: r? @ghost
This patch reintroduces the
core::future::IntoFuture
trait. However unlike earlier PRs this patch does not integrate it into theasync/.await
lowering since that lead to performance regressions. By introducing the trait separately from the integration, the integration PR can be more narrowly scoped, and people can start trying out theIntoFuture
trait today. Thanks heaps!cc/ @rust-lang/wg-async-foundations
References
IntoFuture
add IntoFuture trait and support for await #65244IntoFuture
(assigned to me) Re-land "add IntoFuture trait and support for await" #67982IntoFuture
Tracking issue forIntoFuture
#67644