mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			329 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			329 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ check-pass
 | |
| 
 | |
| // Tests that const patterns that use generic parameters are
 | |
| // allowed if we are still able to evaluate them.
 | |
| 
 | |
| trait Trait { const ASSOC: usize; }
 | |
| 
 | |
| impl<T> Trait for T {
 | |
|     const ASSOC: usize = 10;
 | |
| }
 | |
| 
 | |
| fn foo<T>(a: usize) {
 | |
|     match a {
 | |
|         <T as Trait>::ASSOC => (),
 | |
|         _ => (),
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
