mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 21:16:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			32 lines
		
	
	
		
			866 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
		
			866 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ run-rustfix
 | |
| 
 | |
| use std::fmt::Debug;
 | |
| use std::marker::PhantomData;
 | |
| use std::convert::{self, TryFrom};
 | |
| 
 | |
| #[allow(unused)]
 | |
| struct Codec<EncodeLine, DecodeLine> {
 | |
|     phantom_decode: PhantomData<DecodeLine>,
 | |
|     phantom_encode: PhantomData<EncodeLine>,
 | |
| }
 | |
| 
 | |
| pub enum ParseError {}
 | |
| 
 | |
| impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
 | |
|     DecodeLine: Debug + convert::TryFrom<String>,
 | |
|     DecodeLine: convert::TryFrom<String, Error = ParseError>,
 | |
|     //~^ ERROR expected trait, found enum `ParseError`
 | |
|     //~| HELP constrain the associated type to `ParseError`
 | |
| {
 | |
| }
 | |
| 
 | |
| impl<EncodeLine, DecodeLine> Codec<EncodeLine, DecodeLine> where
 | |
|     DecodeLine: Debug + TryFrom<String>,
 | |
|     DecodeLine: TryFrom<String, Error = ParseError>,
 | |
|     //~^ ERROR expected trait, found enum `ParseError`
 | |
|     //~| HELP constrain the associated type to `ParseError`
 | |
| {
 | |
| }
 | |
| 
 | |
| fn main() {}
 | 
