1 error: `z` does not live long enough
2 --> $DIR/regions-escape-loop-via-vec.rs:26:5
4 22 | _y.push(&mut z); //~ ERROR `z` does not live long enough
8 | ^ `z` dropped here while still borrowed
9 27 | //~^ NOTE borrowed value only lives until here
11 | - borrowed value needs to live until here
13 error[E0503]: cannot use `x` because it was mutably borrowed
14 --> $DIR/regions-escape-loop-via-vec.rs:18:11
16 14 | let mut _y = vec![&mut x];
17 | - borrow of `x` occurs here
19 18 | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
20 | ^ use of borrowed `x`
22 error[E0503]: cannot use `x` because it was mutably borrowed
23 --> $DIR/regions-escape-loop-via-vec.rs:20:13
25 14 | let mut _y = vec![&mut x];
26 | - borrow of `x` occurs here
28 20 | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
29 | ^^^^^ use of borrowed `x`
31 error[E0506]: cannot assign to `x` because it is borrowed
32 --> $DIR/regions-escape-loop-via-vec.rs:24:9
34 14 | let mut _y = vec![&mut x];
35 | - borrow of `x` occurs here
37 24 | x += 1; //~ ERROR cannot assign
38 | ^^^^^^ assignment to borrowed `x` occurs here
40 error: aborting due to 4 previous errors