Sign in
fuchsia
/
third_party
/
rust
/
03534ac8b70de1134ce7e91b172cd629048a6c8b
/
.
/
tests
/
ui
/
mut-function-arguments.rs
blob: 1e682fc4b66c41ec3c8602627e5746a715192a93 [
file
] [
log
] [
blame
]
// run-pass
fn
f
(
mut
y
:
Box
<
isize
>)
{
*
y
=
5
;
assert_eq
!(*
y
,
5
);
}
fn
g
()
{
let
frob
=
|
mut
q
:
Box
<
isize
>|
{
*
q
=
2
;
assert_eq
!(*
q
,
2
);
};
let
w
=
Box
::
new
(
37
);
frob
(
w
);
}
pub
fn
main
()
{
let
z
=
Box
::
new
(
17
);
f
(
z
);
g
();
}