Join GitHub today
[WIP] Add panic implementation docs #521
This PR adds a descirption of the implementation of panicking in Rust, starting from the
This is not fully complete - for one thing, it might be useful to have a description of how this works under Miri.
I developed this while working on the implementation of panics in Miri. Having this document available would have made things a lot easier for me
Thanks, this looks useful! I too am trying to better understand the panic machinery.
I was wondering if you could define more what a "landing pad" is? I assume it is some reserved section of the stack frame, that does…something related to unwinding? It sounds like it has a list of destructors to run, is that all it does?
It might also be helpful to mention that there are two different panic strategies (encoded per crate), which are only loosely coupled with the panic runtimes. For example, the abort runtime can use crates built with unwind strategy, but not the other way around. The abort strategy disables landing pads, but I'd like to know what else changing the strategy does (or maybe landing pads are the only difference?).
mark-i-m left a comment
@Aaron1011 Thanks! This is very helpful info, and I have wondered about it before many times.
My biggest request is to please add links for all of the names you reference (the first time you reference them) to the source code (since there don't appear to be rustdocs for most of these definitions). This helps us check for breakage by just doing linkchecking.