mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 21:16:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			165 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			165 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| 
 | |
| 
 | |
| fn test<F>(f: F) -> usize where F: FnOnce(usize) -> usize {
 | |
|     return f(22);
 | |
| }
 | |
| 
 | |
| pub fn main() {
 | |
|     let y = test(|x| 4 * x);
 | |
|     assert_eq!(y, 88);
 | |
| }
 | 
