mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			288 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			288 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
// Check that closures do not implement `Clone` if their environment is not `Clone`.
 | 
						|
 | 
						|
struct S(i32);
 | 
						|
 | 
						|
fn main() {
 | 
						|
    let a = S(5);
 | 
						|
    let hello = move || {
 | 
						|
        println!("Hello {}", a.0);
 | 
						|
    };
 | 
						|
 | 
						|
    let hello = hello.clone(); //~ ERROR the trait bound `S: Clone` is not satisfied
 | 
						|
}
 |