Specialize Termination
for Result<!, Box<dyn Error>>
to report errors via the error trait #40
Description
Currently all errors reported via the Termination
impl on core::result::Result
go through Debug
instead of Error
, which tends to be the wrong choice for errors. We have plans for fixing this via specialization but these plans are blocked on workarounds for a soundness issue and wouldn't even apply to Box<dyn Error>
because it doesn't even implement the Error
trait. We cannot fix this as far as we can tell, but it turns out we probably don't need to for this specific case! Specialization already works for concrete types, so we could specialize the Termination
impl specifically for Box<dyn Error>
today, there's nothing blocking this. That way we can confidently point people towards fn main() -> Result<(), Box<dyn Error>>
knowing that it will output the right thing.