Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
box
/
unit
/
unique-swap.rs
blob: c41ff10fe56a6e9e6ed7a2b16177ae7fabafe0e7 [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
use
std
::
mem
::
swap
;
pub
fn
main
()
{
let
mut
i
:
Box
<
_
>
=
Box
::
new
(
100
);
let
mut
j
:
Box
<
_
>
=
Box
::
new
(
200
);
swap
(&
mut
i
,
&
mut
j
);
assert_eq
!(
i
,
Box
::
new
(
200
));
assert_eq
!(
j
,
Box
::
new
(
100
));
}