1 error[E0626]: borrow may still be in use when generator yields
2 --> $DIR/yield-while-iterating.rs:22:19
4 22 | for p in &x { //~ ERROR
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:67:20
13 | -- mutable borrow occurs here
14 63 | for p in &mut x {
15 | - previous borrow occurs due to use of `x` in closure
17 67 | println!("{}", x[0]); //~ ERROR
18 | ^ immutable borrow occurs here
21 | - mutable borrow ends here
23 error: aborting due to 2 previous errors