about summary refs log tree commit diff
diff options
context:
space:
mode:
authorljedrz <ljedrz@gmail.com>2019-03-07 12:52:38 +0100
committerljedrz <ljedrz@gmail.com>2019-03-07 12:52:38 +0100
commite780daf372886ac3e30e6d4580a0505da3471d02 (patch)
tree3cd52d632dd1de893492622325113000341cea6a
parent42fbcb567c30aa79b2f6d5167b8364fa18d4d51d (diff)
downloadrust-e780daf372886ac3e30e6d4580a0505da3471d02.tar.gz
rust-e780daf372886ac3e30e6d4580a0505da3471d02.zip
hir: remove Visitor::visit_def_mention
-rw-r--r--src/librustc/hir/intravisit.rs21
1 files changed, 1 insertions, 20 deletions
diff --git a/src/librustc/hir/intravisit.rs b/src/librustc/hir/intravisit.rs
index bcfd832855c..977830315e2 100644
--- a/src/librustc/hir/intravisit.rs
+++ b/src/librustc/hir/intravisit.rs
@@ -34,7 +34,6 @@
 use syntax::ast::{Ident, Name, Attribute};
 use syntax_pos::Span;
 use crate::hir::*;
-use crate::hir::def::Def;
 use crate::hir::map::Map;
 use super::itemlikevisit::DeepVisitor;
 
@@ -228,9 +227,6 @@ pub trait Visitor<'v> : Sized {
     fn visit_id(&mut self, _hir_id: HirId) {
         // Nothing to do.
     }
-    fn visit_def_mention(&mut self, _def: Def) {
-        // Nothing to do.
-    }
     fn visit_name(&mut self, _span: Span, _name: Name) {
         // Nothing to do.
     }
@@ -494,13 +490,10 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
             visitor.visit_ty(typ);
             visitor.visit_generics(type_parameters)
         }
-        ItemKind::Existential(ExistTy {ref generics, ref bounds, impl_trait_fn}) => {
+        ItemKind::Existential(ExistTy { ref generics, ref bounds, impl_trait_fn: _ }) => {
             visitor.visit_id(item.hir_id);
             walk_generics(visitor, generics);
             walk_list!(visitor, visit_param_bound, bounds);
-            if let Some(impl_trait_fn) = impl_trait_fn {
-                visitor.visit_def_mention(Def::Fn(impl_trait_fn))
-            }
         }
         ItemKind::Enum(ref enum_definition, ref type_parameters) => {
             visitor.visit_generics(type_parameters);
@@ -640,7 +633,6 @@ pub fn walk_qpath<'v, V: Visitor<'v>>(visitor: &mut V, qpath: &'v QPath, id: Hir
 }
 
 pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &'v Path) {
-    visitor.visit_def_mention(path.def);
     for segment in &path.segments {
         visitor.visit_path_segment(path.span, segment);
     }
@@ -698,7 +690,6 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
             visitor.visit_pat(subpattern)
         }
         PatKind::Binding(_, _hir_id, ident, ref optional_subpattern) => {
-            // visitor.visit_def_mention(Def::Local(hir_id));
             visitor.visit_ident(ident);
             walk_list!(visitor, visit_pat, optional_subpattern);
         }
@@ -1064,22 +1055,12 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
         ExprKind::Break(ref destination, ref opt_expr) => {
             if let Some(ref label) = destination.label {
                 visitor.visit_label(label);
-                /*
-                if let Ok(node_id) = destination.target_id {
-                    visitor.visit_def_mention(Def::Label(node_id))
-                }
-                */
             }
             walk_list!(visitor, visit_expr, opt_expr);
         }
         ExprKind::Continue(ref destination) => {
             if let Some(ref label) = destination.label {
                 visitor.visit_label(label);
-                /*
-                if let Ok(node_id) = destination.target_id {
-                    visitor.visit_def_mention(Def::Label(node_id))
-                }
-                */
             }
         }
         ExprKind::Ret(ref optional_expression) => {