From 0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Fri, 10 Dec 2021 13:08:06 +0530 Subject: [PATCH] inline Option panics on panic_immediate_abort --- library/core/src/option.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/core/src/option.rs b/library/core/src/option.rs index 7b9c6e43960f7..aae3af81a5204 100644 --- a/library/core/src/option.rs +++ b/library/core/src/option.rs @@ -1656,7 +1656,8 @@ impl Option> { } // This is a separate function to reduce the code size of .expect() itself. -#[inline(never)] +#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] +#[cfg_attr(feature = "panic_immediate_abort", inline)] #[cold] #[track_caller] const fn expect_failed(msg: &str) -> ! {