Skip to content

Commit

Permalink
Auto merge of rust-lang#39286 - nrc:save-path, r=eddyb
Browse files Browse the repository at this point in the history
save-analysis: polishing paths

a couple of minor changes that get us better coverage of different paths.

r? @eddyb
  • Loading branch information
bors committed Jan 25, 2017
2 parents 185d908 + 5e33c5f commit 1283c02
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/librustc_save_analysis/dump_visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1359,6 +1359,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
}

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

fn visit_expr(&mut self, ex: &'l ast::Expr) {
debug!("visit_expr {:?}", ex.node);
self.process_macro_use(ex.span, ex.id);
match ex.node {
ast::ExprKind::Call(ref _f, ref _args) => {
Expand Down Expand Up @@ -1462,6 +1464,7 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
ast::ExprKind::WhileLet(ref pattern, ref subexpression, ref block, _) => {
let value = self.span.snippet(subexpression.span);
self.process_var_decl(pattern, value);
debug!("for loop, walk sub-expr: {:?}", subexpression.node);
visit::walk_expr(self, subexpression);
visit::walk_block(self, block);
}
Expand Down Expand Up @@ -1556,6 +1559,10 @@ impl<'l, 'tcx: 'l, 'll, D: Dump +'ll> Visitor<'l> for DumpVisitor<'l, 'tcx, 'll,
self.visit_expr(&arm.body);
}

fn visit_path(&mut self, p: &'l ast::Path, id: NodeId) {
self.process_path(id, p, None);
}

fn visit_stmt(&mut self, s: &'l ast::Stmt) {
self.process_macro_use(s.span, s.id);
visit::walk_stmt(self, s)
Expand Down

0 comments on commit 1283c02

Please sign in to comment.