mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			237 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			237 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // run-pass
 | |
| // compile-flags:-Zpolymorphize=on
 | |
| 
 | |
| fn fop<T>() {}
 | |
| 
 | |
| fn bar<T>() -> &'static fn() {
 | |
|     &(fop::<T> as fn())
 | |
| }
 | |
| pub const FN: &'static fn() = &(fop::<i32> as fn());
 | |
| 
 | |
| fn main() {
 | |
|     bar::<u32>();
 | |
|     bar::<i32>();
 | |
|     (FN)();
 | |
| }
 | 
