Sign in
android
/
toolchain
/
rustc
/
refs/heads/main
/
.
/
tests
/
ui
/
closures
/
once-move-out-on-heap.rs
blob: 37e5359aec9c531bf98fdc5a7e97f0192a00641e [
file
] [
log
] [
blame
] [
edit
]
//@ run-pass
// 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
);
});
}