fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
356 B12 linesraw
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}