Skip to content

Commit cde791c

Browse files
taiki-ecramertj
authored andcommitted
Stabilize async-await feature
1 parent 7902054 commit cde791c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+9
-186
lines changed

.travis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ matrix:
3939
# This is the minimum Rust version supported by `async-await` feature.
4040
# When updating this, the reminder to update the minimum required version of `async-await` feature in README.md.
4141
- name: cargo +nightly build (minimum required version)
42-
rust: nightly-2019-07-29
42+
rust: nightly-2019-08-21
4343
script:
4444
- cargo run --manifest-path ci/remove-dev-dependencies/Cargo.toml */Cargo.toml
4545
- cargo build --all --all-features
@@ -139,9 +139,9 @@ matrix:
139139
- cargo check --manifest-path futures-util/Cargo.toml --features sink
140140
- cargo check --manifest-path futures-util/Cargo.toml --features io
141141
- cargo check --manifest-path futures-util/Cargo.toml --features channel
142-
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,async-await
143-
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,join-macro
144-
- cargo check --manifest-path futures-util/Cargo.toml --features nightly,select-macro
142+
- cargo check --manifest-path futures-util/Cargo.toml --features async-await
143+
- cargo check --manifest-path futures-util/Cargo.toml --features join-macro
144+
- cargo check --manifest-path futures-util/Cargo.toml --features select-macro
145145
- cargo check --manifest-path futures-util/Cargo.toml --features compat
146146
- cargo check --manifest-path futures-util/Cargo.toml --features io-compat
147147
- cargo check --manifest-path futures-util/Cargo.toml --features sink,compat

README.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,14 @@ futures-preview = { version = "=0.3.0-alpha.18", default-features = false }
5858

5959
### Feature `async-await`
6060

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

6563
```toml
6664
[dependencies]
67-
futures-preview = { version = "=0.3.0-alpha.18", features = ["async-await", "nightly"] }
65+
futures-preview = { version = "=0.3.0-alpha.18", features = ["async-await"] }
6866
```
6967

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

7270
# License
7371

futures-channel/tests/channel.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(async_await)]
2-
31
use futures::channel::mpsc;
42
use futures::executor::block_on;
53
use futures::future::poll_fn;

futures-channel/tests/mpsc.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![feature(async_await)]
2-
31
use futures::channel::{mpsc, oneshot};
42
use futures::executor::{block_on, block_on_stream};
53
use futures::future::{FutureExt, poll_fn};

futures-executor/src/thread_pool.rs

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ impl ThreadPool {
116116
/// completion.
117117
///
118118
/// ```
119-
/// #![feature(async_await)]
120119
/// use futures::executor::ThreadPool;
121120
///
122121
/// let pool = ThreadPool::new().unwrap();

futures-test/src/assert.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ pub fn assert_is_unpin_stream<S: Stream + Unpin>(_: &mut S) {}
99
/// # Examples
1010
///
1111
/// ```
12-
/// #![feature(async_await)]
1312
/// use futures::stream;
1413
/// use futures_test::future::FutureTestExt;
1514
/// use futures_test::{
@@ -46,7 +45,6 @@ macro_rules! assert_stream_pending {
4645
/// # Examples
4746
///
4847
/// ```
49-
/// #![feature(async_await)]
5048
/// use futures::stream;
5149
/// use futures_test::future::FutureTestExt;
5250
/// use futures_test::{
@@ -89,7 +87,6 @@ macro_rules! assert_stream_next {
8987
/// # Examples
9088
///
9189
/// ```
92-
/// #![feature(async_await)]
9390
/// use futures::stream;
9491
/// use futures_test::future::FutureTestExt;
9592
/// use futures_test::{

futures-test/src/future/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ pub trait FutureTestExt: Future {
3535
/// # Examples
3636
///
3737
/// ```
38-
/// #![feature(async_await)]
3938
/// use futures::task::Poll;
4039
/// use futures::future::FutureExt;
4140
/// use futures_test::task::noop_context;
@@ -62,7 +61,6 @@ pub trait FutureTestExt: Future {
6261
/// # Examples
6362
///
6463
/// ```
65-
/// #![feature(async_await)]
6664
/// # futures::executor::block_on(async {
6765
/// use futures::channel::oneshot;
6866
/// use futures_test::future::FutureTestExt;
@@ -88,7 +86,6 @@ pub trait FutureTestExt: Future {
8886
/// # Examples
8987
///
9088
/// ```
91-
/// #![feature(async_await)]
9289
/// use futures::task::Poll;
9390
/// use futures::future::{self, Future};
9491
/// use futures_test::task::noop_context;

futures-test/src/io/read/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub trait AsyncReadTestExt: AsyncRead {
1313
/// # Examples
1414
///
1515
/// ```
16-
/// #![feature(async_await)]
1716
/// use futures::task::Poll;
1817
/// use futures::io::AsyncRead;
1918
/// use futures_test::task::noop_context;
@@ -44,7 +43,6 @@ pub trait AsyncReadTestExt: AsyncRead {
4443
/// The returned reader will also implement `AsyncBufRead` if the underlying reader does.
4544
///
4645
/// ```
47-
/// #![feature(async_await)]
4846
/// use futures::task::Poll;
4947
/// use futures::io::AsyncBufRead;
5048
/// use futures_test::task::noop_context;
@@ -79,7 +77,6 @@ pub trait AsyncReadTestExt: AsyncRead {
7977
/// # Examples
8078
///
8179
/// ```
82-
/// #![feature(async_await)]
8380
/// use futures::task::Poll;
8481
/// use futures::io::AsyncRead;
8582
/// use futures_test::task::noop_context;

futures-test/src/io/write/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ pub trait AsyncWriteTestExt: AsyncWrite {
1313
/// # Examples
1414
///
1515
/// ```
16-
/// #![feature(async_await)]
1716
/// use futures::task::Poll;
1817
/// use futures::io::AsyncWrite;
1918
/// use futures_test::task::noop_context;
@@ -54,7 +53,6 @@ pub trait AsyncWriteTestExt: AsyncWrite {
5453
/// # Examples
5554
///
5655
/// ```
57-
/// #![feature(async_await)]
5856
/// use futures::task::Poll;
5957
/// use futures::io::AsyncWrite;
6058
/// use futures_test::task::noop_context;

futures-test/src/stream/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ pub trait StreamTestExt: Stream {
1212
/// # Examples
1313
///
1414
/// ```
15-
/// #![feature(async_await)]
1615
/// use futures::task::Poll;
1716
/// use futures::stream::{self, Stream};
1817
/// use futures_test::task::noop_context;

futures-test/src/task/context.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub fn panic_context() -> Context<'static> {
2222
/// # Examples
2323
///
2424
/// ```
25-
/// #![feature(async_await)]
2625
/// use futures::future::Future;
2726
/// use futures::task::Poll;
2827
/// use futures_test::task::noop_context;

futures-test/src/task/noop_spawner.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```
10-
/// #![feature(async_await)]
1110
/// use futures::task::SpawnExt;
1211
/// use futures_test::task::NoopSpawner;
1312
///
@@ -46,7 +45,6 @@ impl Default for NoopSpawner {
4645
/// # Examples
4746
///
4847
/// ```
49-
/// #![feature(async_await)]
5048
/// use futures::task::SpawnExt;
5149
/// use futures_test::task::noop_spawner_mut;
5250
///

futures-test/src/task/panic_spawner.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```should_panic
10-
/// #![feature(async_await)]
1110
/// use futures::task::SpawnExt;
1211
/// use futures_test::task::PanicSpawner;
1312
///
@@ -47,7 +46,6 @@ impl Default for PanicSpawner {
4746
/// # Examples
4847
///
4948
/// ```should_panic
50-
/// #![feature(async_await)]
5149
/// use futures::task::SpawnExt;
5250
/// use futures_test::task::panic_spawner_mut;
5351
///

futures-test/src/task/panic_waker.rs

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ pub fn panic_waker() -> Waker {
4646
/// # Examples
4747
///
4848
/// ```should_panic
49-
/// #![feature(async_await)]
5049
/// use futures_test::task::panic_waker_ref;
5150
///
5251
/// let waker = panic_waker_ref();

futures-test/src/task/record_spawner.rs

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use futures_core::task::{Spawn, SpawnError};
77
/// # Examples
88
///
99
/// ```
10-
/// #![feature(async_await)]
1110
/// use futures::task::SpawnExt;
1211
/// use futures_test::task::RecordSpawner;
1312
///

futures-util/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ tokio-io = { version = "0.1.9", optional = true }
4747
pin-utils = "0.1.0-alpha.4"
4848

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

futures-util/src/async_await/join_mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ macro_rules! document_join_macro {
1919
/// # Examples
2020
///
2121
/// ```
22-
/// #![feature(async_await)]
2322
/// # futures::executor::block_on(async {
2423
/// use futures::{join, future};
2524
///
@@ -47,7 +46,6 @@ macro_rules! document_join_macro {
4746
/// `Ok` of a tuple of the values:
4847
///
4948
/// ```
50-
/// #![feature(async_await)]
5149
/// # futures::executor::block_on(async {
5250
/// use futures::{try_join, future};
5351
///
@@ -62,7 +60,6 @@ macro_rules! document_join_macro {
6260
/// that error:
6361
///
6462
/// ```
65-
/// #![feature(async_await)]
6663
/// # futures::executor::block_on(async {
6764
/// use futures::{try_join, future};
6865
///

futures-util/src/async_await/select_mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ macro_rules! document_select_macro {
2727
/// # Examples
2828
///
2929
/// ```
30-
/// #![feature(async_await)]
3130
/// # futures::executor::block_on(async {
3231
/// use futures::future;
3332
/// use futures::select;
@@ -43,7 +42,6 @@ macro_rules! document_select_macro {
4342
/// ```
4443
///
4544
/// ```
46-
/// #![feature(async_await)]
4745
/// # futures::executor::block_on(async {
4846
/// use futures::future;
4947
/// use futures::stream::{self, StreamExt};
@@ -65,7 +63,6 @@ macro_rules! document_select_macro {
6563
/// the case where all futures have completed.
6664
///
6765
/// ```
68-
/// #![feature(async_await)]
6966
/// # futures::executor::block_on(async {
7067
/// use futures::future;
7168
/// use futures::select;

futures-util/src/compat/compat01as03.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ pub trait Future01CompatExt: Future01 {
6868
/// [`Future<Output = Result<T, E>>`](futures_core::future::Future).
6969
///
7070
/// ```
71-
/// #![feature(async_await)]
7271
/// # futures::executor::block_on(async {
7372
/// # // TODO: These should be all using `futures::compat`, but that runs up against Cargo
7473
/// # // feature issues
@@ -95,7 +94,6 @@ pub trait Stream01CompatExt: Stream01 {
9594
/// [`Stream<Item = Result<T, E>>`](futures_core::stream::Stream).
9695
///
9796
/// ```
98-
/// #![feature(async_await)]
9997
/// # futures::executor::block_on(async {
10098
/// use futures::stream::StreamExt;
10199
/// use futures_util::compat::Stream01CompatExt;
@@ -124,7 +122,6 @@ pub trait Sink01CompatExt: Sink01 {
124122
/// [`Sink<T, Error = E>`](futures_sink::Sink).
125123
///
126124
/// ```
127-
/// #![feature(async_await)]
128125
/// # futures::executor::block_on(async {
129126
/// use futures::{sink::SinkExt, stream::StreamExt};
130127
/// use futures_util::compat::{Stream01CompatExt, Sink01CompatExt};
@@ -383,7 +380,7 @@ mod io {
383380
/// [`AsyncRead`](futures_io::AsyncRead).
384381
///
385382
/// ```
386-
/// #![feature(async_await, impl_trait_in_bindings)]
383+
/// #![feature(impl_trait_in_bindings)]
387384
/// # #![allow(incomplete_features)]
388385
/// # futures::executor::block_on(async {
389386
/// use futures::io::AsyncReadExt;
@@ -413,7 +410,6 @@ mod io {
413410
/// [`AsyncWrite`](futures_io::AsyncWrite).
414411
///
415412
/// ```
416-
/// #![feature(async_await)]
417413
/// # futures::executor::block_on(async {
418414
/// use futures::io::AsyncWriteExt;
419415
/// use futures_util::compat::AsyncWrite01CompatExt;

futures-util/src/compat/executor.rs

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ pub trait Executor01CompatExt: Executor01<Executor01Future> +
2222
/// futures 0.3 [`Spawn`](futures_core::task::Spawn).
2323
///
2424
/// ```
25-
/// #![feature(async_await)]
2625
/// use futures::task::SpawnExt;
2726
/// use futures::future::{FutureExt, TryFutureExt};
2827
/// use futures_util::compat::Executor01CompatExt;

futures-util/src/future/abortable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ impl<Fut> Abortable<Fut> where Fut: Future {
2929
/// Example:
3030
///
3131
/// ```
32-
/// #![feature(async_await)]
3332
/// # futures::executor::block_on(async {
3433
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};
3534
///
@@ -70,7 +69,6 @@ impl AbortHandle {
7069
/// Example:
7170
///
7271
/// ```
73-
/// #![feature(async_await)]
7472
/// # futures::executor::block_on(async {
7573
/// use futures::future::{ready, Abortable, AbortHandle, Aborted};
7674
///

futures-util/src/future/fuse.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl<Fut: Future> Fuse<Fut> {
2727
/// # Examples
2828
///
2929
/// ```
30-
/// #![feature(async_await)]
3130
/// # futures::executor::block_on(async {
3231
/// use futures::channel::mpsc;
3332
/// use futures::future::{Fuse, FusedFuture, FutureExt};

futures-util/src/future/join.rs

-4
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ generate! {
9090
/// # Examples
9191
///
9292
/// ```
93-
/// #![feature(async_await)]
9493
/// # futures::executor::block_on(async {
9594
/// use futures::future;
9695
///
@@ -115,7 +114,6 @@ where
115114
/// # Examples
116115
///
117116
/// ```
118-
/// #![feature(async_await)]
119117
/// # futures::executor::block_on(async {
120118
/// use futures::future;
121119
///
@@ -145,7 +143,6 @@ where
145143
/// # Examples
146144
///
147145
/// ```
148-
/// #![feature(async_await)]
149146
/// # futures::executor::block_on(async {
150147
/// use futures::future;
151148
///
@@ -178,7 +175,6 @@ where
178175
/// # Examples
179176
///
180177
/// ```
181-
/// #![feature(async_await)]
182178
/// # futures::executor::block_on(async {
183179
/// use futures::future;
184180
///

futures-util/src/future/join_all.rs

-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ where
102102
/// # Examples
103103
///
104104
/// ```
105-
/// #![feature(async_await)]
106105
/// # futures::executor::block_on(async {
107106
/// use futures::future::{join_all};
108107
///

futures-util/src/future/lazy.rs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ impl<F> Unpin for Lazy<F> {}
1919
/// # Examples
2020
///
2121
/// ```
22-
/// #![feature(async_await)]
2322
/// # futures::executor::block_on(async {
2423
/// use futures::future;
2524
///

futures-util/src/future/maybe_done.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ impl<Fut: Future + Unpin> Unpin for MaybeDone<Fut> {}
2727
/// # Examples
2828
///
2929
/// ```
30-
/// #![feature(async_await)]
3130
/// # futures::executor::block_on(async {
3231
/// use futures::future;
3332
/// use futures::pin_mut;

0 commit comments

Comments
 (0)