rust/src/test/ui/span/borrowck-ref-into-rvalue.nll.stderr

17 lines
589 B
Plaintext
Raw Normal View History

2018-09-25 10:24:20 -05:00
error[E0716]: temporary value dropped while borrowed
2018-12-25 09:56:47 -06:00
--> $DIR/borrowck-ref-into-rvalue.rs:3:11
|
LL | match Some("Hello".to_string()) {
2018-09-25 10:24:20 -05:00
| ^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
...
LL | }
2018-09-25 10:24:20 -05:00
| - temporary value is freed at the end of this statement
LL | println!("{}", *msg);
| ---- borrow later used here
|
= note: consider using a `let` binding to create a longer lived value
error: aborting due to previous error
2018-09-25 10:24:20 -05:00
For more information about this error, try `rustc --explain E0716`.