From ee61dd68d3b6ce57ad48210a3f031aa226b719d6 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 22 Aug 2019 00:45:59 +0900 Subject: [PATCH] Remove async_await feature --- README.md | 2 -- benches/baseline.rs | 2 +- benches/native.rs | 2 +- benches/tokio.rs | 2 +- examples/guessing.rs | 2 -- examples/hello.rs | 2 -- examples/tcp-client.rs | 2 -- examples/tcp-echo.rs | 2 -- examples/tcp-proxy.rs | 2 -- examples/udp-client.rs | 2 -- examples/udp-echo.rs | 2 -- runtime-attributes/src/lib.rs | 7 +------ runtime-native/src/lib.rs | 1 - runtime-raw/src/lib.rs | 1 - runtime-tokio/src/lib.rs | 1 - src/lib.rs | 3 --- src/net/tcp.rs | 15 --------------- src/net/udp.rs | 8 -------- src/task.rs | 2 -- src/time.rs | 2 -- src/time/delay.rs | 2 -- src/time/ext.rs | 4 ---- src/time/interval.rs | 1 - tests/native.rs | 2 -- tests/tokio-current-thread.rs | 2 -- tests/tokio.rs | 2 -- 26 files changed, 4 insertions(+), 71 deletions(-) diff --git a/README.md b/README.md index 084022e0..0d81c0a1 100644 --- a/README.md +++ b/README.md @@ -69,8 +69,6 @@ asynchronous software. ## Examples __UDP Echo Server__ ```rust -#![feature(async_await)] - use runtime::net::UdpSocket; #[runtime::main] diff --git a/benches/baseline.rs b/benches/baseline.rs index 0f15d20e..2c98e6b3 100644 --- a/benches/baseline.rs +++ b/benches/baseline.rs @@ -1,4 +1,4 @@ -#![feature(test, async_await)] +#![feature(test)] extern crate test; diff --git a/benches/native.rs b/benches/native.rs index 86faf147..cc0eb605 100644 --- a/benches/native.rs +++ b/benches/native.rs @@ -1,4 +1,4 @@ -#![feature(test, async_await)] +#![feature(test)] #![warn(rust_2018_idioms)] extern crate test; diff --git a/benches/tokio.rs b/benches/tokio.rs index 011f8e70..c1360a82 100644 --- a/benches/tokio.rs +++ b/benches/tokio.rs @@ -1,4 +1,4 @@ -#![feature(test, async_await)] +#![feature(test)] #![warn(rust_2018_idioms)] extern crate test; diff --git a/examples/guessing.rs b/examples/guessing.rs index 4471eb8b..9bfddd9e 100644 --- a/examples/guessing.rs +++ b/examples/guessing.rs @@ -7,8 +7,6 @@ //! $ nc localhost 8080 //! ``` -#![feature(async_await)] - use futures::prelude::*; use rand::Rng; use runtime::net::{TcpListener, TcpStream}; diff --git a/examples/hello.rs b/examples/hello.rs index 0598a9ce..e913f935 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - async fn say_hi() { println!("Hello world! 🤖"); } diff --git a/examples/tcp-client.rs b/examples/tcp-client.rs index dc6fe8d2..4675183c 100644 --- a/examples/tcp-client.rs +++ b/examples/tcp-client.rs @@ -6,8 +6,6 @@ //! $ cargo run --example tcp-echo //! ``` -#![feature(async_await)] - use futures::prelude::*; use runtime::net::TcpStream; diff --git a/examples/tcp-echo.rs b/examples/tcp-echo.rs index ac15ee51..3e2725c7 100644 --- a/examples/tcp-echo.rs +++ b/examples/tcp-echo.rs @@ -3,8 +3,6 @@ //! Run the server and connect to it with `nc 127.0.0.1 8080`. //! The server will wait for you to enter lines of text and then echo them back. -#![feature(async_await)] - use futures::prelude::*; use runtime::net::TcpListener; diff --git a/examples/tcp-proxy.rs b/examples/tcp-proxy.rs index c2f67306..cf3ab07b 100644 --- a/examples/tcp-proxy.rs +++ b/examples/tcp-proxy.rs @@ -1,7 +1,5 @@ //! A TCP proxy server. Forwards connections from port 8081 to port 8080. -#![feature(async_await)] - use futures::prelude::*; use futures::try_join; use runtime::net::{TcpListener, TcpStream}; diff --git a/examples/udp-client.rs b/examples/udp-client.rs index 56b52077..b8596e2b 100644 --- a/examples/udp-client.rs +++ b/examples/udp-client.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - //! UDP client. //! //! To start an echo server do: diff --git a/examples/udp-echo.rs b/examples/udp-echo.rs index f4eccf02..f530e98d 100644 --- a/examples/udp-echo.rs +++ b/examples/udp-echo.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - //! UDP echo server. //! //! To send messages do: diff --git a/runtime-attributes/src/lib.rs b/runtime-attributes/src/lib.rs index c903c6bd..70e3649d 100644 --- a/runtime-attributes/src/lib.rs +++ b/runtime-attributes/src/lib.rs @@ -3,7 +3,6 @@ #![forbid(unsafe_code, future_incompatible, rust_2018_idioms)] #![deny(missing_debug_implementations, nonstandard_style)] -#![feature(async_await)] #![recursion_limit = "512"] extern crate proc_macro; @@ -17,8 +16,6 @@ use syn::spanned::Spanned; /// # Examples /// /// ```ignore -/// #![feature(async_await)] -/// /// #[runtime::main] /// async fn main() -> std::io::Result<()> { /// Ok(()) @@ -82,8 +79,6 @@ pub fn main(attr: TokenStream, item: TokenStream) -> TokenStream { /// # Examples /// /// ```ignore -/// #![feature(async_await)] -/// /// #[runtime::test] /// async fn main() -> std::io::Result<()> { /// Ok(()) @@ -133,7 +128,7 @@ pub fn test(attr: TokenStream, item: TokenStream) -> TokenStream { /// # Examples /// /// ```ignore -/// #![feature(async_await, test)] +/// #![feature(test)] /// /// extern crate test; /// diff --git a/runtime-native/src/lib.rs b/runtime-native/src/lib.rs index 25ff547c..9797ffd5 100644 --- a/runtime-native/src/lib.rs +++ b/runtime-native/src/lib.rs @@ -1,7 +1,6 @@ //! A cross-platform asynchronous [Runtime](https://github.com/rustasync/runtime). See the [Runtime //! documentation](https://docs.rs/runtime) for more details. -#![feature(async_await)] #![deny(unsafe_code)] #![warn( missing_debug_implementations, diff --git a/runtime-raw/src/lib.rs b/runtime-raw/src/lib.rs index 47a4ceca..b15fd767 100644 --- a/runtime-raw/src/lib.rs +++ b/runtime-raw/src/lib.rs @@ -5,7 +5,6 @@ //! perform IO, then there's no need to bother with any of these types as they will have been //! implemented for you already. -#![feature(async_await)] #![deny(unsafe_code)] #![warn( missing_debug_implementations, diff --git a/runtime-tokio/src/lib.rs b/runtime-tokio/src/lib.rs index d8ff1d14..0b996719 100644 --- a/runtime-tokio/src/lib.rs +++ b/runtime-tokio/src/lib.rs @@ -2,7 +2,6 @@ //! [Runtime](https://github.com/rustasync/runtime). See the [Runtime //! documentation](https://docs.rs/runtime) for more details. -#![feature(async_await)] #![warn( missing_debug_implementations, missing_docs, diff --git a/src/lib.rs b/src/lib.rs index 8c40563c..176223a4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,8 +16,6 @@ //! ## Examples //! __UDP Echo Server__ //! ```no_run -//! #![feature(async_await)] -//! //! use runtime::net::UdpSocket; //! //! #[runtime::main] @@ -85,7 +83,6 @@ //! - [Runtime Tokio](https://docs.rs/runtime-tokio) provides a thread pool, bindings to the OS, and //! a work-stealing scheduler. -#![feature(async_await)] #![warn( missing_debug_implementations, missing_docs, diff --git a/src/net/tcp.rs b/src/net/tcp.rs index fd7721e2..26524eb8 100644 --- a/src/net/tcp.rs +++ b/src/net/tcp.rs @@ -46,8 +46,6 @@ use futures::task::{Context, Poll}; /// /// ## Examples /// ```no_run -/// #![feature(async_await)] -/// /// use futures::prelude::*; /// use runtime::net::TcpStream; /// @@ -85,7 +83,6 @@ impl TcpStream { /// # Examples /// /// ```no_run - /// #![feature(async_await)] /// use runtime::net::TcpStream; /// /// # async fn connect_localhost() -> std::io::Result<()> { @@ -105,7 +102,6 @@ impl TcpStream { /// /// ## Examples /// ```no_run - /// #![feature(async_await)] /// use runtime::net::TcpStream; /// use std::net::{IpAddr, Ipv4Addr}; /// @@ -125,7 +121,6 @@ impl TcpStream { /// /// ## Examples /// ```no_run - /// #![feature(async_await)] /// use runtime::net::TcpStream; /// use std::net::{IpAddr, Ipv4Addr}; /// @@ -151,8 +146,6 @@ impl TcpStream { /// # Examples /// /// ```no_run - /// #![feature(async_await)] - /// /// use std::net::Shutdown; /// use runtime::net::TcpStream; /// @@ -291,8 +284,6 @@ impl fmt::Debug for ConnectFuture { /// /// # Examples /// ```ignore -/// #![feature(async_await)] -/// /// use futures::prelude::*; /// use runtime::net::TcpListener; /// @@ -367,8 +358,6 @@ impl TcpListener { /// # Examples /// /// ```no_run - /// #![feature(async_await)] - /// /// use runtime::net::TcpListener; /// use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; /// @@ -397,8 +386,6 @@ impl TcpListener { /// ## Examples /// /// ```no_run - /// #![feature(async_await)] - /// /// use futures::prelude::*; /// use runtime::net::TcpListener; /// @@ -430,8 +417,6 @@ impl TcpListener { /// ## Examples /// /// ```no_run - /// #![feature(async_await)] - /// /// use futures::prelude::*; /// use runtime::net::TcpListener; /// diff --git a/src/net/udp.rs b/src/net/udp.rs index 695b9b29..00b4f22f 100644 --- a/src/net/udp.rs +++ b/src/net/udp.rs @@ -36,8 +36,6 @@ use std::task::{Context, Poll}; /// /// ## Examples /// ```no_run -/// #![feature(async_await)] -/// /// use runtime::net::UdpSocket; /// /// #[runtime::main] @@ -120,7 +118,6 @@ impl UdpSocket { /// # Examples /// /// ```no_run - /// #![feature(async_await)] /// # use std::error::Error; /// use runtime::net::UdpSocket; /// @@ -163,7 +160,6 @@ impl UdpSocket { /// # Examples /// /// ```no_run - /// #![feature(async_await)] /// # use std::error::Error; /// use runtime::net::UdpSocket; /// @@ -289,8 +285,6 @@ impl UdpSocket { /// # Examples /// /// ```rust,no_run - /// #![feature(async_await)] - /// /// use runtime::net::UdpSocket; /// use std::net::Ipv4Addr; /// @@ -316,8 +310,6 @@ impl UdpSocket { /// # Examples /// /// ```rust,no_run - /// #![feature(async_await)] - /// /// use runtime::net::UdpSocket; /// use std::net::{Ipv6Addr, SocketAddr}; /// diff --git a/src/task.rs b/src/task.rs index 17944996..8e9b5f60 100644 --- a/src/task.rs +++ b/src/task.rs @@ -52,8 +52,6 @@ impl<'a> Spawn for &'a Spawner { /// # Examples /// /// ``` -/// #![feature(async_await)] -/// /// #[runtime::main] /// async fn main() { /// let handle = runtime::spawn(async { diff --git a/src/time.rs b/src/time.rs index b4e2a9b8..0344aaf2 100644 --- a/src/time.rs +++ b/src/time.rs @@ -15,7 +15,6 @@ //! ## Examples //! __Delay execution for three seconds__ //! ```no_run -//! # #![feature(async_await)] //! # #[runtime::main] //! # async fn main() { //! use runtime::time::Delay; @@ -31,7 +30,6 @@ //! //! __Emit an event every two seconds__ //! ```no_run -//! # #![feature(async_await)] //! # #[runtime::main] //! # async fn main() { //! # use futures::prelude::*; diff --git a/src/time/delay.rs b/src/time/delay.rs index 9954f478..03d162c3 100644 --- a/src/time/delay.rs +++ b/src/time/delay.rs @@ -16,7 +16,6 @@ impl Delay { /// /// ## Examples /// ``` - /// # #![feature(async_await)] /// use runtime::time::Delay; /// use std::time::{Duration, Instant}; /// @@ -38,7 +37,6 @@ impl Delay { /// /// ## Examples /// ``` - /// # #![feature(async_await)] /// use runtime::time::Delay; /// use std::time::{Duration, Instant}; /// diff --git a/src/time/ext.rs b/src/time/ext.rs index a970d2a1..1a9796b0 100644 --- a/src/time/ext.rs +++ b/src/time/ext.rs @@ -58,7 +58,6 @@ pub trait FutureExt: Future + Sized { /// /// # Examples /// ``` - /// # #![feature(async_await)] /// use futures::prelude::*; /// use runtime::prelude::*; /// use std::time::{Duration, Instant}; @@ -107,7 +106,6 @@ pub trait FutureExt: Future + Sized { /// /// # Examples /// ``` - /// # #![feature(async_await)] /// use futures::prelude::*; /// use runtime::prelude::*; /// use std::time::{Duration, Instant}; @@ -194,7 +192,6 @@ pub trait StreamExt: Stream + Sized { /// /// ## Examples /// ``` - /// # #![feature(async_await)] /// # use futures::prelude::*; /// use runtime::time::{Interval, StreamExt as _}; /// use std::time::{Duration, Instant}; @@ -279,7 +276,6 @@ pub trait AsyncReadExt: AsyncRead + Sized { /// ## Examples /// /// ```no_run - /// # #![feature(async_await)] /// # #[runtime::main] /// # async fn main () -> Result<(), Box> { /// use futures::prelude::*; diff --git a/src/time/interval.rs b/src/time/interval.rs index e6ad8475..0bc397c3 100644 --- a/src/time/interval.rs +++ b/src/time/interval.rs @@ -16,7 +16,6 @@ impl Interval { /// /// ## Examples /// ``` - /// # #![feature(async_await)] /// # use futures::prelude::*; /// use runtime::time::Interval; /// use std::time::{Duration, Instant}; diff --git a/tests/native.rs b/tests/native.rs index 7b5a0f20..92c0fc61 100644 --- a/tests/native.rs +++ b/tests/native.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use runtime_native::Native; #[runtime::test(Native)] diff --git a/tests/tokio-current-thread.rs b/tests/tokio-current-thread.rs index ab70c36f..3b852da1 100644 --- a/tests/tokio-current-thread.rs +++ b/tests/tokio-current-thread.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - #[runtime::test(runtime_tokio::TokioCurrentThread)] async fn spawn() { let handle = runtime::spawn(async { diff --git a/tests/tokio.rs b/tests/tokio.rs index 6fb605c2..81a24900 100644 --- a/tests/tokio.rs +++ b/tests/tokio.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use runtime_tokio::Tokio; #[runtime::test(Tokio)]