mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			251 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			251 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // build-fail
 | |
| #![feature(inline_const)]
 | |
| 
 | |
| fn foo<T>() {
 | |
|     const { assert!(std::mem::size_of::<T>() == 0); } //~ ERROR E0080
 | |
| }
 | |
| 
 | |
| fn bar<const N: usize>() -> usize {
 | |
|     const { N - 1 } //~ ERROR E0080
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     foo::<i32>();
 | |
|     bar::<0>();
 | |
| }
 | 
