about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2021-12-10 13:08:06 +0530
committerManish Goregaokar <manishsmail@gmail.com>2021-12-10 13:08:06 +0530
commit0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5 (patch)
treeca2d39992d8a96eb58782ccd59c88eb392e61268
parent3cf9ae6ff30f2648b6233ede61ad0d1e75a30d14 (diff)
downloadrust-0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5.tar.gz
rust-0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5.zip
inline Option panics on panic_immediate_abort
-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) -> ! {