]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-move-by-capture.rs
Auto merge of #95474 - oli-obk:tait_ub, r=jackh726
[rust.git] / src / test / ui / borrowck / borrowck-move-by-capture.rs
1 #![feature(unboxed_closures)]
2
3 fn to_fn_mut<A,F:FnMut<A>>(f: F) -> F { f }
4 fn to_fn_once<A,F:FnOnce<A>>(f: F) -> F { f }
5
6 pub fn main() {
7     let bar: Box<_> = Box::new(3);
8     let _g = to_fn_mut(|| {
9         let _h = to_fn_once(move || -> isize { *bar }); //~ ERROR cannot move out of
10     });
11 }