]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/struct-pattern-matching.rs
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / structs-enums / struct-pattern-matching.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 a = Foo { x: 1, y: 2 };
11     match a {
12         Foo { x: x, y: y } => println!("yes, {}, {}", x, y)
13     }
14
15     match a {
16         Foo { .. } => ()
17     }
18 }