From 32b02cc2a5ebc55889880936f5dbfbaa5b7b63b0 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Wed, 21 Aug 2019 11:36:46 +0700 Subject: [PATCH] refactor: remove async_await feature gate `async_await` is stabilized in rust-lang/rust#63209. This commit fixes `hyper` build with latest nightly compiler. --- benches/end_to_end.rs | 1 - benches/pipeline.rs | 1 - benches/server.rs | 1 - examples/client.rs | 1 - examples/client_json.rs | 1 - examples/echo.rs | 1 - examples/hello.rs | 1 - examples/multi_server.rs | 1 - examples/params.rs | 1 - examples/proxy.rs | 1 - examples/send_file.rs | 1 - examples/single_threaded.rs | 1 - examples/state.rs | 1 - examples/tower_server.rs | 1 - examples/upgrades.rs | 1 - examples/web_api.rs | 1 - src/client/conn.rs | 1 - src/client/connect/http.rs | 1 - src/client/mod.rs | 1 - src/lib.rs | 1 - src/server/conn.rs | 1 - src/server/mod.rs | 3 --- src/service/make_service.rs | 1 - src/service/service.rs | 1 - tests/client.rs | 1 - tests/server.rs | 2 +- 26 files changed, 1 insertion(+), 28 deletions(-) diff --git a/benches/end_to_end.rs b/benches/end_to_end.rs index 4d63ced9d3..717d71c906 100644 --- a/benches/end_to_end.rs +++ b/benches/end_to_end.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![feature(test)] #![deny(warnings)] diff --git a/benches/pipeline.rs b/benches/pipeline.rs index ef27e753b7..af9a4f5161 100644 --- a/benches/pipeline.rs +++ b/benches/pipeline.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![feature(test)] #![deny(warnings)] diff --git a/benches/server.rs b/benches/server.rs index c83a08d5d8..4901eabb4d 100644 --- a/benches/server.rs +++ b/benches/server.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![feature(test)] #![deny(warnings)] diff --git a/examples/client.rs b/examples/client.rs index 3a4d83d701..f5587ef330 100644 --- a/examples/client.rs +++ b/examples/client.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] extern crate hyper; extern crate pretty_env_logger; diff --git a/examples/client_json.rs b/examples/client_json.rs index 94d35cd92c..1188a76e90 100644 --- a/examples/client_json.rs +++ b/examples/client_json.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] extern crate hyper; #[macro_use] diff --git a/examples/echo.rs b/examples/echo.rs index 5780400cb9..c59abeb53a 100644 --- a/examples/echo.rs +++ b/examples/echo.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] //#![deny(warnings)] use hyper::{Body, Method, Request, Response, Server, StatusCode}; diff --git a/examples/hello.rs b/examples/hello.rs index 921107965e..ff51b295da 100644 --- a/examples/hello.rs +++ b/examples/hello.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use hyper::{Body, Request, Response, Server}; diff --git a/examples/multi_server.rs b/examples/multi_server.rs index 173df59bb8..5b2433abbc 100644 --- a/examples/multi_server.rs +++ b/examples/multi_server.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] extern crate hyper; extern crate pretty_env_logger; diff --git a/examples/params.rs b/examples/params.rs index d4d20ea857..7f7867b893 100644 --- a/examples/params.rs +++ b/examples/params.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] // #![deny(warnings)] // FIXME: https://github.com/rust-lang/rust/issues/62411 extern crate hyper; extern crate pretty_env_logger; diff --git a/examples/proxy.rs b/examples/proxy.rs index b1615d1712..e32360856b 100644 --- a/examples/proxy.rs +++ b/examples/proxy.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use hyper::{Client, Error, Server}; diff --git a/examples/send_file.rs b/examples/send_file.rs index 3a12f7ac10..821e773dd3 100644 --- a/examples/send_file.rs +++ b/examples/send_file.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use tokio::io::AsyncReadExt; diff --git a/examples/single_threaded.rs b/examples/single_threaded.rs index 5d582857ec..9d9128e2cd 100644 --- a/examples/single_threaded.rs +++ b/examples/single_threaded.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use std::cell::Cell; diff --git a/examples/state.rs b/examples/state.rs index a1fd9ce01d..0a70dc8e34 100644 --- a/examples/state.rs +++ b/examples/state.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use std::sync::{Arc, atomic::{AtomicUsize, Ordering}}; diff --git a/examples/tower_server.rs b/examples/tower_server.rs index a48fc7f4bd..ddc34f00a6 100644 --- a/examples/tower_server.rs +++ b/examples/tower_server.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use hyper::{Body, Request, Response, Server}; diff --git a/examples/upgrades.rs b/examples/upgrades.rs index 8df189b588..622247a4ab 100644 --- a/examples/upgrades.rs +++ b/examples/upgrades.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] // Note: `hyper::upgrade` docs link to this upgrade. diff --git a/examples/web_api.rs b/examples/web_api.rs index ffd42b2834..ce61c89471 100644 --- a/examples/web_api.rs +++ b/examples/web_api.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] use hyper::{Body, Chunk, Client, Method, Request, Response, Server, StatusCode, header}; diff --git a/src/client/conn.rs b/src/client/conn.rs index 141a284734..8e743e0a4a 100644 --- a/src/client/conn.rs +++ b/src/client/conn.rs @@ -182,7 +182,6 @@ where /// # Example /// /// ``` - /// # #![feature(async_await)] /// # use http::header::HOST; /// # use hyper::client::conn::SendRequest; /// # use hyper::Body; diff --git a/src/client/connect/http.rs b/src/client/connect/http.rs index 16e57ccabc..e8fc792ae9 100644 --- a/src/client/connect/http.rs +++ b/src/client/connect/http.rs @@ -46,7 +46,6 @@ pub struct HttpConnector { /// # Example /// /// ``` -/// # #![feature(async_await)] /// # async fn doc() -> hyper::Result<()> { /// use hyper::Uri; /// use hyper::client::{Client, connect::HttpInfo}; diff --git a/src/client/mod.rs b/src/client/mod.rs index 3488ab77bc..cdf122af08 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -27,7 +27,6 @@ //! [full client example](https://github.com/hyperium/hyper/blob/master/examples/client.rs). //! //! ``` -//! # #![feature(async_await)] //! use hyper::{Client, Uri}; //! //! # #[cfg(feature = "runtime")] diff --git a/src/lib.rs b/src/lib.rs index 21c8b27782..6ec2c7719b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,7 +4,6 @@ // XXX NOOOOOOOO //#![cfg_attr(test, deny(warnings))] #![allow(warnings)] -#![feature(async_await)] #![cfg_attr(all(test, feature = "nightly"), feature(test))] //! # hyper diff --git a/src/server/conn.rs b/src/server/conn.rs index 5b01a32b79..baede2d7cc 100644 --- a/src/server/conn.rs +++ b/src/server/conn.rs @@ -331,7 +331,6 @@ impl Http { /// # Example /// /// ``` - /// # #![feature(async_await)] /// # use hyper::{Body, Request, Response}; /// # use hyper::service::Service; /// # use hyper::server::conn::Http; diff --git a/src/server/mod.rs b/src/server/mod.rs index 55efc542f5..0c094307dc 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -19,7 +19,6 @@ //! ## Example //! //! ```no_run -//! # #![feature(async_await)] //! use hyper::{Body, Error, Response, Server}; //! use hyper::service::{make_service_fn, service_fn}; //! @@ -164,7 +163,6 @@ where /// # Example /// /// ``` - /// # #![feature(async_await)] /// # fn main() {} /// # #[cfg(feature = "runtime")] /// # async fn run() { @@ -360,7 +358,6 @@ impl Builder { /// # Example /// /// ``` - /// # #![feature(async_await)] /// # #[cfg(not(feature = "runtime"))] /// # fn main() {} /// # #[cfg(feature = "runtime")] diff --git a/src/service/make_service.rs b/src/service/make_service.rs index c19ccadb47..83b7521941 100644 --- a/src/service/make_service.rs +++ b/src/service/make_service.rs @@ -133,7 +133,6 @@ where /// # Example /// /// ```rust,no_run -/// # #![feature(async_await)] /// # #[cfg(feature = "runtime")] /// # #[tokio::main] /// # async fn main() { diff --git a/src/service/service.rs b/src/service/service.rs index 616d4f7071..50bcdff370 100644 --- a/src/service/service.rs +++ b/src/service/service.rs @@ -70,7 +70,6 @@ mod sealed { /// # Example /// /// ```rust -/// # #![feature(async_await)] /// use hyper::{Body, Request, Response, Version}; /// use hyper::service::service_fn; /// diff --git a/tests/client.rs b/tests/client.rs index 80dc4c7c20..702c2a91ee 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -1,4 +1,3 @@ -#![feature(async_await)] #![deny(warnings)] extern crate bytes; extern crate hyper; diff --git a/tests/server.rs b/tests/server.rs index 53ccb11984..4e4f29ccd7 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -1,4 +1,4 @@ -#![feature(async_await, async_closure)] +#![feature(async_closure)] #![deny(warnings)] extern crate http; extern crate hyper;