Sign in
fuchsia
/
third_party
/
rust
/
15adfb9cd5b029268e1470a41391d91859b0a1f8
/
.
/
tests
/
ui
/
expr-copy.rs
blob: cfe47ff6d939c1578e76724ef5c8e1d4efa43d86 [
file
] [
log
] [
blame
]
//@ run-pass
fn
f
(
arg
:
&
mut
A
)
{
arg
.
a
=
100
;
}
#[
derive
(
Copy
,
Clone
)]
struct
A
{
a
:
isize
}
pub
fn
main
()
{
let
mut
x
=
A
{
a
:
10
};
f
(&
mut
x
);
assert_eq
!(
x
.
a
,
100
);
x
.
a
=
20
;
let
mut
y
=
x
;
f
(&
mut
y
);
assert_eq
!(
x
.
a
,
20
);
}