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

Stabilize async-await feature #1816

Merged
merged 1 commit into from Aug 22, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions .travis.yml
Expand Up @@ -39,7 +39,7 @@ matrix:
# This is the minimum Rust version supported by `async-await` feature.
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
- name: cargo +nightly build (minimum required version)
rust: nightly-2019-07-29
rust: nightly-2019-08-21
script:
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
- cargo build --all --all-features
Expand Down Expand Up @@ -139,9 +139,9 @@ matrix:
- cargo check --manifest-path futures-util/Cargo.toml --features sink
- cargo check --manifest-path futures-util/Cargo.toml --features io
- cargo check --manifest-path futures-util/Cargo.toml --features channel
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,async-await
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,join-macro
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,select-macro
- cargo check --manifest-path futures-util/Cargo.toml --features async-await
- cargo check --manifest-path futures-util/Cargo.toml --features join-macro
- cargo check --manifest-path futures-util/Cargo.toml --features select-macro
- cargo check --manifest-path futures-util/Cargo.toml --features compat
- cargo check --manifest-path futures-util/Cargo.toml --features io-compat
- cargo check --manifest-path futures-util/Cargo.toml --features sink,compat
Expand Down
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -58,16 +58,14 @@ futures-preview = { version = "=0.3.0-alpha.18", default-features = false }

### Feature `async-await`

The `async-await` feature provides several convenient features using unstable
async/await. Note that this is an unstable feature, and upstream changes might
prevent it from compiling. To use futures-rs with async/await, use:
The `async-await` feature provides several convenient features using async/await. To use futures-rs with async/await, use:

```toml
[dependencies]
futures-preview = { version = "=0.3.0-alpha.18", features = ["async-await", "nightly"] }
futures-preview = { version = "=0.3.0-alpha.18", features = ["async-await"] }
```

The current `async-await` feature requires Rust nightly 2019-07-29 or later.
The current `async-await` feature requires Rust nightly 2019-08-21 or later.

# License

Expand Down
2 changes: 0 additions & 2 deletions futures-channel/tests/channel.rs
@@ -1,5 +1,3 @@
#![feature(async_await)]

use futures::channel::mpsc;
use futures::executor::block_on;
use futures::future::poll_fn;
Expand Down
2 changes: 0 additions & 2 deletions futures-channel/tests/mpsc.rs
@@ -1,5 +1,3 @@
#![feature(async_await)]

use futures::channel::{mpsc, oneshot};
use futures::executor::{block_on, block_on_stream};
use futures::future::{FutureExt, poll_fn};
Expand Down
1 change: 0 additions & 1 deletion futures-executor/src/thread_pool.rs
Expand Up @@ -116,7 +116,6 @@ impl ThreadPool {
/// completion.
///
/// ```
/// #![feature(async_await)]
/// use futures::executor::ThreadPool;
///
/// let pool = ThreadPool::new().unwrap();
Expand Down
3 changes: 0 additions & 3 deletions futures-test/src/assert.rs
Expand Up @@ -9,7 +9,6 @@ pub fn assert_is_unpin_stream<S: Stream + Unpin>(_: &mut S) {}
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down Expand Up @@ -46,7 +45,6 @@ macro_rules! assert_stream_pending {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down Expand Up @@ -89,7 +87,6 @@ macro_rules! assert_stream_next {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down
3 changes: 0 additions & 3 deletions futures-test/src/future/mod.rs
Expand Up @@ -35,7 +35,6 @@ pub trait FutureTestExt: Future {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::future::FutureExt;
/// use futures_test::task::noop_context;
Expand All @@ -62,7 +61,6 @@ pub trait FutureTestExt: Future {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::channel::oneshot;
/// use futures_test::future::FutureTestExt;
Expand All @@ -88,7 +86,6 @@ pub trait FutureTestExt: Future {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::future::{self, Future};
/// use futures_test::task::noop_context;
Expand Down
3 changes: 0 additions & 3 deletions futures-test/src/io/read/mod.rs
Expand Up @@ -13,7 +13,6 @@ pub trait AsyncReadTestExt: AsyncRead {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::io::AsyncRead;
/// use futures_test::task::noop_context;
Expand Down Expand Up @@ -44,7 +43,6 @@ pub trait AsyncReadTestExt: AsyncRead {
/// The returned reader will also implement `AsyncBufRead` if the underlying reader does.
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::io::AsyncBufRead;
/// use futures_test::task::noop_context;
Expand Down Expand Up @@ -79,7 +77,6 @@ pub trait AsyncReadTestExt: AsyncRead {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::io::AsyncRead;
/// use futures_test::task::noop_context;
Expand Down
2 changes: 0 additions & 2 deletions futures-test/src/io/write/mod.rs
Expand Up @@ -13,7 +13,6 @@ pub trait AsyncWriteTestExt: AsyncWrite {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::io::AsyncWrite;
/// use futures_test::task::noop_context;
Expand Down Expand Up @@ -54,7 +53,6 @@ pub trait AsyncWriteTestExt: AsyncWrite {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::io::AsyncWrite;
/// use futures_test::task::noop_context;
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/stream/mod.rs
Expand Up @@ -12,7 +12,6 @@ pub trait StreamTestExt: Stream {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::stream::{self, Stream};
/// use futures_test::task::noop_context;
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/task/context.rs
Expand Up @@ -22,7 +22,6 @@ pub fn panic_context() -> Context<'static> {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::future::Future;
/// use futures::task::Poll;
/// use futures_test::task::noop_context;
Expand Down
2 changes: 0 additions & 2 deletions futures-test/src/task/noop_spawner.rs
Expand Up @@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::NoopSpawner;
///
Expand Down Expand Up @@ -46,7 +45,6 @@ impl Default for NoopSpawner {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::noop_spawner_mut;
///
Expand Down
2 changes: 0 additions & 2 deletions futures-test/src/task/panic_spawner.rs
Expand Up @@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```should_panic
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::PanicSpawner;
///
Expand Down Expand Up @@ -47,7 +46,6 @@ impl Default for PanicSpawner {
/// # Examples
///
/// ```should_panic
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::panic_spawner_mut;
///
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/task/panic_waker.rs
Expand Up @@ -46,7 +46,6 @@ pub fn panic_waker() -> Waker {
/// # Examples
///
/// ```should_panic
/// #![feature(async_await)]
/// use futures_test::task::panic_waker_ref;
///
/// let waker = panic_waker_ref();
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/task/record_spawner.rs
Expand Up @@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::RecordSpawner;
///
Expand Down
2 changes: 1 addition & 1 deletion futures-util/Cargo.toml
Expand Up @@ -47,7 +47,7 @@ tokio-io = { version = "0.1.9", optional = true }
pin-utils = "0.1.0-alpha.4"

[dev-dependencies]
futures-preview = { path = "../futures", version = "=0.3.0-alpha.18", features = ["async-await", "nightly"] }
futures-preview = { path = "../futures", version = "=0.3.0-alpha.18", features = ["async-await"] }
futures-test-preview = { path = "../futures-test", version = "=0.3.0-alpha.18" }
tokio = "0.1.11"

Expand Down
3 changes: 0 additions & 3 deletions futures-util/src/async_await/join_mod.rs
Expand Up @@ -19,7 +19,6 @@ macro_rules! document_join_macro {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::{join, future};
///
Expand Down Expand Up @@ -47,7 +46,6 @@ macro_rules! document_join_macro {
/// `Ok` of a tuple of the values:
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::{try_join, future};
///
Expand All @@ -62,7 +60,6 @@ macro_rules! document_join_macro {
/// that error:
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::{try_join, future};
///
Expand Down
3 changes: 0 additions & 3 deletions futures-util/src/async_await/select_mod.rs
Expand Up @@ -27,7 +27,6 @@ macro_rules! document_select_macro {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
/// use futures::select;
Expand All @@ -43,7 +42,6 @@ macro_rules! document_select_macro {
/// ```
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
/// use futures::stream::{self, StreamExt};
Expand All @@ -65,7 +63,6 @@ macro_rules! document_select_macro {
/// the case where all futures have completed.
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
/// use futures::select;
Expand Down
6 changes: 1 addition & 5 deletions futures-util/src/compat/compat01as03.rs
Expand Up @@ -68,7 +68,6 @@ pub trait Future01CompatExt: Future01 {
/// [`Future<Output = Result<T, E>>`](futures_core::future::Future).
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// # // TODO: These should be all using `futures::compat`, but that runs up against Cargo
/// # // feature issues
Expand All @@ -95,7 +94,6 @@ pub trait Stream01CompatExt: Stream01 {
/// [`Stream<Item = Result<T, E>>`](futures_core::stream::Stream).
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::stream::StreamExt;
/// use futures_util::compat::Stream01CompatExt;
Expand Down Expand Up @@ -124,7 +122,6 @@ pub trait Sink01CompatExt: Sink01 {
/// [`Sink<T, Error = E>`](futures_sink::Sink).
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::{sink::SinkExt, stream::StreamExt};
/// use futures_util::compat::{Stream01CompatExt, Sink01CompatExt};
Expand Down Expand Up @@ -383,7 +380,7 @@ mod io {
/// [`AsyncRead`](futures_io::AsyncRead).
///
/// ```
/// #![feature(async_await, impl_trait_in_bindings)]
/// #![feature(impl_trait_in_bindings)]
/// # #![allow(incomplete_features)]
/// # futures::executor::block_on(async {
/// use futures::io::AsyncReadExt;
Expand Down Expand Up @@ -413,7 +410,6 @@ mod io {
/// [`AsyncWrite`](futures_io::AsyncWrite).
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::io::AsyncWriteExt;
/// use futures_util::compat::AsyncWrite01CompatExt;
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/compat/executor.rs
Expand Up @@ -22,7 +22,6 @@ pub trait Executor01CompatExt: Executor01<Executor01Future> +
/// futures 0.3 [`Spawn`](futures_core::task::Spawn).
///
/// ```
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures::future::{FutureExt, TryFutureExt};
/// use futures_util::compat::Executor01CompatExt;
Expand Down
2 changes: 0 additions & 2 deletions futures-util/src/future/abortable.rs
Expand Up @@ -29,7 +29,6 @@ impl<Fut> Abortable<Fut> where Fut: Future {
/// Example:
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};
///
Expand Down Expand Up @@ -70,7 +69,6 @@ impl AbortHandle {
/// Example:
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};
///
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/future/fuse.rs
Expand Up @@ -27,7 +27,6 @@ impl<Fut: Future> Fuse<Fut> {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::channel::mpsc;
/// use futures::future::{Fuse, FusedFuture, FutureExt};
Expand Down
4 changes: 0 additions & 4 deletions futures-util/src/future/join.rs
Expand Up @@ -90,7 +90,6 @@ generate! {
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
///
Expand All @@ -115,7 +114,6 @@ where
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
///
Expand Down Expand Up @@ -145,7 +143,6 @@ where
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
///
Expand Down Expand Up @@ -178,7 +175,6 @@ where
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
///
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/future/join_all.rs
Expand Up @@ -102,7 +102,6 @@ where
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future::{join_all};
///
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/future/lazy.rs
Expand Up @@ -19,7 +19,6 @@ impl<F> Unpin for Lazy<F> {}
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
///
Expand Down
1 change: 0 additions & 1 deletion futures-util/src/future/maybe_done.rs
Expand Up @@ -27,7 +27,6 @@ impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut> {}
/// # Examples
///
/// ```
/// #![feature(async_await)]
/// # futures::executor::block_on(async {
/// use futures::future;
/// use futures::pin_mut;
Expand Down