Sign in
fuchsia
/
third_party
/
rust
/
9d09331e00b02f81c714b0c41ce3a38380dd36a2
/
.
/
src
/
test
/
ui
/
expr-copy.rs
blob: 1c6ae03810f08c410f8b846b1fdd268916969a6f [
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
);
}