mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 21:16:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			224 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			224 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-pass
 | |
| 
 | |
| #![deny(dead_code)]
 | |
| 
 | |
| pub struct GenericFoo<T>(#[allow(dead_code)] T);
 | |
| 
 | |
| type Foo = GenericFoo<u32>;
 | |
| 
 | |
| impl Foo {
 | |
|     fn bar(self) -> u8 {
 | |
|         0
 | |
|     }
 | |
| }
 | |
| 
 | |
| fn main() {
 | |
|     println!("{}", GenericFoo(0).bar());
 | |
| }
 | 
