diff --git a/README.md b/README.md index 41f565f..61096e5 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,7 @@ Asynchronous stream of elements. Provides two macros, `stream!` and `try_stream!`, allowing the caller to define asynchronous streams of elements. These are implemented using `async` -& `await` notation. The `stream!` macro works using only -`#[feature(async_await)]`. +& `await` notation. The `stream!` macro works without unstable features. The `stream!` macro returns an anonymous type implementing the [`Stream`] trait. The `Item` associated type is the type of the values yielded from the @@ -20,8 +19,6 @@ A basic stream yielding numbers. Values are yielded using the `yield` keyword. The stream block must return `()`. ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -46,8 +43,6 @@ async fn main() { Streams may be returned by using `impl Stream`: ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -75,8 +70,6 @@ async fn main() { Streams may be implemented in terms of other streams: ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -117,8 +110,6 @@ of the returned stream is `Result` with `Ok` being the value yielded and `Err` the error type returned by `?`. ```rust -#![feature(async_await)] - use tokio::net::{TcpListener, TcpStream}; use tokio::prelude::*; diff --git a/async-stream/README.md b/async-stream/README.md index 41f565f..61096e5 100644 --- a/async-stream/README.md +++ b/async-stream/README.md @@ -4,8 +4,7 @@ Asynchronous stream of elements. Provides two macros, `stream!` and `try_stream!`, allowing the caller to define asynchronous streams of elements. These are implemented using `async` -& `await` notation. The `stream!` macro works using only -`#[feature(async_await)]`. +& `await` notation. The `stream!` macro works without unstable features. The `stream!` macro returns an anonymous type implementing the [`Stream`] trait. The `Item` associated type is the type of the values yielded from the @@ -20,8 +19,6 @@ A basic stream yielding numbers. Values are yielded using the `yield` keyword. The stream block must return `()`. ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -46,8 +43,6 @@ async fn main() { Streams may be returned by using `impl Stream`: ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -75,8 +70,6 @@ async fn main() { Streams may be implemented in terms of other streams: ```rust -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; @@ -117,8 +110,6 @@ of the returned stream is `Result` with `Ok` being the value yielded and `Err` the error type returned by `?`. ```rust -#![feature(async_await)] - use tokio::net::{TcpListener, TcpStream}; use tokio::prelude::*; diff --git a/async-stream/examples/tcp_accept.rs b/async-stream/examples/tcp_accept.rs index b50112d..be74721 100644 --- a/async-stream/examples/tcp_accept.rs +++ b/async-stream/examples/tcp_accept.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::stream; use futures_util::pin_mut; use futures_util::stream::StreamExt; diff --git a/async-stream/src/lib.rs b/async-stream/src/lib.rs index 253f20c..f1f4707 100644 --- a/async-stream/src/lib.rs +++ b/async-stream/src/lib.rs @@ -1,11 +1,8 @@ -#![feature(async_await)] - //! Asynchronous stream of elements. //! //! Provides two macros, `stream!` and `try_stream!`, allowing the caller to //! define asynchronous streams of elements. These are implemented using `async` -//! & `await` notation. The `stream!` macro works using only -//! `#[feature(async_await)]`. +//! & `await` notation. The `stream!` macro works without unstable features. //! //! The `stream!` macro returns an anonymous type implementing the [`Stream`] //! trait. The `Item` associated type is the type of the values yielded from the @@ -20,8 +17,6 @@ //! keyword. The stream block must return `()`. //! //! ```rust -//! #![feature(async_await)] -//! //! use tokio::prelude::*; //! //! use async_stream::stream; @@ -46,8 +41,6 @@ //! Streams may be returned by using `impl Stream`: //! //! ```rust -//! #![feature(async_await)] -//! //! use tokio::prelude::*; //! //! use async_stream::stream; @@ -75,8 +68,6 @@ //! Streams may be implemented in terms of other streams: //! //! ```rust -//! #![feature(async_await)] -//! //! use tokio::prelude::*; //! //! use async_stream::stream; @@ -117,8 +108,6 @@ //! `Err` the error type returned by `?`. //! //! ```rust -//! #![feature(async_await)] -//! //! use tokio::net::{TcpListener, TcpStream}; //! use tokio::prelude::*; //! @@ -197,8 +186,6 @@ pub mod reexport { /// # Examples /// /// ```rust -/// #![feature(async_await)] -/// /// use tokio::prelude::*; /// /// use async_stream::stream; @@ -241,8 +228,6 @@ macro_rules! stream { /// # Examples /// /// ```rust -/// #![feature(async_await)] -/// /// use tokio::net::{TcpListener, TcpStream}; /// use tokio::prelude::*; /// diff --git a/async-stream/tests/for_await.rs b/async-stream/tests/for_await.rs index 422ee76..3fc528d 100644 --- a/async-stream/tests/for_await.rs +++ b/async-stream/tests/for_await.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use tokio::prelude::*; use async_stream::stream; diff --git a/async-stream/tests/stream.rs b/async-stream/tests/stream.rs index 8133161..68cb574 100644 --- a/async-stream/tests/stream.rs +++ b/async-stream/tests/stream.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::stream; use futures_util::pin_mut; diff --git a/async-stream/tests/try_stream.rs b/async-stream/tests/try_stream.rs index 8039997..7748ffc 100644 --- a/async-stream/tests/try_stream.rs +++ b/async-stream/tests/try_stream.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::try_stream; use tokio::prelude::*; diff --git a/async-stream/tests/ui/yield_in_async.rs b/async-stream/tests/ui/yield_in_async.rs index b1fbe6b..24e7330 100644 --- a/async-stream/tests/ui/yield_in_async.rs +++ b/async-stream/tests/ui/yield_in_async.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::stream; fn main() { diff --git a/async-stream/tests/ui/yield_in_async.stderr b/async-stream/tests/ui/yield_in_async.stderr index 9ab407f..4a1527a 100644 --- a/async-stream/tests/ui/yield_in_async.stderr +++ b/async-stream/tests/ui/yield_in_async.stderr @@ -1,16 +1,16 @@ error[E0658]: yield syntax is experimental - --> $DIR/yield_in_async.rs:8:13 + --> $DIR/yield_in_async.rs:6:13 | -8 | yield 123; +6 | yield 123; | ^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/43122 = help: add `#![feature(generators)]` to the crate attributes to enable error[E0727]: `async` generators are not yet supported - --> $DIR/yield_in_async.rs:8:13 + --> $DIR/yield_in_async.rs:6:13 | -8 | yield 123; +6 | yield 123; | ^^^^^^^^^ For more information about this error, try `rustc --explain E0658`. diff --git a/async-stream/tests/ui/yield_in_closure.rs b/async-stream/tests/ui/yield_in_closure.rs index 33b004b..cd6ebd9 100644 --- a/async-stream/tests/ui/yield_in_closure.rs +++ b/async-stream/tests/ui/yield_in_closure.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::stream; fn main() { diff --git a/async-stream/tests/ui/yield_in_closure.stderr b/async-stream/tests/ui/yield_in_closure.stderr index f8402a3..c1098fb 100644 --- a/async-stream/tests/ui/yield_in_closure.stderr +++ b/async-stream/tests/ui/yield_in_closure.stderr @@ -1,16 +1,16 @@ error[E0658]: yield syntax is experimental - --> $DIR/yield_in_closure.rs:9:17 + --> $DIR/yield_in_closure.rs:7:17 | -9 | yield v; +7 | yield v; | ^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/43122 = help: add `#![feature(generators)]` to the crate attributes to enable error[E0628]: generators cannot have explicit arguments - --> $DIR/yield_in_closure.rs:8:23 + --> $DIR/yield_in_closure.rs:6:23 | -8 | .and_then(|v| { +6 | .and_then(|v| { | ^^^ For more information about this error, try `rustc --explain E0658`. diff --git a/async-stream/tests/ui/yield_in_nested_fn.rs b/async-stream/tests/ui/yield_in_nested_fn.rs index 7e1ba21..9ae6cf2 100644 --- a/async-stream/tests/ui/yield_in_nested_fn.rs +++ b/async-stream/tests/ui/yield_in_nested_fn.rs @@ -1,5 +1,3 @@ -#![feature(async_await)] - use async_stream::stream; fn main() { diff --git a/async-stream/tests/ui/yield_in_nested_fn.stderr b/async-stream/tests/ui/yield_in_nested_fn.stderr index d8b2447..7583df4 100644 --- a/async-stream/tests/ui/yield_in_nested_fn.stderr +++ b/async-stream/tests/ui/yield_in_nested_fn.stderr @@ -1,16 +1,16 @@ error[E0658]: yield syntax is experimental - --> $DIR/yield_in_nested_fn.rs:8:13 + --> $DIR/yield_in_nested_fn.rs:6:13 | -8 | yield "hello"; +6 | yield "hello"; | ^^^^^^^^^^^^^ | = note: for more information, see https://github.com/rust-lang/rust/issues/43122 = help: add `#![feature(generators)]` to the crate attributes to enable error[E0627]: yield statement outside of generator literal - --> $DIR/yield_in_nested_fn.rs:8:13 + --> $DIR/yield_in_nested_fn.rs:6:13 | -8 | yield "hello"; +6 | yield "hello"; | ^^^^^^^^^^^^^ For more information about this error, try `rustc --explain E0658`.