Skip to content
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

Merged
merged 1 commit into from
May 23, 2020
Merged

Add core::future::IntoFuture #72459

merged 1 commit into from
May 23, 2020

Conversation

yoshuawuyts
Copy link
Member

@yoshuawuyts yoshuawuyts commented May 22, 2020

This patch reintroduces the core::future::IntoFuture trait. However unlike earlier PRs this patch does not integrate it into the async/.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 the IntoFuture trait today. Thanks heaps!

cc/ @rust-lang/wg-async-foundations

References

@rust-highfive
Copy link
Collaborator

r? @LukasKalbertodt

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 22, 2020
Comment on lines 3 to 17
#[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;
Copy link
Member Author

@yoshuawuyts yoshuawuyts May 22, 2020

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.
@jonas-schievink
Copy link
Contributor

r? @tmandry

@nikomatsakis
Copy link
Contributor

@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.

@bors
Copy link
Contributor

bors commented May 22, 2020

📌 Commit 9ff5020 has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request May 23, 2020
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
@bors bors merged commit 141ce5f into rust-lang:master May 23, 2020
@yoshuawuyts yoshuawuyts deleted the into-future branch May 25, 2020 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants