Skip to main content

Module panicking

Module panicking 

Source
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 👻 ExperimentalNon-panic=immediate-abort

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).
catch_unwindNon-panic=immediate-abort
Invoke a closure, capturing the cause of an unwinding panic if one occurs.
default_hook 🔒
The default panic handler.
panic_handler
Entry point of panics from the core crate (panic_impl lang item).
panic_with_hook 🔒
Central point for dispatching panics.
panicking
Determines whether the current thread is unwinding because of panic.
payload_as_str 🔒
resume_unwind
This is the entry point for resume_unwind. It just forwards the payload to the panic runtime.
rust_panic 🔒 Non-panic=immediate-abort
A function with a fixed suffix (through rustc_std_internal_symbol) on which to slap yer breakpoints.
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.
begin_panicExperimental
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_hookExperimental
Atomic combination of take_hook and set_hook. Use this to replace the panic handler with a new panic handler that does something and then executes the old handler.