]> git.lizzy.rs Git - rust.git/blob - tests/ui/mir/issue-106062.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / mir / issue-106062.rs
1 // edition:2018
2
3 use std::{future::Future, marker::PhantomData};
4
5 fn spawn<T>(future: T) -> PhantomData<T::Output>
6 where
7     T: Future,
8 {
9     loop {}
10 }
11
12 #[derive(Debug)]
13 struct IncomingServer {}
14 impl IncomingServer {
15     async fn connection_handler(handler: impl Sized) -> Result<Ok, std::io::Error> {
16         //~^ ERROR expected type, found variant `Ok` [E0573]
17         loop {}
18     }
19     async fn spawn(&self, request_handler: impl Sized) {
20         async move {
21             spawn(Self::connection_handler(&request_handler));
22         };
23     }
24 }
25
26 fn main() {}