|
| 1 | +error[E0277]: the trait bound `impl Future<Output = ()>: Generator<_>` is not satisfied |
| 2 | + --> $DIR/generator-not-future.rs:31:21 |
| 3 | + | |
| 4 | +LL | takes_generator(async_fn()); |
| 5 | + | --------------- ^^^^^^^^^^ the trait `Generator<_>` is not implemented for `impl Future<Output = ()>` |
| 6 | + | | |
| 7 | + | required by a bound introduced by this call |
| 8 | + | |
| 9 | +note: required by a bound in `takes_generator` |
| 10 | + --> $DIR/generator-not-future.rs:18:39 |
| 11 | + | |
| 12 | +LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {} |
| 13 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator` |
| 14 | + |
| 15 | +error[E0277]: the trait bound `impl Future<Output = ()>: Generator<_>` is not satisfied |
| 16 | + --> $DIR/generator-not-future.rs:33:21 |
| 17 | + | |
| 18 | +LL | takes_generator(returns_async_block()); |
| 19 | + | --------------- ^^^^^^^^^^^^^^^^^^^^^ the trait `Generator<_>` is not implemented for `impl Future<Output = ()>` |
| 20 | + | | |
| 21 | + | required by a bound introduced by this call |
| 22 | + | |
| 23 | +note: required by a bound in `takes_generator` |
| 24 | + --> $DIR/generator-not-future.rs:18:39 |
| 25 | + | |
| 26 | +LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {} |
| 27 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator` |
| 28 | + |
| 29 | +error[E0277]: the trait bound `[async block@$DIR/generator-not-future.rs:35:21: 35:29]: Generator<_>` is not satisfied |
| 30 | + --> $DIR/generator-not-future.rs:35:21 |
| 31 | + | |
| 32 | +LL | takes_generator(async {}); |
| 33 | + | --------------- ^^^^^^^^ the trait `Generator<_>` is not implemented for `[async block@$DIR/generator-not-future.rs:35:21: 35:29]` |
| 34 | + | | |
| 35 | + | required by a bound introduced by this call |
| 36 | + | |
| 37 | +note: required by a bound in `takes_generator` |
| 38 | + --> $DIR/generator-not-future.rs:18:39 |
| 39 | + | |
| 40 | +LL | fn takes_generator<ResumeTy>(_g: impl Generator<ResumeTy, Yield = (), Return = ()>) {} |
| 41 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_generator` |
| 42 | + |
| 43 | +error[E0277]: `impl Generator<Yield = (), Return = ()>` is not a future |
| 44 | + --> $DIR/generator-not-future.rs:39:18 |
| 45 | + | |
| 46 | +LL | takes_future(returns_generator()); |
| 47 | + | ------------ ^^^^^^^^^^^^^^^^^^^ `impl Generator<Yield = (), Return = ()>` is not a future |
| 48 | + | | |
| 49 | + | required by a bound introduced by this call |
| 50 | + | |
| 51 | + = help: the trait `Future` is not implemented for `impl Generator<Yield = (), Return = ()>` |
| 52 | + = note: impl Generator<Yield = (), Return = ()> must be a future or must implement `IntoFuture` to be awaited |
| 53 | +note: required by a bound in `takes_future` |
| 54 | + --> $DIR/generator-not-future.rs:17:26 |
| 55 | + | |
| 56 | +LL | fn takes_future(_f: impl Future<Output = ()>) {} |
| 57 | + | ^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_future` |
| 58 | + |
| 59 | +error[E0277]: `[generator@$DIR/generator-not-future.rs:41:18: 41:23]` is not a future |
| 60 | + --> $DIR/generator-not-future.rs:41:18 |
| 61 | + | |
| 62 | +LL | takes_future(|ctx| { |
| 63 | + | _____------------_^ |
| 64 | + | | | |
| 65 | + | | required by a bound introduced by this call |
| 66 | +LL | | |
| 67 | +LL | | ctx = yield (); |
| 68 | +LL | | }); |
| 69 | + | |_____^ `[generator@$DIR/generator-not-future.rs:41:18: 41:23]` is not a future |
| 70 | + | |
| 71 | + = help: the trait `Future` is not implemented for `[generator@$DIR/generator-not-future.rs:41:18: 41:23]` |
| 72 | + = note: [generator@$DIR/generator-not-future.rs:41:18: 41:23] must be a future or must implement `IntoFuture` to be awaited |
| 73 | +note: required by a bound in `takes_future` |
| 74 | + --> $DIR/generator-not-future.rs:17:26 |
| 75 | + | |
| 76 | +LL | fn takes_future(_f: impl Future<Output = ()>) {} |
| 77 | + | ^^^^^^^^^^^^^^^^^^^ required by this bound in `takes_future` |
| 78 | + |
| 79 | +error: aborting due to 5 previous errors |
| 80 | + |
| 81 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments