2022-07-30 05:37:48 +00:00
|
|
|
#![feature(unboxed_closures, tuple_trait)]
|
2015-02-03 11:32:26 -05:00
|
|
|
|
2022-07-30 05:37:48 +00:00
|
|
|
fn to_fn_mut<A:std::marker::Tuple,F:FnMut<A>>(f: F) -> F { f }
|
|
|
|
|
fn to_fn_once<A:std::marker::Tuple,F:FnOnce<A>>(f: F) -> F { f }
|
2015-01-07 18:53:58 -08:00
|
|
|
|
2013-05-23 21:37:37 -04:00
|
|
|
pub fn main() {
|
2021-08-25 02:39:40 +02:00
|
|
|
let bar: Box<_> = Box::new(3);
|
2015-02-03 11:32:26 -05:00
|
|
|
let _g = to_fn_mut(|| {
|
|
|
|
|
let _h = to_fn_once(move || -> isize { *bar }); //~ ERROR cannot move out of
|
|
|
|
|
});
|
2013-01-10 10:59:58 -08:00
|
|
|
}
|