Rollup merge of #109307 - cjgillot:inline-location, r=compiler-errors
Ignore `Inlined` spans when computing caller location. Fixes https://github.com/rust-lang/rust/issues/105538
This commit is contained in:
@@ -111,7 +111,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
||||
location
|
||||
}
|
||||
|
||||
pub(crate) fn location_triple_for_span(&self, span: Span) -> (Symbol, u32, u32) {
|
||||
pub(crate) fn location_triple_for_span(&self, mut span: Span) -> (Symbol, u32, u32) {
|
||||
// Remove `Inlined` marks as they pollute `expansion_cause`.
|
||||
while span.is_inlined() {
|
||||
span.remove_mark();
|
||||
}
|
||||
let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span);
|
||||
let caller = self.tcx.sess.source_map().lookup_char_pos(topmost.lo());
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user