1
1
error[E0597]: `young[_]` does not live long enough
2
- --> $DIR/borrowck-let-suggestion-suffixes.rs:12 :17
2
+ --> $DIR/borrowck-let-suggestion-suffixes.rs:13 :17
3
3
|
4
+ LL | let young = ['y']; // statement 3
5
+ | ----- binding `young` declared here
6
+ ...
4
7
LL | v2.push(&young[0]); // statement 4
5
8
| ^^^^^^^^^ borrowed value does not live long enough
6
9
...
@@ -11,7 +14,7 @@ LL | (v1, v2, v3, /* v4 is above. */ v5).use_ref();
11
14
| -- borrow later used here
12
15
13
16
error[E0716]: temporary value dropped while borrowed
14
- --> $DIR/borrowck-let-suggestion-suffixes.rs:19 :14
17
+ --> $DIR/borrowck-let-suggestion-suffixes.rs:20 :14
15
18
|
16
19
LL | v3.push(&id('x')); // statement 6
17
20
| ^^^^^^^ - temporary value is freed at the end of this statement
@@ -28,7 +31,7 @@ LL ~ v3.push(&binding); // statement 6
28
31
|
29
32
30
33
error[E0716]: temporary value dropped while borrowed
31
- --> $DIR/borrowck-let-suggestion-suffixes.rs:29 :18
34
+ --> $DIR/borrowck-let-suggestion-suffixes.rs:30 :18
32
35
|
33
36
LL | v4.push(&id('y'));
34
37
| ^^^^^^^ - temporary value is freed at the end of this statement
@@ -41,7 +44,7 @@ LL | v4.use_ref();
41
44
= note: consider using a `let` binding to create a longer lived value
42
45
43
46
error[E0716]: temporary value dropped while borrowed
44
- --> $DIR/borrowck-let-suggestion-suffixes.rs:40 :14
47
+ --> $DIR/borrowck-let-suggestion-suffixes.rs:41 :14
45
48
|
46
49
LL | v5.push(&id('z'));
47
50
| ^^^^^^^ - temporary value is freed at the end of this statement
0 commit comments