Comment by aw1621107

7 hours ago

iex [0] might be potentially relevant here. From what I understand it basically implements this bit:

> Finally, another option is to say that -> Result<T, E> behaves exactly as -> T ABI-wise, no error affordances whatsoever. Instead, when returning an error, rather than jumping to the return address, we look it up in the side table to find a corresponding error recovery address, and jump to that. Stack unwinding!

And at least based on the listed benchmarks it can indeed result in better performance than "regular" Result<T, E>.

(Might be nice to mention this on the corresponding lobste.rs thread as well to see if anyone has anything interesting to add, if anyone has access)

[0]: https://github.com/iex-rs/iex