Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
structs-enums
/
struct-pattern-matching.rs
blob: 96325fc3c14f16bf3e8a9f03a591f8c5ad65efbc [
file
] [
log
] [
blame
] [
edit
]
//@ 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
{
..
}
=>
()
}
}