Function branches::abort

source ·
pub extern "C" fn abort() -> !
Expand description

Aborts the execution of the process immediately and without any cleanup.

This function is used to indicate a critical and unrecoverable error in the program. It terminates the process immediately without performing any cleanup or running destructors.

This function is safe to call, so it does not require an unsafe block. Therefore, implementations must not require the user to uphold any safety invariants.

If the std feature is enabled, this function calls std::process::abort() which is a more user-friendly and stable way of aborting the process.

If the std feature is disabled, this function panics by calling panic!(). In this case, by using extern "C" this function is guaranteed to not unwind.