custom_error
custom_error copied to clipboard
accept non-displayable parameters
I am not sure whether this is possible to do with the current implementation, but it would be nice to implement Display for error types even when they contain parameters that are not displayable (as long as they are not used in error messages).
This should work:
struct NonDisplayable;
custom_error!(E X{a:NonDisplayable} = "error");
E::X { a: NonDisplayable }.to_string()