2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(non_shorthand_field_patterns)]
|
|
|
|
|
2012-08-06 17:01:14 -07:00
|
|
|
struct Foo {
|
2015-03-25 17:06:52 -07:00
|
|
|
x: isize,
|
|
|
|
y: isize,
|
2012-08-06 17:01:14 -07:00
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-08-06 17:01:14 -07:00
|
|
|
let a = Foo { x: 1, y: 2 };
|
|
|
|
match a {
|
2013-09-24 22:16:43 -07:00
|
|
|
Foo { x: x, y: y } => println!("yes, {}, {}", x, y)
|
2012-08-06 17:01:14 -07:00
|
|
|
}
|
2013-12-31 19:07:41 -05:00
|
|
|
|
|
|
|
match a {
|
|
|
|
Foo { .. } => ()
|
|
|
|
}
|
2012-08-06 17:01:14 -07:00
|
|
|
}
|