@@ -7,7 +7,7 @@ LL | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
7
7
| ^ use of borrowed `x`
8
8
LL | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
9
9
LL | _y.push(&mut z);
10
- | -- borrow used here in later iteration of loop
10
+ | -- borrow used here, in later iteration of loop
11
11
12
12
error[E0503]: cannot use `x` because it was mutably borrowed
13
13
--> $DIR/regions-escape-loop-via-vec.rs:16:21
@@ -18,15 +18,15 @@ LL | while x < 10 { //~ ERROR cannot use `x` because it was mutably borrowed
18
18
LL | let mut z = x; //~ ERROR cannot use `x` because it was mutably borrowed
19
19
| ^ use of borrowed `x`
20
20
LL | _y.push(&mut z);
21
- | -- borrow used here in later iteration of loop
21
+ | -- borrow used here, in later iteration of loop
22
22
23
23
error[E0597]: `z` does not live long enough
24
24
--> $DIR/regions-escape-loop-via-vec.rs:17:17
25
25
|
26
26
LL | _y.push(&mut z);
27
27
| -- ^^^^^^ borrowed value does not live long enough
28
28
| |
29
- | borrow used here in later iteration of loop
29
+ | borrow used here, in later iteration of loop
30
30
...
31
31
LL | }
32
32
| - `z` dropped here while still borrowed
@@ -38,7 +38,7 @@ LL | let mut _y = vec![&mut x];
38
38
| ------ borrow of `x` occurs here
39
39
...
40
40
LL | _y.push(&mut z);
41
- | -- borrow used here in later iteration of loop
41
+ | -- borrow used here, in later iteration of loop
42
42
LL | //~^ ERROR `z` does not live long enough
43
43
LL | x += 1; //~ ERROR cannot assign
44
44
| ^^^^^^ use of borrowed `x`
0 commit comments