Skip to content

Commit

Permalink
Re-add track_caller to panic_no_unwind in bootstrap
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Mark-Simulacrum committed Feb 25, 2022
1 parent 76b13c9 commit 3c62f2f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/core/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down

0 comments on commit 3c62f2f

Please sign in to comment.