]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/issue-11925.rs
Rollup merge of #87922 - Manishearth:c-enum-target-spec, r=nagisa,eddyb
[rust.git] / src / test / ui / span / issue-11925.rs
1 #![feature(box_syntax, unboxed_closures)]
2
3 fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
4
5 fn main() {
6     let r = {
7         let x: Box<_> = box 42;
8         let f = to_fn_once(move|| &x); //~ ERROR cannot return reference to local data `x`
9         f()
10     };
11
12     drop(r);
13 }