about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2023-11-27 11:10:32 +0100
committerRalf Jung <post@ralfj.de>2023-11-27 11:10:32 +0100
commit8de5bd0f6eb389c55d5e96a18ef21c5d025fce9f (patch)
treebba9f8166bb6ca37f75ddf446279c1b76e456cba
parent2a48a7750a2070b4e7fbf1aad6f04c250901ffc2 (diff)
downloadrust-8de5bd0f6eb389c55d5e96a18ef21c5d025fce9f.tar.gz
rust-8de5bd0f6eb389c55d5e96a18ef21c5d025fce9f.zip
use the usual attributes for panic_misaligned_pointer_dereference
-rw-r--r--library/core/src/panicking.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/core/src/panicking.rs b/library/core/src/panicking.rs
index be8f092b1bc..1b6e77b96b1 100644
--- a/library/core/src/panicking.rs
+++ b/library/core/src/panicking.rs
@@ -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}")
 }
 
-#[cold]
-#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
+#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never), cold)]
+#[cfg_attr(feature = "panic_immediate_abort", inline)]
 #[track_caller]
 #[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