diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-05-22 21:45:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-22 21:45:01 +0200 |
| commit | 141ce5f2ad043efdf902d0d005b7a9bfa8cb63c4 (patch) | |
| tree | 19746f2ce7064656b14dd158429020b5e769cad4 /src/libstd | |
| parent | 3083ce7ab127dfd1cbb453810579ca827dcfd7bb (diff) | |
| parent | 9ff502029d379bebc50cf92a97f019fefba09d79 (diff) | |
| download | rust-141ce5f2ad043efdf902d0d005b7a9bfa8cb63c4.tar.gz rust-141ce5f2ad043efdf902d0d005b7a9bfa8cb63c4.zip | |
Rollup merge of #72459 - yoshuawuyts:into-future, r=nikomatsakis
Add core::future::IntoFuture 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 - Original PR adding `IntoFuture` https://github.com/rust-lang/rust/pull/65244 - Open issue to re-land `IntoFuture` (assigned to me) https://github.com/rust-lang/rust/issues/67982 - Tracking issue for `IntoFuture` https://github.com/rust-lang/rust/issues/67644
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/future.rs | 14 | ||||
| -rw-r--r-- | src/libstd/lib.rs | 3 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/libstd/future.rs b/src/libstd/future.rs index e2092cfefa3..89dd9fb9b2c 100644 --- a/src/libstd/future.rs +++ b/src/libstd/future.rs @@ -2,4 +2,16 @@ #[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::{pending, ready, Pending, Ready}; + +#[doc(inline)] +#[unstable(feature = "into_future", issue = "67644")] +pub use core::future::IntoFuture; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index ac07af5e278..cc3e613fa3d 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -266,12 +266,15 @@ #![feature(external_doc)] #![feature(fn_traits)] #![feature(format_args_nl)] +#![feature(future_readiness_fns)] +#![feature(gen_future)] #![feature(generator_trait)] #![feature(global_asm)] #![feature(hash_raw_entry)] #![feature(hashmap_internals)] #![feature(int_error_internals)] #![feature(int_error_matching)] +#![feature(into_future)] #![feature(integer_atomics)] #![feature(lang_items)] #![feature(libc)] |
