mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			240 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			240 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| #![deny(dead_code)]
 | |
| 
 | |
| trait Trait {
 | |
|     type Type;
 | |
| }
 | |
| 
 | |
| impl Trait for () {
 | |
|     type Type = ();
 | |
| }
 | |
| 
 | |
| type Used = ();
 | |
| type Unused = (); //~ ERROR type alias `Unused` is never used
 | |
| 
 | |
| fn foo() -> impl Trait<Type = Used> {}
 | |
| 
 | |
| fn main() {
 | |
|     foo();
 | |
| }
 | 
