Sign in
fuchsia
/
third_party
/
rust
/
97d936423c914c4e3402bfecfd6943e1edf23815
/
.
/
src
/
test
/
ui
/
once-move-out-on-heap.rs
blob: 4e2e400cec02371e3918f73e9d198c55cab66d46 [
file
] [
log
] [
blame
]
// 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
);
});
}