use the usual attributes for panic_misaligned_pointer_dereference

This commit is contained in:
Ralf Jung 2023-11-27 11:10:32 +01:00
parent 2a48a7750a
commit 8de5bd0f6e

View file

@ -208,8 +208,8 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
panic!("index out of bounds: the len is {len} but the index is {index}") panic!("index out of bounds: the len is {len} but the index is {index}")
} }
#[cold] #[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))] #[cfg_attr(feature = "panic_immediate_abort", inline)]
#[track_caller] #[track_caller]
#[lang = "panic_misaligned_pointer_dereference"] // needed by codegen for panic on misaligned pointer deref #[lang = "panic_misaligned_pointer_dereference"] // needed by codegen for panic on misaligned pointer deref
#[rustc_nounwind] // `CheckAlignment` MIR pass requires this function to never unwind #[rustc_nounwind] // `CheckAlignment` MIR pass requires this function to never unwind