Skip to content

Commit

Permalink
inline Option panics on panic_immediate_abort
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Dec 10, 2021
1 parent 3cf9ae6 commit 0adee2c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/option.rs
Expand Up @@ -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) -> ! {
Expand Down

0 comments on commit 0adee2c

Please sign in to comment.