]> git.lizzy.rs Git - rust.git/blob - tests/ui/pin-macro/lifetime_errors_on_promotion_misusage.stderr
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
[rust.git] / tests / ui / pin-macro / lifetime_errors_on_promotion_misusage.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/lifetime_errors_on_promotion_misusage.rs:11:35
3    |
4 LL |     let phantom_pinned = identity(pin!(PhantomPinned));
5    |                                   ^^^^^^^^^^^^^^^^^^^ - temporary value is freed at the end of this statement
6    |                                   |
7    |                                   creates a temporary value which is freed while still in use
8 LL |
9 LL |     stuff(phantom_pinned)
10    |           -------------- borrow later used here
11    |
12    = note: consider using a `let` binding to create a longer lived value
13    = note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
14
15 error[E0716]: temporary value dropped while borrowed
16   --> $DIR/lifetime_errors_on_promotion_misusage.rs:18:30
17    |
18 LL |     let phantom_pinned = {
19    |         -------------- borrow later stored here
20 LL |         let phantom_pinned = pin!(PhantomPinned);
21    |                              ^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
22 ...
23 LL |     };
24    |     - temporary value is freed at the end of this statement
25    |
26    = note: consider using a `let` binding to create a longer lived value
27    = note: this error originates in the macro `pin` (in Nightly builds, run with -Z macro-backtrace for more info)
28
29 error: aborting due to 2 previous errors
30
31 For more information about this error, try `rustc --explain E0716`.