2022-07-14 19:12:01 -05:00
|
|
|
// run-rustfix
|
2012-08-17 19:30:29 -05:00
|
|
|
fn main() {
|
|
|
|
let msg;
|
2014-05-25 05:10:11 -05:00
|
|
|
match Some("Hello".to_string()) {
|
2019-04-22 02:40:08 -05:00
|
|
|
//~^ ERROR temporary value dropped while borrowed
|
2017-11-20 06:13:27 -06:00
|
|
|
Some(ref m) => {
|
2012-08-17 19:30:29 -05:00
|
|
|
msg = m;
|
2013-03-15 14:24:24 -05:00
|
|
|
},
|
2014-10-09 14:17:22 -05:00
|
|
|
None => { panic!() }
|
2017-12-13 19:27:23 -06:00
|
|
|
}
|
2014-01-09 04:06:55 -06:00
|
|
|
println!("{}", *msg);
|
2012-08-17 19:30:29 -05:00
|
|
|
}
|