Function core::intrinsics::abort [−][src]
pub extern "rust-intrinsic" fn abort() -> !🔬 This is a nightly-only experimental API. (core_intrinsics)
intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library
Expand description
中止进程的执行。
请注意,与大多数内部函数不同,这对调用是安全的;
它不需要 unsafe 块。
因此,实现不得要求用户维护任何安全不变量。
如果可能,std::process::abort 如果可能的话是首选的,因为它的行为更方便用户,也更稳定。
intrinsics::abort 的当前实现是在大多数平台上调用无效指令。
在 Unix 上,进程可能会以 SIGABRT、SIGILL、SIGTRAP、SIGSEGV 或 SIGBUS 之类的信号终止。
不能保证精确的行为并且不稳定。