1 error[E0626]: borrow may still be in use when generator yields
2 --> $DIR/yield-while-iterating.rs:22:18
4 LL | 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
14 LL | | for p in &mut x {
18 | |_____- mutable borrow occurs here
19 LL | println!("{}", x[0]); //~ ERROR
20 | ^ immutable borrow occurs here
22 | - mutable borrow later used here
24 error: aborting due to 2 previous errors
26 Some errors occurred: E0502, E0626.
27 For more information about an error, try `rustc --explain E0502`.