]>
Commit | Line | Data |
---|---|---|
0bf4aa26 | 1 | error[E0716]: temporary value dropped while borrowed |
0731742a | 2 | --> $DIR/borrowck-ref-into-rvalue.rs:3:11 |
83c7162d XL |
3 | | |
4 | LL | match Some("Hello".to_string()) { | |
0bf4aa26 | 5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use |
83c7162d XL |
6 | ... |
7 | LL | } | |
0bf4aa26 | 8 | | - temporary value is freed at the end of this statement |
83c7162d XL |
9 | LL | println!("{}", *msg); |
10 | | ---- borrow later used here | |
b7449926 XL |
11 | | |
12 | = note: consider using a `let` binding to create a longer lived value | |
83c7162d XL |
13 | |
14 | error: aborting due to previous error | |
15 | ||
0bf4aa26 | 16 | For more information about this error, try `rustc --explain E0716`. |