Module panic

Source
Expand description

Registers a custom panic! handler that alerts the user of unrecoverable errors.

The source of this module may read a little weird, but this is in fact an intentional workaround of how the linters function. When running cargo clippy it will run all targets, including test.

To get around this, when compiling under test we generate an empty function (hinted as inline to further optimise), and for other targets we generate the full method. The use statements are inlined in the method to prevent unused import warnings under test target.

Functionsยง

register_panic_handler
Registers a new panic! handler that alerts the user of unrecoverable errors.