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

17 lines
564 B
Plaintext
Raw Normal View History

error[E0597]: borrowed value does not live long enough
--> $DIR/borrowck-ref-into-rvalue.rs:13:11
|
LL | match Some("Hello".to_string()) {
| ^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough
...
LL | }
| - temporary value only lives until here
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
For more information about this error, try `rustc --explain E0597`.