about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--library/core/src/option.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/core/src/option.rs b/library/core/src/option.rs
index 7b9c6e43960..aae3af81a52 100644
--- a/library/core/src/option.rs
+++ b/library/core/src/option.rs
@@ -1656,7 +1656,8 @@ impl<T, E> Option<Result<T, E>> {
 }
 
 // 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) -> ! {