mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			278 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			278 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ edition: 2021
 | |
| 
 | |
| //@ aux-build: executor.rs
 | |
| extern crate executor;
 | |
| 
 | |
| async fn call_once(f: impl AsyncFnOnce()) {
 | |
|     f().await;
 | |
| }
 | |
| 
 | |
| pub fn main() {
 | |
|     let async_closure = async || {};
 | |
|     executor::block_on(async_closure());
 | |
|     executor::block_on(call_once(async_closure));
 | |
| }
 | 
