]> git.lizzy.rs Git - rust.git/commitdiff
save-analysis: only index path references once
authorNick Cameron <ncameron@mozilla.com>
Wed, 8 Mar 2017 03:30:31 +0000 (16:30 +1300)
committerNick Cameron <ncameron@mozilla.com>
Tue, 4 Apr 2017 03:56:46 +0000 (15:56 +1200)
src/librustc_save_analysis/dump_visitor.rs

index 7a7fa4eda05a6fd9da7b21fd1c4ea167d6cc69b6..491618f7952d8af3f5f6105d55ccfbc621da876f 100644 (file)
@@ -1401,15 +1401,6 @@ 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) => {
-                // Don't need to do anything for function calls,
-                // because just walking the callee path does what we want.
-                visit::walk_expr(self, ex);
-            }
-            ast::ExprKind::Path(_, ref path) => {
-                self.process_path(ex.id, path, None);
-                visit::walk_expr(self, ex);
-            }
             ast::ExprKind::Struct(ref path, ref fields, ref base) => {
                 let hir_expr = self.save_ctxt.tcx.hir.expect_expr(ex.id);
                 let adt = match self.save_ctxt.tables.expr_ty_opt(&hir_expr) {
@@ -1507,6 +1498,8 @@ fn visit_expr(&mut self, ex: &'l ast::Expr) {
                 self.visit_expr(element);
                 self.nest_tables(count.id, |v| v.visit_expr(count));
             }
+            // In particular, we take this branch for call and path expressions,
+            // where we'll index the idents involved just by continuing to walk.
             _ => {
                 visit::walk_expr(self, ex)
             }