Add an option to avoid merging of calls to panic!() #63105
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
Given code like:
Rust generates
The two calls to wrap are unified and it's not possible to tell which one failed at runtime.
I requested a way to tell LLVM not to do this in https://bugs.llvm.org/show_bug.cgi?id=42783 and Reid pointed me at https://cs.chromium.org/chromium/src/base/immediate_crash.h?l=10&rcl=92d78c90964200453b80fe098b367e0838681d09 which is Chrome's attempt to achieve this.
It turns out that this approach is pretty easily adapted to Rust. Here's a quick rework of the code above showing it off:
which generates:
The text was updated successfully, but these errors were encountered: