blob: 276aaa1c2931d99fcca55e1a8e4c693fb1ee9f7d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#![feature(box_syntax, unboxed_closures)]
fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
fn main() {
let r = {
let x: Box<_> = box 42;
let f = to_fn_once(move|| &x); //~ ERROR does not live long enough
f()
};
drop(r);
}
|