mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 14:31:55 +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() {}
|