1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// run-pass #![allow(non_shorthand_field_patterns)] struct Foo { x: isize, y: isize, } pub fn main() { let a = Foo { x: 1, y: 2 }; match a { Foo { x: x, y: y } => println!("yes, {}, {}", x, y) } match a { Foo { .. } => () } }