-
Notifications
You must be signed in to change notification settings - Fork 13.7k
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.
Description
This example has regressed (including on stable by now): (playground)
fn main() {
std::collections::VecDeque::<String>::with_capacity(!0);
}
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_capacity
is arbitrary, it just happens to have an assert!
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 Span
s inside MIR (or Span
s in general?).
Originally posted by @eddyb in #47809 (comment)
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.