diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2021-12-10 13:08:06 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2021-12-10 13:08:06 +0530 |
| commit | 0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5 (patch) | |
| tree | ca2d39992d8a96eb58782ccd59c88eb392e61268 | |
| parent | 3cf9ae6ff30f2648b6233ede61ad0d1e75a30d14 (diff) | |
| download | rust-0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5.tar.gz rust-0adee2c01eb5ecb91df3b4ac1c045b18f8a4c2f5.zip | |
inline Option panics on panic_immediate_abort
| -rw-r--r-- | library/core/src/option.rs | 3 |
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) -> ! { |
