1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#[inline(never)] #[cold] pub(super) fn abort() -> ! { #[cfg(feature = "std")] { std::process::abort() } #[cfg(not(feature = "std"))] { struct Abort; impl Drop for Abort { fn drop(&mut self) { panic!(); } } let _a = Abort; panic!("abort"); } }