2024-02-16 14:02:50 -06:00
|
|
|
//@ edition:2018
|
2020-07-23 19:41:05 -05:00
|
|
|
|
|
|
|
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() {}
|