|
1 | 1 | error[E0597]: `young[..]` does not live long enough
|
2 |
| - --> $DIR/borrowck-let-suggestion-suffixes.rs:52:1 |
| 2 | + --> $DIR/borrowck-let-suggestion-suffixes.rs:54:1 |
3 | 3 | |
|
4 |
| -19 | v2.push(&young[0]); // statement 4 |
| 4 | +21 | v2.push(&young[0]); // statement 4 |
5 | 5 | | -------- borrow occurs here
|
6 | 6 | ...
|
7 |
| -52 | } |
| 7 | +54 | } |
8 | 8 | | ^ `young[..]` dropped here while still borrowed
|
9 | 9 | |
|
10 | 10 | = note: values in a scope are dropped in the opposite order they are created
|
11 | 11 |
|
12 | 12 | error[E0597]: borrowed value does not live long enough
|
13 |
| - --> $DIR/borrowck-let-suggestion-suffixes.rs:24:18 |
| 13 | + --> $DIR/borrowck-let-suggestion-suffixes.rs:26:22 |
14 | 14 | |
|
15 |
| -24 | v3.push(&'x'); // statement 6 |
16 |
| - | --- ^ temporary value dropped here while still borrowed |
| 15 | +26 | v3.push(&id('x')); // statement 6 |
| 16 | + | ------- ^ temporary value dropped here while still borrowed |
17 | 17 | | |
|
18 | 18 | | temporary value created here
|
19 | 19 | ...
|
20 |
| -52 | } |
| 20 | +54 | } |
21 | 21 | | - temporary value needs to live until here
|
22 | 22 | |
|
23 | 23 | = note: consider using a `let` binding to increase its lifetime
|
24 | 24 |
|
25 | 25 | error[E0597]: borrowed value does not live long enough
|
26 |
| - --> $DIR/borrowck-let-suggestion-suffixes.rs:34:22 |
| 26 | + --> $DIR/borrowck-let-suggestion-suffixes.rs:36:26 |
27 | 27 | |
|
28 |
| -34 | v4.push(&'y'); |
29 |
| - | --- ^ temporary value dropped here while still borrowed |
| 28 | +36 | v4.push(&id('y')); |
| 29 | + | ------- ^ temporary value dropped here while still borrowed |
30 | 30 | | |
|
31 | 31 | | temporary value created here
|
32 | 32 | ...
|
33 |
| -40 | } // (statement 7) |
| 33 | +42 | } // (statement 7) |
34 | 34 | | - temporary value needs to live until here
|
35 | 35 | |
|
36 | 36 | = note: consider using a `let` binding to increase its lifetime
|
37 | 37 |
|
38 | 38 | error[E0597]: borrowed value does not live long enough
|
39 |
| - --> $DIR/borrowck-let-suggestion-suffixes.rs:45:18 |
| 39 | + --> $DIR/borrowck-let-suggestion-suffixes.rs:47:22 |
40 | 40 | |
|
41 |
| -45 | v5.push(&'z'); |
42 |
| - | --- ^ temporary value dropped here while still borrowed |
| 41 | +47 | v5.push(&id('z')); |
| 42 | + | ------- ^ temporary value dropped here while still borrowed |
43 | 43 | | |
|
44 | 44 | | temporary value created here
|
45 | 45 | ...
|
46 |
| -52 | } |
| 46 | +54 | } |
47 | 47 | | - temporary value needs to live until here
|
48 | 48 | |
|
49 | 49 | = note: consider using a `let` binding to increase its lifetime
|
|
0 commit comments