blob: 0f6472b05f7aae7a228983c17c5ebf6bed70db45 [file] [log] [blame]
#![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 cannot return reference to local data `x`
f()
};
drop(r);
}