mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
27 lines
559 B
Rust
27 lines
559 B
Rust
|
// 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() {}
|