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