Description
I would like to see intrinsics::abort
stabilized in some form as it's useful in some cases to have
panicking behavior (and alloc_error) = abort (minimizes code size and the abort exception / signal
can be handled elsewhere or in a upper abstraction layer).
As intrinsics::abort
lowers to a trap instruction on most architectures (*) I propose we add a
safe wrapper around it in core::arch::$ARCH
for the architectures where it does.
(*) On most but not on all. For example, On MSP430 it lowers to a call to the abort
function
which results in a linker error unless that symbol is defined somewhere in the dependency graph.
(Related: There's std::process::abort
which claims to be a safe wrapper around intrinsics::abort
but if you at its implementation it is, in fact, not just a wrapper around intrinsics::abort
but
something completely different.)
@rust-lang/libs what would be needed to move this forward? An full RFC, or just a PR + FCP?