fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1// run-rustfix 2// Regression test for #51415: match default bindings were failing to 3// see the "move out" implied by `&s` below. 4 5fn main() { 6 let a = vec![String::from("a")]; 7 let opt = a.iter().enumerate().find(|(_, &ref s)| { 8 //~^ ERROR cannot move out 9 *s == String::from("d") 10 }).map(|(i, _)| i); 11 println!("{:?}", opt); 12}