mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			228 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			228 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ edition: 2021
 | |
| //@ check-pass
 | |
| 
 | |
| #![feature(async_closure)]
 | |
| 
 | |
| async fn foo() {}
 | |
| 
 | |
| async fn call_asyncly(f: impl async Fn(i32) -> i32) -> i32 {
 | |
|     f(1).await
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     let fut = call_asyncly(|x| async move { x + 1 });
 | |
| }
 | 
