Skip to content

Commit 0adee2c

Browse files
committed
inline Option panics on panic_immediate_abort
1 parent 3cf9ae6 commit 0adee2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/core/src/option.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1656,7 +1656,8 @@ impl<T, E> Option<Result<T, E>> {
16561656
}
16571657

16581658
// This is a separate function to reduce the code size of .expect() itself.
1659-
#[inline(never)]
1659+
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
1660+
#[cfg_attr(feature = "panic_immediate_abort", inline)]
16601661
#[cold]
16611662
#[track_caller]
16621663
const fn expect_failed(msg: &str) -> ! {

0 commit comments

Comments
 (0)