1 error[E0503]: cannot use `x` because it was mutably borrowed
2 --> $DIR/regions-escape-loop-via-vec.rs:15:11
4 LL | let mut _y = vec![&mut x];
5 | ------ borrow of `x` occurs here
6 LL | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
7 | ^ use of borrowed `x`
8 LL | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
10 | -- borrow later used here
12 error[E0503]: cannot use `x` because it was mutably borrowed
13 --> $DIR/regions-escape-loop-via-vec.rs:16:21
15 LL | let mut _y = vec![&mut x];
16 | ------ borrow of `x` occurs here
17 LL | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
18 LL | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
19 | ^ use of borrowed `x`
21 | -- borrow later used here
23 error[E0503]: cannot use `x` because it was mutably borrowed
24 --> $DIR/regions-escape-loop-via-vec.rs:19:9
26 LL | let mut _y = vec![&mut x];
27 | ------ borrow of `x` occurs here
30 | -- borrow later used here
31 LL | //~^ ERROR `z` does not live long enough
32 LL | x += 1; //~ ERROR cannot assign
33 | ^^^^^^ use of borrowed `x`
35 error[E0597]: `z` does not live long enough
36 --> $DIR/regions-escape-loop-via-vec.rs:17:17
39 | -- ^^^^^^ borrowed value does not live long enough
41 | borrow later used here
44 | - `z` dropped here while still borrowed
46 error: aborting due to 4 previous errors
48 Some errors occurred: E0503, E0597.
49 For more information about an error, try `rustc --explain E0503`.