blob: cac9fd5bfb68da851aed9e9785d270915aba7c80 [file] [log] [blame] [edit]
#![feature(unboxed_closures, tuple_trait)]
fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }
fn main() {
let r = {
let x: Box<_> = Box::new(42);
let f = to_fn_once(move|| &x); //~ ERROR cannot return reference to local data `x`
f()
};
drop(r);
}