RustRuntime.lean
Rust Runtime Panic Hooks
Models Rust panic = abort entry points by wrapping a Program hook table (Rust.) so calls to core::panicking::*, unwrap/expect failure paths, slice bounds checks, and allocation error handlers transition s. to .Panicked.
@[expose] public sectionnamespace Arm64.Rustdef isPanicSymbol
Demangled names of functions that start a panic. Everything in core::panicking panics; the others are the out-of-line panic paths of unwrap/expect, slice indexing, and allocation failure.
def isPanicSymbol (name : String) : Bool :=
name.startsWith "core::panicking::" ||
[ "core::result::unwrap_failed",
"core::option::unwrap_failed",
"core::option::expect_failed",
"core::slice::index::slice_start_index_len_fail",
"core::slice::index::slice_end_index_len_fail",
"core::slice::index::slice_index_order_fail",
"core::slice::index::slice_index_fail",
"alloc::raw_vec::handle_error",
"alloc::raw_vec::capacity_overflow",
"alloc::alloc::handle_alloc_error" ].contains namedef panicked
The effect of entering a panic.
1 declaration not shown (lines 46–49): theorems, which Lean checks, or definitions that no headline statement uses
Arm64.
end Arm64.Rust