mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			347 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			347 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
#![feature(unboxed_closures, tuple_trait)]
 | 
						|
 | 
						|
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 }
 | 
						|
 | 
						|
pub fn main() {
 | 
						|
    let bar: Box<_> = Box::new(3);
 | 
						|
    let _g = to_fn_mut(|| {
 | 
						|
        let _h = to_fn_once(move || -> isize { *bar }); //~ ERROR cannot move out of
 | 
						|
    });
 | 
						|
}
 |