]> git.lizzy.rs Git - rust.git/blob - src/test/ui/once-move-out-on-heap.rs
Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
[rust.git] / src / test / ui / once-move-out-on-heap.rs
1 // run-pass
2 // Testing guarantees provided by once functions.
3
4
5
6 use std::sync::Arc;
7
8 fn foo<F:FnOnce()>(blk: F) {
9     blk();
10 }
11
12 pub fn main() {
13     let x = Arc::new(true);
14     foo(move|| {
15         assert!(*x);
16         drop(x);
17     });
18 }