diff --git a/actix-http/src/error.rs b/actix-http/src/error.rs index c914f4321..9a83d168a 100644 --- a/actix-http/src/error.rs +++ b/actix-http/src/error.rs @@ -166,6 +166,14 @@ impl ResponseError for TimeoutError { } } +/// Return `INTERNAL_SERVER_ERROR` for `std::convert::Infallible` +impl ResponseError for std::convert::Infallible { + fn error_response(&self) -> Response { + // `std::convert::Infallible` should never happen + unreachable!() + } +} + #[derive(Debug, Display)] #[display(fmt = "UnknownError")] struct UnitError;