Tweak some attributes to improve panic_immediate_abort

This commit is contained in:
Ben Kimock
2024-08-25 14:52:53 -04:00
parent 1a94d839be
commit b1c2c78d29
3 changed files with 5 additions and 3 deletions

View File

@@ -3667,8 +3667,8 @@ impl<T> [T] {
{
// The panic code path was put into a cold function to not bloat the
// call site.
#[inline(never)]
#[cold]
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
#[cfg_attr(feature = "panic_immediate_abort", inline)]
#[track_caller]
fn len_mismatch_fail(dst_len: usize, src_len: usize) -> ! {
panic!(