diff --git a/actix-http/src/body/response_body.rs b/actix-http/src/body/response_body.rs index aa3c9b5ff..699ea9384 100644 --- a/actix-http/src/body/response_body.rs +++ b/actix-http/src/body/response_body.rs @@ -45,7 +45,8 @@ impl ResponseBody { impl MessageBody for ResponseBody where - B: MessageBody, + B: MessageBody, + B::Error: Into, { type Error = Error; @@ -66,7 +67,8 @@ where impl Stream for ResponseBody where - B: MessageBody, + B: MessageBody, + B::Error: Into, { type Item = Result; @@ -75,7 +77,7 @@ where cx: &mut Context<'_>, ) -> Poll> { match self.project() { - ResponseBodyProj::Body(body) => body.poll_next(cx), + ResponseBodyProj::Body(body) => body.poll_next(cx).map_err(Into::into), ResponseBodyProj::Other(body) => Pin::new(body).poll_next(cx), } } diff --git a/actix-http/src/h1/dispatcher.rs b/actix-http/src/h1/dispatcher.rs index e98cf5e92..7ab89ba87 100644 --- a/actix-http/src/h1/dispatcher.rs +++ b/actix-http/src/h1/dispatcher.rs @@ -53,7 +53,7 @@ where S::Error: Into, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -75,7 +75,7 @@ where S::Error: Into, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -94,7 +94,7 @@ where S::Error: Into, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -136,7 +136,7 @@ where X: Service, B: MessageBody, - B: MessageBody, + B::Error: Into, { None, ExpectCall(#[pin] X::Future), @@ -151,7 +151,7 @@ where X: Service, B: MessageBody, - B: MessageBody, + B::Error: Into, { fn is_empty(&self) -> bool { matches!(self, State::None) @@ -173,7 +173,7 @@ where S::Response: Into>, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -234,7 +234,7 @@ where S::Response: Into>, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -850,7 +850,7 @@ where S::Response: Into>, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, diff --git a/actix-http/src/h2/dispatcher.rs b/actix-http/src/h2/dispatcher.rs index b69035d36..fa26aa178 100644 --- a/actix-http/src/h2/dispatcher.rs +++ b/actix-http/src/h2/dispatcher.rs @@ -69,11 +69,14 @@ where impl Future for Dispatcher where T: AsyncRead + AsyncWrite + Unpin, + S: Service, S::Error: Into + 'static, S::Future: 'static, S::Response: Into> + 'static, - B: MessageBody + 'static, + + B: MessageBody + 'static, + B::Error: Into + 'static, { type Output = Result<(), DispatchError>; @@ -140,7 +143,9 @@ where F: Future>, E: Into, I: Into>, + B: MessageBody, + B::Error: Into, { fn prepare_response( &self, @@ -216,7 +221,9 @@ where F: Future>, E: Into, I: Into>, - B: MessageBody, + + B: MessageBody, + B::Error: Into, { type Output = (); diff --git a/actix-http/src/service.rs b/actix-http/src/service.rs index c5a54e46d..62af89adb 100644 --- a/actix-http/src/service.rs +++ b/actix-http/src/service.rs @@ -157,7 +157,7 @@ where >::Future: 'static, B: MessageBody + 'static, - B: MessageBody, + B::Error: Into, X: ServiceFactory, X::Future: 'static, @@ -209,7 +209,7 @@ mod openssl { >::Future: 'static, B: MessageBody + 'static, - B: MessageBody, + B::Error: Into, X: ServiceFactory, X::Future: 'static, @@ -277,7 +277,7 @@ mod rustls { >::Future: 'static, B: MessageBody + 'static, - B: MessageBody, + B::Error: Into, X: ServiceFactory, X::Future: 'static, @@ -342,7 +342,7 @@ where >::Future: 'static, B: MessageBody + 'static, - B: MessageBody, + B::Error: Into, X: ServiceFactory, X::Future: 'static, @@ -476,7 +476,7 @@ where S::Response: Into> + 'static, B: MessageBody + 'static, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -538,7 +538,7 @@ where S::Error: Into, B: MessageBody, - B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -569,8 +569,8 @@ where S::Future: 'static, S::Response: Into> + 'static, - B: MessageBody + 'static, - B: MessageBody, + B: MessageBody, + B::Error: Into, X: Service, X::Error: Into, @@ -591,8 +591,8 @@ where S::Future: 'static, S::Response: Into> + 'static, - B: MessageBody, - B: MessageBody, + B: MessageBody + 'static, + B::Error: Into, X: Service, X::Error: Into, diff --git a/actix-test/src/lib.rs b/actix-test/src/lib.rs index e0aec7eea..5d85c2687 100644 --- a/actix-test/src/lib.rs +++ b/actix-test/src/lib.rs @@ -85,7 +85,8 @@ where S::InitError: fmt::Debug, S::Response: Into> + 'static, >::Future: 'static, - B: MessageBody + 'static, + B: MessageBody + 'static, + B::Error: Into, { start_with(TestServerConfig::default(), factory) } @@ -124,7 +125,8 @@ where S::InitError: fmt::Debug, S::Response: Into> + 'static, >::Future: 'static, - B: MessageBody + 'static, + B: MessageBody + 'static, + B::Error: Into, { let (tx, rx) = mpsc::channel();