2018-09-23 10:30:46 -05:00
|
|
|
error[E0714]: temporary value dropped while borrowed
|
2018-03-05 16:29:05 -06:00
|
|
|
--> $DIR/borrowed-temporary-error.rs:20:10
|
2018-02-27 13:03:23 -06:00
|
|
|
|
|
|
|
|
LL | &(v,)
|
2018-09-23 10:30:46 -05:00
|
|
|
| ^^^^ creates a temporary which is freed while still in use
|
|
|
|
LL | //~^ ERROR temporary value dropped while borrowed [E0714]
|
2018-02-27 13:03:23 -06:00
|
|
|
LL | });
|
2018-09-23 10:30:46 -05:00
|
|
|
| - temporary value is freed at the end of this statement
|
2018-02-27 13:03:23 -06:00
|
|
|
LL | println!("{:?}", x);
|
|
|
|
| - borrow later used here
|
2018-09-09 13:43:46 -05:00
|
|
|
|
|
|
|
|
= note: consider using a `let` binding to create a longer lived value
|
2018-02-27 13:03:23 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-09-23 10:30:46 -05:00
|
|
|
For more information about this error, try `rustc --explain E0714`.
|