Sign in
fuchsia
/
third_party
/
rust
/
89573b3c8b629507130b1ec8beeaf550fdc0e046
/
.
/
src
/
test
/
run-pass
/
once-move-out-on-heap.rs
blob: 46e663417cf93b056270f5dd0323ce28532f5a47 [
file
] [
log
] [
blame
]
// Testing guarantees provided by once functions.
use
std
::
sync
::
Arc
;
fn
foo
<
F
:
FnOnce
()>(
blk
:
F
)
{
blk
();
}
pub
fn
main
()
{
let
x
=
Arc
::
new
(
true
);
foo
(
move
||
{
assert
!(*
x
);
drop
(
x
);
});
}