From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/mir/issue-106062.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/ui/mir/issue-106062.rs (limited to 'tests/ui/mir/issue-106062.rs') 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(future: T) -> PhantomData +where + T: Future, +{ + loop {} +} + +#[derive(Debug)] +struct IncomingServer {} +impl IncomingServer { + async fn connection_handler(handler: impl Sized) -> Result { + //~^ 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() {} -- cgit v1.2.3