Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
binding
/
match-ref-binding-mut.rs
blob: ab48148083260c92cb2eca580854524e0f8498ea [
file
] [
log
] [
blame
] [
edit
]
//@ 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
);
}