Sign in
fuchsia
/
third_party
/
rust
/
11a0b968c287c81680387ffcf112328d52d7e815
/
.
/
src
/
test
/
ui
/
binding
/
match-ref-binding-mut.rs
blob: d7afd61bc8e325e16dfc6a16edc9a99938fc1a4d [
file
] [
log
] [
blame
]
// run-pass
#![
allow
(
non_shorthand_field_patterns
)]
struct
Rec
{
f
:
isize
}
fn
destructure
(
x
:
&
mut
Rec
)
{
match
*
x
{
Rec
{
f
:
ref
mut
f
}
=>
*
f
+=
1
}
}
pub
fn
main
()
{
let
mut
v
=
Rec
{
f
:
22
};
destructure
(&
mut
v
);
assert_eq
!(
v
.
f
,
23
);
}