mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			378 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			378 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // Regression test for issue #98833.
 | |
| // compile-flags: -Zinline-mir -Cdebug-assertions=off
 | |
| 
 | |
| fn main() {
 | |
|     println!("{}", live::<false>());
 | |
| 
 | |
|     let f = |x: bool| {
 | |
|         debug_assert!(
 | |
|             x
 | |
|         );
 | |
|     };
 | |
|     f(false);
 | |
| }
 | |
| 
 | |
| #[inline]
 | |
| fn live<const B: bool>() -> u32 {
 | |
|     if B {
 | |
|         dead()
 | |
|     } else {
 | |
|         0
 | |
|     }
 | |
| }
 | |
| 
 | |
| #[inline]
 | |
| fn dead() -> u32 {
 | |
|     42
 | |
| }
 | 
