failure
failure copied to clipboard
Using `Error` as a cause loses backtrace.
The AsFail implementation for Error only looks for a backtrace on the underlying Fail, and skips backtraces attached directly to the Error. This means that Errors constructed from implementors of the std::error::Error trait lose their backtraces when they are used as a cause.
Confusion around this resulted in rust-lang/crater#455. Ideally, Error would implement Fail, but this is impossible due to coherence issues (#99). Absent that, it would be nice if there was a way to abstract over both Error and Context without throwing away the Backtrace.