mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			261 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| type Arr<const N: usize> = [u8; N - 1];
 | |
| //~^ ERROR generic parameters may not be used in const operations
 | |
| 
 | |
| fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
 | |
|     Default::default()
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     let x = test::<33>();
 | |
|     assert_eq!(x, [0; 32]);
 | |
| }
 | 
