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);
});
}