error[E0658]: yield syntax is experimental --> tests/ui/yield_in_closure.rs:7:17 | 7 | yield v; | ^^^^^^^ | = note: see issue #43122 for more information error: `yield` can only be used in `#[coroutine]` closures, or `gen` blocks --> tests/ui/yield_in_closure.rs:7:17 | 7 | yield v; | ^^^^^^^ | help: use `#[coroutine]` to make this closure a coroutine | 6 | .and_then(#[coroutine] |v| { | ++++++++++++ error[E0277]: expected a `FnOnce(&str)` closure, found `{coroutine@$DIR/tests/ui/yield_in_closure.rs:6:23: 6:26}` --> tests/ui/yield_in_closure.rs:6:23 | 6 | .and_then(|v| { | ______________--------_^ | | | | | required by a bound introduced by this call 7 | | yield v; 8 | | Ok(()) 9 | | }); | |_____________^ expected an `FnOnce(&str)` closure, found `{coroutine@$DIR/tests/ui/yield_in_closure.rs:6:23: 6:26}` | = help: the trait `FnOnce(&str)` is not implemented for `{coroutine@$DIR/tests/ui/yield_in_closure.rs:6:23: 6:26}` note: required by a bound in `Result::::and_then` --> $RUST/core/src/result.rs | | pub fn and_then Result>(self, op: F) -> Result { | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Result::::and_then`