|
34 | 34 | use syntax::ast::{Ident, Name, Attribute}; |
35 | 35 | use syntax_pos::Span; |
36 | 36 | use crate::hir::*; |
37 | | -use crate::hir::def::Def; |
38 | 37 | use crate::hir::map::Map; |
39 | 38 | use super::itemlikevisit::DeepVisitor; |
40 | 39 |
|
@@ -228,9 +227,6 @@ pub trait Visitor<'v> : Sized { |
228 | 227 | fn visit_id(&mut self, _hir_id: HirId) { |
229 | 228 | // Nothing to do. |
230 | 229 | } |
231 | | - fn visit_def_mention(&mut self, _def: Def) { |
232 | | - // Nothing to do. |
233 | | - } |
234 | 230 | fn visit_name(&mut self, _span: Span, _name: Name) { |
235 | 231 | // Nothing to do. |
236 | 232 | } |
@@ -494,13 +490,10 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) { |
494 | 490 | visitor.visit_ty(typ); |
495 | 491 | visitor.visit_generics(type_parameters) |
496 | 492 | } |
497 | | - ItemKind::Existential(ExistTy {ref generics, ref bounds, impl_trait_fn}) => { |
| 493 | + ItemKind::Existential(ExistTy { ref generics, ref bounds, impl_trait_fn: _ }) => { |
498 | 494 | visitor.visit_id(item.hir_id); |
499 | 495 | walk_generics(visitor, generics); |
500 | 496 | walk_list!(visitor, visit_param_bound, bounds); |
501 | | - if let Some(impl_trait_fn) = impl_trait_fn { |
502 | | - visitor.visit_def_mention(Def::Fn(impl_trait_fn)) |
503 | | - } |
504 | 497 | } |
505 | 498 | ItemKind::Enum(ref enum_definition, ref type_parameters) => { |
506 | 499 | 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 |
640 | 633 | } |
641 | 634 |
|
642 | 635 | pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &'v Path) { |
643 | | - visitor.visit_def_mention(path.def); |
644 | 636 | for segment in &path.segments { |
645 | 637 | visitor.visit_path_segment(path.span, segment); |
646 | 638 | } |
@@ -698,7 +690,6 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) { |
698 | 690 | visitor.visit_pat(subpattern) |
699 | 691 | } |
700 | 692 | PatKind::Binding(_, _hir_id, ident, ref optional_subpattern) => { |
701 | | - // visitor.visit_def_mention(Def::Local(hir_id)); |
702 | 693 | visitor.visit_ident(ident); |
703 | 694 | walk_list!(visitor, visit_pat, optional_subpattern); |
704 | 695 | } |
@@ -1064,22 +1055,12 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) { |
1064 | 1055 | ExprKind::Break(ref destination, ref opt_expr) => { |
1065 | 1056 | if let Some(ref label) = destination.label { |
1066 | 1057 | visitor.visit_label(label); |
1067 | | - /* |
1068 | | - if let Ok(node_id) = destination.target_id { |
1069 | | - visitor.visit_def_mention(Def::Label(node_id)) |
1070 | | - } |
1071 | | - */ |
1072 | 1058 | } |
1073 | 1059 | walk_list!(visitor, visit_expr, opt_expr); |
1074 | 1060 | } |
1075 | 1061 | ExprKind::Continue(ref destination) => { |
1076 | 1062 | if let Some(ref label) = destination.label { |
1077 | 1063 | visitor.visit_label(label); |
1078 | | - /* |
1079 | | - if let Ok(node_id) = destination.target_id { |
1080 | | - visitor.visit_def_mention(Def::Label(node_id)) |
1081 | | - } |
1082 | | - */ |
1083 | 1064 | } |
1084 | 1065 | } |
1085 | 1066 | ExprKind::Ret(ref optional_expression) => { |
|
0 commit comments