1 error[E0626]: borrow may still be in use when generator yields
2 --> $DIR/yield-while-iterating.rs:13:18
7 | ------- possible yield occurs here
9 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
10 --> $DIR/yield-while-iterating.rs:58:20
13 | -- mutable borrow occurs here
14 LL | for p in &mut x {
15 | - first borrow occurs due to use of `x` in generator
17 LL | println!("{}", x[0]);
18 | ^ immutable borrow occurs here
19 LL | Pin::new(&mut b).resume(());
20 | ------ mutable borrow later used here
22 error: aborting due to 2 previous errors
24 Some errors have detailed explanations: E0502, E0626.
25 For more information about an error, try `rustc --explain E0502`.