diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/mir/issue-106062.rs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/ui/mir/issue-106062.rs b/tests/ui/mir/issue-106062.rs new file mode 100644 index 000000000..621ba566e --- /dev/null +++ b/tests/ui/mir/issue-106062.rs @@ -0,0 +1,26 @@ +// 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() {} |