Expand description
Implementation of various bits and pieces of the panic!
macro and
associated runtime pieces.
Specifically, this module contains the implementation of:
- Panic hooks
- Executing a panic up to doing the actual implementation
- Shims around “try”
Modules§
- panic_
count 👻Experimental
Enums§
- Hook 🔒
Statics§
- HOOK 🔒
- EMPTY_
PANIC 👻Experimental
Functions§
- __
rust_ 🔒drop_ panic - This function is called by the panic runtime if FFI code catches a Rust panic but doesn’t rethrow it. We don’t support this case since it messes with our panic count.
- __
rust_ 🔒foreign_ exception - This function is called by the panic runtime if it catches an exception object which does not correspond to a Rust panic.
- __
rust_ 🔒 ⚠panic_ cleanup - __
rust_ 🔒 ⚠start_ panic PanicPayload
lazily performs allocation only when needed (this avoids allocations when using the “abort” panic runtime).- begin_
panic_ handler - Entry point of panics from the core crate (
panic_impl
lang item). - default_
hook 🔒 - The default panic handler.
- panicking
- Determines whether the current thread is unwinding because of panic.
- payload_
as_ 🔒str - rust_
panic 🔒 - An unmangled function (through
rustc_std_internal_symbol
) on which to slap yer breakpoints. - rust_
panic_ 🔒with_ hook - Central point for dispatching panics.
- rust_
panic_ without_ hook - This is the entry point for
resume_unwind
. It just forwards the payload to the panic runtime. - set_
hook - Registers a custom panic hook, replacing the previously registered hook.
- take_
hook - Unregisters the current panic hook and returns it, registering the default hook in its place.
- try⚠
- Invoke a closure, capturing the cause of an unwinding panic if one occurs.
- begin_
panic Experimental - This is the entry point of panicking for the non-format-string variants of panic!() and assert!(). In particular, this is the only entry point that supports arbitrary payloads, not just format strings.
- update_
hook Experimental - Atomic combination of
take_hook
andset_hook
. Use this to replace the panic handler with a new panic handler that does something and then executes the old handler.