Sign in
android
/
toolchain
/
rustc
/
ff3f07ae99a30006dd85b9d73084edd9355c9db6
/
.
/
src
/
test
/
run-pass
/
structs-enums
/
struct-pattern-matching.rs
blob: 89361bf24551510bcfc2ff7e31bd6f6e3228bf48 [
file
] [
log
] [
blame
]
// 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
{
..
}
=>
()
}
}