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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
560 B
Rust
Raw Permalink 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() {}