]> git.proxmox.com Git - rustc.git/blob - src/test/ui/span/regions-escape-loop-via-vec.stderr
New upstream version 1.14.0+dfsg1
[rustc.git] / src / test / ui / span / regions-escape-loop-via-vec.stderr
1 error: `z` does not live long enough
2 --> $DIR/regions-escape-loop-via-vec.rs:26:5
3 |
4 22 | _y.push(&mut z); //~ ERROR `z` does not live long enough
5 | - borrow occurs here
6 ...
7 26 | }
8 | ^ `z` dropped here while still borrowed
9 27 | //~^ NOTE borrowed value only lives until here
10 28 | }
11 | - borrowed value needs to live until here
12
13 error[E0503]: cannot use `x` because it was mutably borrowed
14 --> $DIR/regions-escape-loop-via-vec.rs:18:11
15 |
16 14 | let mut _y = vec![&mut x];
17 | - borrow of `x` occurs here
18 ...
19 18 | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
20 | ^ use of borrowed `x`
21
22 error[E0503]: cannot use `x` because it was mutably borrowed
23 --> $DIR/regions-escape-loop-via-vec.rs:20:13
24 |
25 14 | let mut _y = vec![&mut x];
26 | - borrow of `x` occurs here
27 ...
28 20 | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
29 | ^^^^^ use of borrowed `x`
30
31 error[E0506]: cannot assign to `x` because it is borrowed
32 --> $DIR/regions-escape-loop-via-vec.rs:24:9
33 |
34 14 | let mut _y = vec![&mut x];
35 | - borrow of `x` occurs here
36 ...
37 24 | x += 1; //~ ERROR cannot assign
38 | ^^^^^^ assignment to borrowed `x` occurs here
39
40 error: aborting due to 4 previous errors
41