From 3a0554a44578afb2f69babdae39f8880d23560ae Mon Sep 17 00:00:00 2001 From: klensy Date: Mon, 13 Jan 2025 21:00:57 +0300 Subject: [PATCH] further improve panic_immediate_abort by removing rtprintpanic messages --- library/std/src/rt.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/std/src/rt.rs b/library/std/src/rt.rs index b2492238bd37b..b08ce4ed08919 100644 --- a/library/std/src/rt.rs +++ b/library/std/src/rt.rs @@ -32,9 +32,14 @@ use crate::{mem, panic, sys}; // - nothing (so this macro is a no-op) macro_rules! rtprintpanic { ($($t:tt)*) => { + #[cfg(not(feature = "panic_immediate_abort"))] if let Some(mut out) = crate::sys::stdio::panic_output() { let _ = crate::io::Write::write_fmt(&mut out, format_args!($($t)*)); } + #[cfg(feature = "panic_immediate_abort")] + { + let _ = format_args!($($t)*); + } } }