rust/tests/ui/mir/issue-106062.rs

27 lines
559 B
Rust
Raw Normal View History

2023-01-09 10:33:09 -06:00
// edition:2018
use std::{future::Future, marker::PhantomData};
fn spawn<T>(future: T) -> PhantomData<T::Output>
where
T: Future,
{
loop {}
}
#[derive(Debug)]
struct IncomingServer {}
impl IncomingServer {
async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> {
//~^ ERROR expected type, found variant `Ok` [E0573]
loop {}
}
async fn spawn(&self, request_handler: impl Sized) {
async move {
spawn(Self::connection_handler(&request_handler));
};
}
}
fn main() {}