Skip to main content

init_panic_hook

Function init_panic_hook 

Source
pub fn init_panic_hook()
Expand description

Installs a panic hook that prints a readable message to the console.

Without this, a Rust panic in a release build surfaces to JS as “unreachable”, which tells a user nothing. With panic = "abort" and release optimization this is the only diagnostic that exists, so it is called unconditionally at init rather than left to the consumer.