mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-03 02:40:40 +00:00

This adds an `iter!` macro that can be used to create movable generators. This also adds a yield_expr feature so the `yield` keyword can be used within iter! macro bodies. This was needed because several unstable features each need `yield` expressions, so this allows us to stabilize them separately from any individual feature. Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de> Co-authored-by: Jieyou Xu <jieyouxu@outlook.com> Co-authored-by: Travis Cross <tc@traviscross.com>
68 lines
3.6 KiB
Plaintext
68 lines
3.6 KiB
Plaintext
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}: AsyncFnOnce()` is not satisfied
|
|
--> $DIR/iter-macro-not-async-closure.rs:25:34
|
|
|
|
|
LL | let x = pin!(call_async_once(f));
|
|
| --------------- ^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}`
|
|
| |
|
|
| required by a bound introduced by this call
|
|
|
|
|
note: required by a bound in `call_async_once`
|
|
--> $DIR/iter-macro-not-async-closure.rs:14:34
|
|
|
|
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
|
|
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
|
|
|
|
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}: AsyncFnOnce()` is not satisfied
|
|
--> $DIR/iter-macro-not-async-closure.rs:25:18
|
|
|
|
|
LL | let x = pin!(call_async_once(f));
|
|
| ^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}`
|
|
|
|
|
note: required by a bound in `call_async_once`
|
|
--> $DIR/iter-macro-not-async-closure.rs:14:34
|
|
|
|
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
|
|
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
|
|
|
|
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}: AsyncFnOnce()` is not satisfied
|
|
--> $DIR/iter-macro-not-async-closure.rs:25:13
|
|
|
|
|
LL | let x = pin!(call_async_once(f));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}`
|
|
|
|
|
note: required by a bound in `call_async_once`
|
|
--> $DIR/iter-macro-not-async-closure.rs:14:34
|
|
|
|
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
|
|
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
|
|
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}: AsyncFnOnce()` is not satisfied
|
|
--> $DIR/iter-macro-not-async-closure.rs:25:13
|
|
|
|
|
LL | let x = pin!(call_async_once(f));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}`
|
|
|
|
|
note: required by a bound in `call_async_once`
|
|
--> $DIR/iter-macro-not-async-closure.rs:14:34
|
|
|
|
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
|
|
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
|
|
= note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error[E0277]: the trait bound `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}: AsyncFnOnce()` is not satisfied
|
|
--> $DIR/iter-macro-not-async-closure.rs:30:5
|
|
|
|
|
LL | x.poll(&mut Context::from_waker(Waker::noop()));
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `AsyncFnOnce()` is not implemented for `{gen closure@$DIR/iter-macro-not-async-closure.rs:19:21: 19:28}`
|
|
|
|
|
note: required by a bound in `call_async_once`
|
|
--> $DIR/iter-macro-not-async-closure.rs:14:34
|
|
|
|
|
LL | async fn call_async_once(f: impl AsyncFnOnce()) {
|
|
| ^^^^^^^^^^^^^ required by this bound in `call_async_once`
|
|
|
|
error: aborting due to 5 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|