mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			188 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			188 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ check-pass
 | |
| 
 | |
| #![feature(type_alias_impl_trait)]
 | |
| 
 | |
| type Closure = impl Fn(u32) -> u32;
 | |
| 
 | |
| #[define_opaque(Closure)]
 | |
| const ADDER: Closure = |x| x + 1;
 | |
| 
 | |
| fn main() {
 | |
|     let z = (ADDER)(1);
 | |
| }
 | 
