]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-move-by-capture.rs
Rollup merge of #107580 - lenko-d:default_value_for_a_lifetime_generic_parameter_prod...
[rust.git] / tests / ui / borrowck / borrowck-move-by-capture.rs
1 #![feature(unboxed_closures, tuple_trait)]
2
3 fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }
4 fn to_fn_once<A:std::marker::Tuple,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 }