2018-09-25 22:06:28 +08:00
|
|
|
error[E0716]: temporary value dropped while borrowed
|
2019-04-07 23:07:36 +08:00
|
|
|
--> $DIR/borrowed-temporary-error.rs:8:10
|
2018-02-28 03:03:23 +08:00
|
|
|
|
|
|
|
|
LL | &(v,)
|
2022-10-20 23:43:27 +08:00
|
|
|
| ^^^^ creates a temporary value which is freed while still in use
|
2019-03-09 20:03:44 +08:00
|
|
|
LL |
|
2018-02-28 03:03:23 +08:00
|
|
|
LL | });
|
2018-09-23 23:30:46 +08:00
|
|
|
| - temporary value is freed at the end of this statement
|
2018-02-28 03:03:23 +08:00
|
|
|
LL | println!("{:?}", x);
|
|
|
|
| - borrow later used here
|
2018-09-10 02:43:46 +08:00
|
|
|
|
|
|
|
|
= note: consider using a `let` binding to create a longer lived value
|
2018-02-28 03:03:23 +08:00
|
|
|
|
2023-11-21 23:44:16 +08:00
|
|
|
error: aborting due to 1 previous error
|
2018-02-28 03:03:23 +08:00
|
|
|
|
2018-09-25 22:06:28 +08:00
|
|
|
For more information about this error, try `rustc --explain E0716`.
|