ResponseError requires Debug + Display, but it seems unnecessary
Author: axos88Created Dec 31, 2025Updated Sep 25, 2026
LabelsA-web
Currently ResponseError is defined as:
// TODO: flesh out documentation
pub trait ResponseError: fmt::Debug + fmt::Display {However I see no real reason why it requires Display, or even Debug.
The default implementation indeed requires Display:
let _ = write!(helpers::MutWriter(&mut buf), "{}", self);However this means that we cannot implement ResponseError for any types that don't implement Display and Debug, which is cumbersome, because sometimes I just want to return a static string without relying on whether the type implements Debug or Display, and even if it does, I don't really intend to use it.
Not sure what the correct way would be to leave the default implementation as is, but also allow non-display, non-debug types to implement it.
Source: actix/actix-web