pub enum PanicKind {
Overflow,
DivideByZero,
IndexOutOfBounds,
DecodeError,
TypeError,
DerivationError,
CapiMisuse,
Internal,
}Expand description
The classification of a runtime failure.
This is the panic effect made concrete (design §3.3): anything that
can go wrong at runtime is one of these kinds, and hosts receive it
through the C ABI as a structured error, never as an unwind.
Variants§
Overflow
Integer overflow in an arithmetic primitive.
DivideByZero
Zero divisor in integer / or %.
IndexOutOfBounds
An index outside a collection’s bounds (design §3.3: indexing is
a panic source).
DecodeError
Input JSON rejected by type-directed decode.
TypeError
A value of the wrong shape reached an operation (defensive; the checker prevents this in checked code).
DerivationError
A derived operation (eq/compare/hash/show) was invoked on
a type marked non-derivable, or reached a closure.
CapiMisuse
The C ABI was used against its documented contract (undefined
TypeId, wrong arity, use after teardown).
Internal
A bug in the runtime itself, caught at the C ABI boundary.