]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/issue-11925.rs
Rollup merge of #106043 - c410-f3r:moar-errors, r=petrochenkov
[rust.git] / src / test / ui / span / issue-11925.rs
1 #![feature(unboxed_closures, tuple_trait)]
2
3 fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }
4
5 fn main() {
6     let r = {
7         let x: Box<_> = Box::new(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 }