]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/borrowck-ref-into-rvalue.fixed
Provide structured suggestion for dropped temp value
[rust.git] / src / test / ui / span / borrowck-ref-into-rvalue.fixed
1 // run-rustfix
2 fn main() {
3     let msg;
4     let binding = Some("Hello".to_string());
5     match binding {
6         //~^ ERROR temporary value dropped while borrowed
7         Some(ref m) => {
8             msg = m;
9         },
10         None => { panic!() }
11     }
12     println!("{}", *msg);
13 }