mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Rollup merge of #136722 - kornelski:visit-spans, r=chenyukang
Visit all debug info in MIR Visitor I've been experimenting with simplifying debug info in MIR inliner, and discovered that MIR Visitor doesn't reliably visit all spans. This PR adds the missing visitor calls.
This commit is contained in:
commit
d64bd3bedd
@ -527,8 +527,9 @@ macro_rules! make_mir_visitor {
|
||||
target: _,
|
||||
unwind: _,
|
||||
call_source: _,
|
||||
fn_span: _
|
||||
fn_span,
|
||||
} => {
|
||||
self.visit_span($(& $mutability)? *fn_span);
|
||||
self.visit_operand(func, location);
|
||||
for arg in args {
|
||||
self.visit_operand(&$($mutability)? arg.node, location);
|
||||
@ -543,8 +544,9 @@ macro_rules! make_mir_visitor {
|
||||
TerminatorKind::TailCall {
|
||||
func,
|
||||
args,
|
||||
fn_span: _,
|
||||
fn_span,
|
||||
} => {
|
||||
self.visit_span($(& $mutability)? *fn_span);
|
||||
self.visit_operand(func, location);
|
||||
for arg in args {
|
||||
self.visit_operand(&$($mutability)? arg.node, location);
|
||||
@ -853,6 +855,8 @@ macro_rules! make_mir_visitor {
|
||||
local_info: _,
|
||||
} = local_decl;
|
||||
|
||||
self.visit_source_info(source_info);
|
||||
|
||||
self.visit_ty($(& $mutability)? *ty, TyContext::LocalDecl {
|
||||
local,
|
||||
source_info: *source_info,
|
||||
@ -862,7 +866,6 @@ macro_rules! make_mir_visitor {
|
||||
self.visit_user_type_projection(user_ty);
|
||||
}
|
||||
}
|
||||
self.visit_source_info(source_info);
|
||||
}
|
||||
|
||||
fn super_var_debug_info(
|
||||
|
@ -1257,6 +1257,8 @@ impl<'tcx> MutVisitor<'tcx> for Integrator<'_, 'tcx> {
|
||||
// replaced down below anyways).
|
||||
if !matches!(terminator.kind, TerminatorKind::Return) {
|
||||
self.super_terminator(terminator, loc);
|
||||
} else {
|
||||
self.visit_source_info(&mut terminator.source_info);
|
||||
}
|
||||
|
||||
match terminator.kind {
|
||||
|
Loading…
Reference in New Issue
Block a user