mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-31 13:04:42 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			311 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			311 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| //@ edition:2018
 | |
| 
 | |
| use std::convert::{TryFrom, TryInto};
 | |
| use std::io;
 | |
| 
 | |
| pub struct MyStream;
 | |
| pub struct OtherStream;
 | |
| 
 | |
| pub async fn connect() -> io::Result<MyStream> {
 | |
|     let stream: MyStream = OtherStream.try_into()?;
 | |
|     Ok(stream)
 | |
| }
 | |
| 
 | |
| impl TryFrom<OtherStream> for MyStream {}
 | |
| //~^ ERROR: missing
 | |
| 
 | |
| fn main() {}
 | 
