panic_display(&expr);
}
-#[cfg(not(bootstrap))]
#[inline]
#[track_caller]
#[rustc_diagnostic_item = "unreachable_display"] // needed for `non-fmt-panics` lint
panic!("index out of bounds: the len is {} but the index is {}", len, index)
}
-#[cfg(not(bootstrap))]
+// This function is called directly by the codegen backend, and must not have
+// any extra arguments (including those synthesized by track_caller).
#[cold]
-#[cfg_attr(not(feature = "panic_immediate_abort"), inline(never))]
-#[track_caller]
+#[inline(never)]
+#[cfg_attr(bootstrap, track_caller)]
#[lang = "panic_no_unwind"] // needed by codegen for panic in nounwind function
fn panic_no_unwind() -> ! {
if cfg!(feature = "panic_immediate_abort") {