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