Skip to content

Commit

Permalink
Update to stabilized futures_api
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e authored and cramertj committed Apr 25, 2019
1 parent 5f866c4 commit bbbfbb7
Show file tree
Hide file tree
Showing 76 changed files with 112 additions and 176 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ matrix:

# When updating this, the reminder to update the minimum required version in README.md.
- name: cargo test (minimum required version)
rust: nightly-2019-04-15
rust: nightly-2019-04-25

- name: cargo clippy
rust: nightly
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Now, you can use futures-rs:
use futures::future::Future; // Note: It's not `futures_preview`
```

The current version of futures-rs requires Rust nightly 2019-04-15 or later.
The current version of futures-rs requires Rust nightly 2019-04-25 or later.

### Feature `std`

Expand Down
2 changes: 1 addition & 1 deletion futures-channel/benches/sync_mpsc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(test, futures_api)]
#![feature(test)]

extern crate test;
use crate::test::Bencher;
Expand Down
2 changes: 0 additions & 2 deletions futures-channel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//! This crate provides channels that can be used to communicate between
//! asynchronous tasks.
#![feature(futures_api)]

#![cfg_attr(not(feature = "std"), no_std)]

#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
Expand Down
2 changes: 1 addition & 1 deletion futures-channel/tests/channel.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(async_await, await_macro, futures_api)]
#![feature(async_await, await_macro)]

use futures::channel::mpsc;
use futures::executor::block_on;
Expand Down
2 changes: 1 addition & 1 deletion futures-channel/tests/mpsc.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(futures_api, async_await, await_macro)]
#![feature(async_await, await_macro)]

use futures::channel::{mpsc, oneshot};
use futures::executor::{block_on, block_on_stream};
Expand Down
2 changes: 0 additions & 2 deletions futures-channel/tests/oneshot.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(futures_api)]

use futures::channel::oneshot::{self, Sender};
use futures::executor::block_on;
use futures::future::{Future, FutureExt, poll_fn};
Expand Down
1 change: 0 additions & 1 deletion futures-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
//! Core traits and types for asynchronous operations in Rust.
#![feature(futures_api)]
#![cfg_attr(feature = "cfg-target-has-atomic", feature(cfg_target_has_atomic))]

#![cfg_attr(not(feature = "std"), no_std)]
Expand Down
1 change: 0 additions & 1 deletion futures-core/src/task/__internal/atomic_waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ impl AtomicWaker {
/// Here is how `register` is used when implementing a flag.
///
/// ```
/// #![feature(futures_api)]
/// use futures::future::Future;
/// use futures::task::{Context, Poll, AtomicWaker};
/// use std::sync::atomic::AtomicBool;
Expand Down
2 changes: 1 addition & 1 deletion futures-executor/benches/thread_notify.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(test, futures_api)]
#![feature(test)]

extern crate test;
use crate::test::Bencher;
Expand Down
2 changes: 0 additions & 2 deletions futures-executor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! Built-in executors and related tools.
#![feature(futures_api)]

#![cfg_attr(not(feature = "std"), no_std)]

#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
Expand Down
3 changes: 0 additions & 3 deletions futures-executor/src/local_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ impl LocalPool {
/// the `LocalPool` by using its spawner handle:
///
/// ```
/// #![feature(futures_api)]
/// use futures::executor::LocalPool;
/// use futures::future::ready;
///
Expand Down Expand Up @@ -170,7 +169,6 @@ impl LocalPool {
/// can be made. Returns `true` if one future was completed, `false` otherwise.
///
/// ```
/// #![feature(futures_api)]
/// use futures::executor::LocalPool;
/// use futures::task::LocalSpawnExt;
/// use futures::future::{ready, empty};
Expand Down Expand Up @@ -211,7 +209,6 @@ impl LocalPool {
/// on any task.
///
/// ```
/// #![feature(futures_api)]
/// use futures::executor::LocalPool;
/// use futures::task::LocalSpawnExt;
/// use futures::future::{ready, empty};
Expand Down
2 changes: 0 additions & 2 deletions futures-executor/tests/local_pool.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(futures_api)]

use futures::channel::oneshot;
use futures::executor::LocalPool;
use futures::future::{Future, lazy, poll_fn};
Expand Down
2 changes: 0 additions & 2 deletions futures-io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.14/futures_io")]

#![feature(futures_api)]

#[cfg(feature = "std")]
mod if_std {
use futures_core::task::{Context, Poll};
Expand Down
2 changes: 0 additions & 2 deletions futures-io/tests/cursor.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(futures_api)]

use assert_matches::assert_matches;
use futures::Poll;
use futures::future::lazy;
Expand Down
2 changes: 0 additions & 2 deletions futures-sink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(html_root_url = "https://rust-lang-nursery.github.io/futures-api-docs/0.3.0-alpha.14/futures_sink")]

#![feature(futures_api)]

#[cfg(feature = "alloc")]
extern crate alloc;

Expand Down
6 changes: 3 additions & 3 deletions futures-test/src/assert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub fn assert_is_unpin_stream<S: Stream + Unpin>(_: &mut S) {}
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down Expand Up @@ -46,7 +46,7 @@ macro_rules! assert_stream_pending {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down Expand Up @@ -89,7 +89,7 @@ macro_rules! assert_stream_next {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::stream;
/// use futures_test::future::FutureTestExt;
/// use futures_test::{
Expand Down
4 changes: 2 additions & 2 deletions futures-test/src/future/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub trait FutureTestExt: Future {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::Poll;
/// use futures::future::FutureExt;
/// use futures_test::task::noop_context;
Expand All @@ -60,7 +60,7 @@ pub trait FutureTestExt: Future {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::channel::oneshot;
/// use futures::executor::block_on;
/// use futures_test::future::FutureTestExt;
Expand Down
6 changes: 1 addition & 5 deletions futures-test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
//! Utilities to make testing [`Future`s](futures_core::Future) easier
#![feature(
async_await,
await_macro,
futures_api,
)]
#![feature(async_await, await_macro)]
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#![doc(
html_root_url = "https://rust-lang-nursery.github.io/futures-doc/0.3.0-alpha.5/futures_test"
Expand Down
3 changes: 1 addition & 2 deletions futures-test/src/task/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use futures_core::task::Context;
/// # Examples
///
/// ```should_panic
/// #![feature(futures_api)]
/// use futures_test::task::panic_context;
///
/// let cx = panic_context();
Expand All @@ -23,7 +22,7 @@ pub fn panic_context() -> Context<'static> {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::future::Future;
/// use futures::task::Poll;
/// use futures_test::task::noop_context;
Expand Down
4 changes: 2 additions & 2 deletions futures-test/src/task/noop_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::NoopSpawner;
///
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Default for NoopSpawner {
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::noop_spawner_mut;
///
Expand Down
4 changes: 2 additions & 2 deletions futures-test/src/task/panic_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```should_panic
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::PanicSpawner;
///
Expand Down Expand Up @@ -46,7 +46,7 @@ impl Default for PanicSpawner {
/// # Examples
///
/// ```should_panic
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::panic_spawner_mut;
///
Expand Down
3 changes: 1 addition & 2 deletions futures-test/src/task/panic_waker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ fn raw_panic_waker() -> RawWaker {
/// # Examples
///
/// ```should_panic
/// #![feature(futures_api)]
/// use futures_test::task::panic_waker;
///
/// let waker = panic_waker();
Expand All @@ -47,7 +46,7 @@ pub fn panic_waker() -> Waker {
/// # Examples
///
/// ```should_panic
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task;
/// use futures_test::task::panic_waker_ref;
///
Expand Down
2 changes: 1 addition & 1 deletion futures-test/src/task/record_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use futures_core::task::{Spawn, SpawnError};
/// # Examples
///
/// ```
/// #![feature(async_await, futures_api)]
/// #![feature(async_await)]
/// use futures::task::SpawnExt;
/// use futures_test::task::RecordSpawner;
///
Expand Down
1 change: 0 additions & 1 deletion futures-test/src/task/wake_counter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ impl ArcWake for WakerInner {
/// # Examples
///
/// ```
/// #![feature(futures_api)]
/// use futures_test::task::new_count_waker;
///
/// let (waker, count) = new_count_waker();
Expand Down
2 changes: 1 addition & 1 deletion futures-util/benches/futures_unordered.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![feature(test, futures_api)]
#![feature(test)]

extern crate test;
use crate::test::Bencher;
Expand Down
6 changes: 3 additions & 3 deletions futures-util/src/async_await/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/// # Examples
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::{join, future};
///
Expand Down Expand Up @@ -60,7 +60,7 @@ macro_rules! join {
/// `Ok` of a tuple of the values:
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::{try_join, future};
///
Expand All @@ -75,7 +75,7 @@ macro_rules! join {
/// that error:
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::{try_join, future};
///
Expand Down
6 changes: 3 additions & 3 deletions futures-util/src/async_await/select_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ macro_rules! document_select_macro {
/// # Examples
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::future::{self, FutureExt};
/// use futures::select;
Expand All @@ -40,7 +40,7 @@ macro_rules! document_select_macro {
/// ```
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::future::{self, FutureExt};
/// use futures::stream::{self, StreamExt};
Expand All @@ -62,7 +62,7 @@ macro_rules! document_select_macro {
/// the case where all futures have completed.
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::future::{self, FutureExt};
/// use futures::select;
Expand Down
10 changes: 5 additions & 5 deletions futures-util/src/compat/compat01as03.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub trait Future01CompatExt: Future01 {
/// [`Future<Output = Result<T, E>>`](futures_core::future::Future).
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// # // TODO: These should be all using `futures::compat`, but that runs up against Cargo
/// # // feature issues
Expand All @@ -79,7 +79,7 @@ pub trait Stream01CompatExt: Stream01 {
/// [`Stream<Item = Result<T, E>>`](futures_core::stream::Stream).
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::stream::StreamExt;
/// use futures_util::compat::Stream01CompatExt;
Expand Down Expand Up @@ -107,7 +107,7 @@ pub trait Sink01CompatExt: Sink01 {
/// [`Sink<SinkItem = T, SinkError = E>`](futures_sink::sink::Sink).
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// # futures::executor::block_on(async {
/// use futures::{sink::SinkExt, stream::StreamExt};
/// use futures_util::compat::{Stream01CompatExt, Sink01CompatExt};
Expand Down Expand Up @@ -356,7 +356,7 @@ mod io {
/// [`AsyncRead`](futures_io::AsyncRead).
///
/// ```
/// #![feature(async_await, await_macro, futures_api, impl_trait_in_bindings)]
/// #![feature(async_await, await_macro, impl_trait_in_bindings)]
/// # futures::executor::block_on(async {
/// use futures::io::AsyncReadExt;
/// use futures_util::compat::AsyncRead01CompatExt;
Expand Down Expand Up @@ -385,7 +385,7 @@ mod io {
/// [`AsyncWrite`](futures_io::AsyncWrite).
///
/// ```
/// #![feature(async_await, await_macro, futures_api, impl_trait_in_bindings)]
/// #![feature(async_await, await_macro, impl_trait_in_bindings)]
/// # futures::executor::block_on(async {
/// use futures::io::AsyncWriteExt;
/// use futures_util::compat::AsyncWrite01CompatExt;
Expand Down
2 changes: 1 addition & 1 deletion futures-util/src/compat/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait Executor01CompatExt: Executor01<Executor01Future> +
/// futures 0.3 [`Spawn`](futures_core::task::Spawn).
///
/// ```
/// #![feature(async_await, await_macro, futures_api)]
/// #![feature(async_await, await_macro)]
/// use futures::Future;
/// use futures::task::SpawnExt;
/// use futures::future::{FutureExt, TryFutureExt};
Expand Down
Loading

0 comments on commit bbbfbb7

Please sign in to comment.