]> git.proxmox.com Git - rustc.git/blame - src/test/ui/borrowck/issue-51415.rs
Update unsuspicious file list
[rustc.git] / src / test / ui / borrowck / issue-51415.rs
CommitLineData
83c7162d
XL
1// Regression test for #51415: match default bindings were failing to
2// see the "move out" implied by `&s` below.
223e47cc
LB
3
4fn main() {
83c7162d
XL
5 let a = vec![String::from("a")];
6 let opt = a.iter().enumerate().find(|(_, &s)| {
7 //~^ ERROR cannot move out
8 *s == String::from("d")
9 }).map(|(i, _)| i);
10 println!("{:?}", opt);
223e47cc 11}