diff --git a/hyper/src/common/exec.rs b/hyper/src/common/exec.rs index d0aead2..6c39158 100644 --- a/hyper/src/common/exec.rs +++ b/hyper/src/common/exec.rs @@ -18,8 +18,8 @@ pub trait ConnStreamExec: Clone { fn execute_h2stream(&mut self, fut: H2Stream); } #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] -pub trait NewSvcExec>: Clone { - fn execute_new_svc(&mut self, fut: NewSvcTask); +pub trait NewSvcExec>: Clone { + fn execute_new_svc(&mut self, fut: NewSvcTask); } pub(crate) type BoxSendFuture = Pin + Send>>; #[derive(Clone)] @@ -43,13 +43,13 @@ where } } #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] -impl NewSvcExec for Exec +impl NewSvcExec for Exec where - NewSvcTask: Future + Send + 'static, + NewSvcTask: Future + Send + 'static, S: HttpService, W: Watcher, { - fn execute_new_svc(&mut self, fut: NewSvcTask) { + fn execute_new_svc(&mut self, fut: NewSvcTask) { loop {} } } @@ -65,14 +65,14 @@ where } } #[cfg(all(feature = "server", any(feature = "http1", feature = "http2")))] -impl NewSvcExec for E +impl NewSvcExec for E where - E: Executor> + Clone, - NewSvcTask: Future, + E: Executor> + Clone, + NewSvcTask: Future, S: HttpService, W: Watcher, { - fn execute_new_svc(&mut self, fut: NewSvcTask) { + fn execute_new_svc(&mut self, fut: NewSvcTask) { loop {} } } diff --git a/hyper/src/server/server.rs b/hyper/src/server/server.rs index 6460c37..e7a7b4f 100644 --- a/hyper/src/server/server.rs +++ b/hyper/src/server/server.rs @@ -46,7 +46,7 @@ where I: Accept, IE: Into>, S: MakeServiceRef, - E: NewSvcExec, + E: NewSvcExec, { type Output = (); fn poll(mut self: Pin<&mut Self>, cx: &mut task::Context<'_>) -> Poll { @@ -102,9 +102,8 @@ pub(crate) mod new_svc { use std::error::Error as StdError; use tokio::io::{AsyncRead, AsyncWrite}; - pub struct NewSvcTask> { + pub struct NewSvcTask> { state: State, - a: N, } pub(super) enum State> { @@ -113,16 +112,14 @@ pub(crate) mod new_svc { Connected { future: W::Future }, } - impl, E, W: Watcher> NewSvcTask { + impl, E, W: Watcher> NewSvcTask { pub(super) fn new(watcher: W) -> Self { loop {} } } - impl Future for NewSvcTask + impl Future for NewSvcTask where I: AsyncRead + AsyncWrite + Unpin + Send + 'static, - N: Future>, - NE: Into>, S: HttpService, B: HttpBody + 'static, B::Error: Into>,