]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/borrowck-let-suggestion-suffixes.stderr
Optimize `TyKind::eq`.
[rust.git] / tests / ui / span / borrowck-let-suggestion-suffixes.stderr
1 error[E0597]: `young[_]` does not live long enough
2   --> $DIR/borrowck-let-suggestion-suffixes.rs:13:17
3    |
4 LL |         let young = ['y'];       // statement 3
5    |             ----- binding `young` declared here
6 ...
7 LL |         v2.push(&young[0]);      // statement 4
8    |                 ^^^^^^^^^ borrowed value does not live long enough
9 ...
10 LL |     }
11    |     - `young[_]` dropped here while still borrowed
12 ...
13 LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
14    |          -- borrow later used here
15
16 error[E0716]: temporary value dropped while borrowed
17   --> $DIR/borrowck-let-suggestion-suffixes.rs:20:14
18    |
19 LL |     v3.push(&id('x'));           // statement 6
20    |              ^^^^^^^ - temporary value is freed at the end of this statement
21    |              |
22    |              creates a temporary value which is freed while still in use
23 ...
24 LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
25    |              -- borrow later used here
26    |
27 help: consider using a `let` binding to create a longer lived value
28    |
29 LL ~     let binding = id('x');
30 LL ~     v3.push(&binding);           // statement 6
31    |
32
33 error[E0716]: temporary value dropped while borrowed
34   --> $DIR/borrowck-let-suggestion-suffixes.rs:30:18
35    |
36 LL |         v4.push(&id('y'));
37    |                  ^^^^^^^ - temporary value is freed at the end of this statement
38    |                  |
39    |                  creates a temporary value which is freed while still in use
40 ...
41 LL |         v4.use_ref();
42    |         ------------ borrow later used here
43    |
44    = note: consider using a `let` binding to create a longer lived value
45
46 error[E0716]: temporary value dropped while borrowed
47   --> $DIR/borrowck-let-suggestion-suffixes.rs:41:14
48    |
49 LL |     v5.push(&id('z'));
50    |              ^^^^^^^ - temporary value is freed at the end of this statement
51    |              |
52    |              creates a temporary value which is freed while still in use
53 ...
54 LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
55    |                                     -- borrow later used here
56    |
57 help: consider using a `let` binding to create a longer lived value
58    |
59 LL ~     let binding = id('z');
60 LL ~     v5.push(&binding);
61    |
62
63 error: aborting due to 4 previous errors
64
65 Some errors have detailed explanations: E0597, E0716.
66 For more information about an error, try `rustc --explain E0597`.