rust/src/test/ui/generator/yield-while-iterating.stderr

27 lines
888 B
Plaintext
Raw Normal View History

2017-07-29 16:05:50 +00:00
error[E0626]: borrow may still be in use when generator yields
--> $DIR/yield-while-iterating.rs:22:19
|
2018-02-23 00:42:32 +00:00
LL | for p in &x { //~ ERROR
| ^
2018-02-23 00:42:32 +00:00
LL | yield();
| ------- possible yield occurs here
error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
--> $DIR/yield-while-iterating.rs:67:20
|
2018-02-23 00:42:32 +00:00
LL | let mut b = || {
| -- mutable borrow occurs here
2018-02-23 00:42:32 +00:00
LL | for p in &mut x {
| - previous borrow occurs due to use of `x` in closure
...
2018-02-23 00:42:32 +00:00
LL | println!("{}", x[0]); //~ ERROR
| ^ immutable borrow occurs here
2018-02-24 23:01:39 +00:00
LL | b.resume();
2018-02-23 00:42:32 +00:00
LL | }
| - mutable borrow ends here
error: aborting due to 2 previous errors
2018-02-19 20:40:25 +00:00
You've got a few errors: E0502, E0626
If you want more information on an error, try using "rustc --explain E0502"