mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 04:57:19 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			207 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			207 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| // check-pass
 | |
| #![deny(dead_code)]
 | |
| 
 | |
| enum Foo {
 | |
|     Bar,
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     let p = [0; 0];
 | |
|     p.bar();
 | |
| }
 | |
| 
 | |
| trait Bar {
 | |
|     fn bar(&self) -> usize {
 | |
|         3
 | |
|     }
 | |
| }
 | |
| 
 | |
| impl Bar for [u32; Foo::Bar as usize] {}
 | 
