mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			327 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			327 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| //@ compile-flags: -C overflow_checks=false
 | |
| 
 | |
| #![feature(cfg_overflow_checks)]
 | |
| 
 | |
| fn main() {
 | |
|     assert!(!cfg!(overflow_checks));
 | |
|     assert!(!compiles_differently());
 | |
| }
 | |
| 
 | |
| #[cfg(overflow_checks)]
 | |
| fn compiles_differently()->bool {
 | |
|     true
 | |
| }
 | |
| 
 | |
| #[cfg(not(overflow_checks))]
 | |
| fn compiles_differently()->bool {
 | |
|     false
 | |
| }
 | 
