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