mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			276 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			276 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // check-fail
 | |
| // compile-flags: -Z tiny-const-eval-limit
 | |
| 
 | |
| #[rustfmt::skip]
 | |
| const fn recurse(n: u32) -> u32 {
 | |
|     if n == 0 {
 | |
|         n
 | |
|     } else {
 | |
|         recurse(n - 1) //~ ERROR is taking a long time
 | |
|     }
 | |
| }
 | |
| 
 | |
| const X: u32 = recurse(19);
 | |
| 
 | |
| fn main() {
 | |
|     println!("{X}");
 | |
| }
 | 
