Pre-Pre-RFC: Error Set types and Error Return Traces

I believe both of these ideas have been discussed before under different names.

Error union types sound pretty much identical in motivation, mechanics, pros and cons to the “enum impl Trait” idea. Sadly I haven’t seen it get seriously discussed in years, but Allowing multiple disparate return types in impl Trait using unions is one example of a thread where it came up.

As for error return traces, a long-standing goal of std::error::Error reform has been to add a backtrace() method to provide exactly this:

3 Likes