]> git.lizzy.rs Git - rust.git/commitdiff
Re-add track_caller to panic_no_unwind in bootstrap
authorMark Rousskov <mark.simulacrum@gmail.com>
Wed, 23 Feb 2022 13:24:20 +0000 (08:24 -0500)
committerMark Rousskov <mark.simulacrum@gmail.com>
Fri, 25 Feb 2022 13:00:53 +0000 (08:00 -0500)
This function was updated in a recent PR (92911) to be called without the caller
information passed in, but the function signature itself was not altered with
cfg_attr at the time.

library/core/src/panicking.rs

index 91458a4ca2a030346c44b8b93207f34a91dc7046..89cebaa653f4ba9ebee10cba5958555c1ec7f9ab 100644 (file)
@@ -84,8 +84,11 @@ fn panic_bounds_check(index: usize, len: usize) -> ! {
     panic!("index out of bounds: the len is {} but the index is {}", len, index)
 }
 
+// This function is called directly by the codegen backend, and must not have
+// any extra arguments (including those synthesized by track_caller).
 #[cold]
 #[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") {