-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
regression on span for panics due to track-caller in cross-crate macros #70963
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-track_caller`#![feature(track_caller)]``#![feature(track_caller)]`P-mediumMedium priorityMedium priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
This example has regressed (including on stable by now): (playground)
The location reported is now
<::core::macros::panic macros>:3:10(or on nightly,src/libcore/macros/mod.rs:34:9).(the choice of
VecDeque::with_capacityis arbitrary, it just happens to have anassert!inside, and it will be codegen'd in the user crate because it's generic)In general, we don't track enough information to recover the invocation site, when we have to codegen the MIR cross-crate.
A cheap hack we could do is replace the macro span with the invocation one, when serializing
Spans inside MIR (orSpans in general?).Originally posted by @eddyb in #47809 (comment)