2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-08-31 15:02:01 +02:00
|
|
|
#![allow(non_shorthand_field_patterns)]
|
|
|
|
|
2012-11-06 18:41:06 -08:00
|
|
|
struct Foo {
|
2015-03-25 17:06:52 -07:00
|
|
|
x: isize,
|
|
|
|
y: isize
|
2012-11-06 18:41:06 -08:00
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2015-03-25 17:06:52 -07:00
|
|
|
let f = |(x, _): (isize, isize)| println!("{}", x + 1);
|
2015-02-01 12:44:15 -05:00
|
|
|
let g = |Foo { x: x, y: _y }: Foo| println!("{}", x + 1);
|
2012-11-06 18:41:06 -08:00
|
|
|
f((2, 3));
|
|
|
|
g(Foo { x: 1, y: 2 });
|
|
|
|
}
|