Skip to content

Commit 1283c02

Browse files
committed
Auto merge of #39286 - nrc:save-path, r=eddyb
save-analysis: polishing paths a couple of minor changes that get us better coverage of different paths. r? @eddyb
2 parents 185d908 + 5e33c5f commit 1283c02

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/librustc_save_analysis/dump_visitor.rs

+7
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
13591359
}
13601360

13611361
self.write_sub_paths_truncated(path);
1362+
visit::walk_path(self, path);
13621363
}
13631364
ast::TyKind::Array(ref element, ref length) => {
13641365
self.visit_ty(element);
@@ -1369,6 +1370,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
13691370
}
13701371

13711372
fn visit_expr(&mut self, ex: &'l ast::Expr) {
1373+
debug!("visit_expr {:?}", ex.node);
13721374
self.process_macro_use(ex.span, ex.id);
13731375
match ex.node {
13741376
ast::ExprKind::Call(ref _f, ref _args) => {
@@ -1462,6 +1464,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
14621464
ast::ExprKind::WhileLet(ref pattern, ref subexpression, ref block, _) => {
14631465
let value = self.span.snippet(subexpression.span);
14641466
self.process_var_decl(pattern, value);
1467+
debug!("for loop, walk sub-expr: {:?}", subexpression.node);
14651468
visit::walk_expr(self, subexpression);
14661469
visit::walk_block(self, block);
14671470
}
@@ -1556,6 +1559,10 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
15561559
self.visit_expr(&arm.body);
15571560
}
15581561

1562+
fn visit_path(&mut self, p: &'l ast::Path, id: NodeId) {
1563+
self.process_path(id, p, None);
1564+
}
1565+
15591566
fn visit_stmt(&mut self, s: &'l ast::Stmt) {
15601567
self.process_macro_use(s.span, s.id);
15611568
visit::walk_stmt(self, s)

0 commit comments

Comments
 (0)