]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/pattern-in-closure.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / binding / pattern-in-closure.rs
1 // run-pass
2 #![allow(non_shorthand_field_patterns)]
3
4 struct Foo {
5     x: isize,
6     y: isize
7 }
8
9 pub fn main() {
10     let f = |(x, _): (isize, isize)| println!("{}", x + 1);
11     let g = |Foo { x: x, y: _y }: Foo| println!("{}", x + 1);
12     f((2, 3));
13     g(Foo { x: 1, y: 2 });
14 }