Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8de5bd0

Browse files
committedNov 27, 2023
use the usual attributes for panic_misaligned_pointer_dereference
1 parent 2a48a77 commit 8de5bd0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎library/core/src/panicking.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
208208
panic!("index out of bounds: the len is {len} but the index is {index}")
209209
}
210210

211-
#[cold]
212-
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
211+
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
212+
#[cfg_attr(feature = "panic_immediate_abort", inline)]
213213
#[track_caller]
214214
#[lang = "panic_misaligned_pointer_dereference"] // needed by codegen for panic on misaligned pointer deref
215215
#[rustc_nounwind] // `CheckAlignment` MIR pass requires this function to never unwind

0 commit comments

Comments
 (0)
This repository has been archived.