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 --- src/test/ui/impl-trait/issue-103181-1.rs | 85 -------------------------------- 1 file changed, 85 deletions(-) delete mode 100644 src/test/ui/impl-trait/issue-103181-1.rs (limited to 'src/test/ui/impl-trait/issue-103181-1.rs') diff --git a/src/test/ui/impl-trait/issue-103181-1.rs b/src/test/ui/impl-trait/issue-103181-1.rs deleted file mode 100644 index 197aedf9d..000000000 --- a/src/test/ui/impl-trait/issue-103181-1.rs +++ /dev/null @@ -1,85 +0,0 @@ -// edition:2021 - -mod hyper { - use std::{fmt::Debug, future::Future, marker::PhantomData, pin::Pin, task::Poll}; - - pub trait HttpBody { - type Error; - } - impl HttpBody for () { - //~^ ERROR not all trait items implemented, missing: `Error` - // don't implement `Error` here for the ICE - } - - pub struct Server(I, S); - - pub fn serve(_: S) -> Server { - todo!() - } - - impl Future for Server<(), S> - where - S: MakeServiceRef<(), (), ResBody = B>, - B: HttpBody, - B::Error: Debug, - { - type Output = (); - - fn poll(self: Pin<&mut Self>, _: &mut std::task::Context<'_>) -> Poll { - todo!() - } - } - - pub trait MakeServiceRef { - type ResBody; - } - - impl MakeServiceRef<(), ()> for T - where - T: for<'a> Service<&'a (), Response = S>, - S: Service<()>, - { - type ResBody = (); - } - - pub struct MakeServiceFn(pub F); - pub struct ServiceFn(pub PhantomData<(F, R)>); - - pub trait Service { - type Response; - } - - impl<'t, F, Ret, Target, Svc> Service<&'t Target> for MakeServiceFn - where - F: Fn() -> Ret, - Ret: Future>, - { - type Response = Svc; - } - - impl Service for ServiceFn - where - F: Fn() -> Ret, - Ret: Future>, - { - type Response = ResBody; - } -} - -async fn smarvice() -> Result<(), ()> { - Ok(()) -} - -fn service_fn(f: F) -> hyper::ServiceFn -where - F: Fn() -> S, -{ - hyper::ServiceFn(std::marker::PhantomData) -} - -async fn iceice() { - let service = hyper::MakeServiceFn(|| async { Ok::<_, ()>(service_fn(|| smarvice())) }); - hyper::serve::<(), _>(service).await; -} - -fn main() {} -- cgit v1.2.3