mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-04 06:56:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
//@ compile-flags: -Zvalidate-mir
 | 
						|
//@ edition: 2021
 | 
						|
 | 
						|
#![feature(async_closure)]
 | 
						|
 | 
						|
// NOT copy.
 | 
						|
struct Ty;
 | 
						|
 | 
						|
fn hello(x: &Ty) {
 | 
						|
    let c = async || {
 | 
						|
        *x;
 | 
						|
        //~^ ERROR cannot move out of `*x` which is behind a shared reference
 | 
						|
    };
 | 
						|
}
 | 
						|
 | 
						|
fn main() {}
 |