Macros
Macros declared in the builtin library.
crash!
macro crash!(...msg)
Ends the process with an optional message: crash!() or crash!("why").
Not a panic: it joins no panic set and no try catches it, so a function that calls it needs
no panic specifier and main may use it. The message and a newline go to stderr (nothing
when empty), then the process aborts. It expands to crash_with(msg...), so the call never
returns and ends its path for the flow checks. What it reports is not final; rely only on "it
does not return". A file's own crash! shadows this one.
Example
fn main() -> i32 {
if false { crash!("unreachable state") }
return 0
}
See also
crash_with
Generated from Kairo source, Apache-2.0 WITH AdditionRef-Kairo-Runtime-exception.