fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.3 KiB66 linesraw
1error[E0597]: `young[_]` does not live long enough
2  --> $DIR/borrowck-let-suggestion-suffixes.rs:13:17
3   |
4LL |         let young = ['y'];       // statement 3
5   |             ----- binding `young` declared here
6...
7LL |         v2.push(&young[0]);      // statement 4
8   |                 ^^^^^^^^^ borrowed value does not live long enough
9...
10LL |     }
11   |     - `young[_]` dropped here while still borrowed
12...
13LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
14   |          -- borrow later used here
15
16error[E0716]: temporary value dropped while borrowed
17  --> $DIR/borrowck-let-suggestion-suffixes.rs:20:14
18   |
19LL |     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...
24LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
25   |              -- borrow later used here
26   |
27help: consider using a `let` binding to create a longer lived value
28   |
29LL ~     let binding = id('x');
30LL ~     v3.push(&binding);           // statement 6
31   |
32
33error[E0716]: temporary value dropped while borrowed
34  --> $DIR/borrowck-let-suggestion-suffixes.rs:30:18
35   |
36LL |         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...
41LL |         v4.use_ref();
42   |         -- borrow later used here
43   |
44   = note: consider using a `let` binding to create a longer lived value
45
46error[E0716]: temporary value dropped while borrowed
47  --> $DIR/borrowck-let-suggestion-suffixes.rs:41:14
48   |
49LL |     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...
54LL |     (v1, v2, v3, /* v4 is above. */ v5).use_ref();
55   |                                     -- borrow later used here
56   |
57help: consider using a `let` binding to create a longer lived value
58   |
59LL ~     let binding = id('z');
60LL ~     v5.push(&binding);
61   |
62
63error: aborting due to 4 previous errors
64
65Some errors have detailed explanations: E0597, E0716.
66For more information about an error, try `rustc --explain E0597`.