Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove async_await feature #4

Merged
merged 2 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -46,8 +43,6 @@ async fn main() {
Streams may be returned by using `impl Stream<Item = T>`:

```rust
#![feature(async_await)]

use tokio::prelude::*;

use async_stream::stream;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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::*;

Expand Down
11 changes: 1 addition & 10 deletions async-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -46,8 +43,6 @@ async fn main() {
Streams may be returned by using `impl Stream<Item = T>`:

```rust
#![feature(async_await)]

use tokio::prelude::*;

use async_stream::stream;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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::*;

Expand Down
2 changes: 0 additions & 2 deletions async-stream/examples/tcp_accept.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::stream;
use futures_util::pin_mut;
use futures_util::stream::StreamExt;
Expand Down
17 changes: 1 addition & 16 deletions async-stream/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,8 +17,6 @@
//! keyword. The stream block must return `()`.
//!
//! ```rust
//! #![feature(async_await)]
//!
//! use tokio::prelude::*;
//!
//! use async_stream::stream;
Expand All @@ -46,8 +41,6 @@
//! Streams may be returned by using `impl Stream<Item = T>`:
//!
//! ```rust
//! #![feature(async_await)]
//!
//! use tokio::prelude::*;
//!
//! use async_stream::stream;
Expand Down Expand Up @@ -75,8 +68,6 @@
//! Streams may be implemented in terms of other streams:
//!
//! ```rust
//! #![feature(async_await)]
//!
//! use tokio::prelude::*;
//!
//! use async_stream::stream;
Expand Down Expand Up @@ -117,8 +108,6 @@
//! `Err` the error type returned by `?`.
//!
//! ```rust
//! #![feature(async_await)]
//!
//! use tokio::net::{TcpListener, TcpStream};
//! use tokio::prelude::*;
//!
Expand Down Expand Up @@ -197,8 +186,6 @@ pub mod reexport {
/// # Examples
///
/// ```rust
/// #![feature(async_await)]
///
/// use tokio::prelude::*;
///
/// use async_stream::stream;
Expand Down Expand Up @@ -241,8 +228,6 @@ macro_rules! stream {
/// # Examples
///
/// ```rust
/// #![feature(async_await)]
///
/// use tokio::net::{TcpListener, TcpStream};
/// use tokio::prelude::*;
///
Expand Down
2 changes: 0 additions & 2 deletions async-stream/tests/for_await.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use tokio::prelude::*;

use async_stream::stream;
Expand Down
2 changes: 0 additions & 2 deletions async-stream/tests/stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::stream;

use futures_util::pin_mut;
Expand Down
2 changes: 0 additions & 2 deletions async-stream/tests/try_stream.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::try_stream;

use tokio::prelude::*;
Expand Down
2 changes: 0 additions & 2 deletions async-stream/tests/ui/yield_in_async.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::stream;

fn main() {
Expand Down
8 changes: 4 additions & 4 deletions async-stream/tests/ui/yield_in_async.stderr
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 0 additions & 2 deletions async-stream/tests/ui/yield_in_closure.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::stream;

fn main() {
Expand Down
8 changes: 4 additions & 4 deletions async-stream/tests/ui/yield_in_closure.stderr
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 0 additions & 2 deletions async-stream/tests/ui/yield_in_nested_fn.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(async_await)]

use async_stream::stream;

fn main() {
Expand Down
8 changes: 4 additions & 4 deletions async-stream/tests/ui/yield_in_nested_fn.stderr
Original file line number Diff line number Diff line change
@@ -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`.