|
1 | | -error[E0716]: temporary value dropped while borrowed |
| 1 | +error[E0597]: value does not live long enough |
2 | 2 | --> $DIR/lifetime_errors_on_promotion_misusage.rs:11:35 |
3 | 3 | | |
4 | 4 | LL | let phantom_pinned = identity(pin!(PhantomPinned)); |
5 | | - | ^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement |
| 5 | + | ^^^^^^^^^^^^^^^^^^^ - value dropped here while still borrowed |
6 | 6 | | | |
7 | | - | creates a temporary value which is freed while still in use |
| 7 | + | borrowed value does not live long enough |
8 | 8 | LL | |
9 | 9 | LL | stuff(phantom_pinned) |
10 | 10 | | -------------- borrow later used here |
11 | 11 | | |
12 | 12 | = note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info) |
13 | | -help: consider using a `let` binding to create a longer lived value |
14 | | - | |
15 | | -LL ~ let binding = pin!(PhantomPinned); |
16 | | -LL ~ let phantom_pinned = identity(binding); |
17 | | - | |
18 | 13 |
|
19 | | -error[E0716]: temporary value dropped while borrowed |
| 14 | +error[E0597]: value does not live long enough |
20 | 15 | --> $DIR/lifetime_errors_on_promotion_misusage.rs:18:30 |
21 | 16 | | |
22 | 17 | LL | let phantom_pinned = { |
23 | 18 | | -------------- borrow later stored here |
24 | 19 | LL | let phantom_pinned = pin!(PhantomPinned); |
25 | | - | ^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use |
| 20 | + | ^^^^^^^^^^^^^^^^^^^ borrowed value does not live long enough |
26 | 21 | ... |
27 | 22 | LL | }; |
28 | | - | - temporary value is freed at the end of this statement |
| 23 | + | - value dropped here while still borrowed |
29 | 24 | | |
30 | | - = note: consider using a `let` binding to create a longer lived value |
31 | 25 | = note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info) |
32 | 26 |
|
33 | 27 | error: aborting due to 2 previous errors |
34 | 28 |
|
35 | | -For more information about this error, try `rustc --explain E0716`. |
| 29 | +For more information about this error, try `rustc --explain E0597`. |
0 commit comments