Skip to content

Commit e780daf

Browse files
committed
hir: remove Visitor::visit_def_mention
1 parent 42fbcb5 commit e780daf

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

src/librustc/hir/intravisit.rs

+1-20
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
use syntax::ast::{Ident, Name, Attribute};
3535
use syntax_pos::Span;
3636
use crate::hir::*;
37-
use crate::hir::def::Def;
3837
use crate::hir::map::Map;
3938
use super::itemlikevisit::DeepVisitor;
4039

@@ -228,9 +227,6 @@ pub trait Visitor<'v> : Sized {
228227
fn visit_id(&mut self, _hir_id: HirId) {
229228
// Nothing to do.
230229
}
231-
fn visit_def_mention(&mut self, _def: Def) {
232-
// Nothing to do.
233-
}
234230
fn visit_name(&mut self, _span: Span, _name: Name) {
235231
// Nothing to do.
236232
}
@@ -494,13 +490,10 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item) {
494490
visitor.visit_ty(typ);
495491
visitor.visit_generics(type_parameters)
496492
}
497-
ItemKind::Existential(ExistTy {ref generics, ref bounds, impl_trait_fn}) => {
493+
ItemKind::Existential(ExistTy { ref generics, ref bounds, impl_trait_fn: _ }) => {
498494
visitor.visit_id(item.hir_id);
499495
walk_generics(visitor, generics);
500496
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-
}
504497
}
505498
ItemKind::Enum(ref enum_definition, ref type_parameters) => {
506499
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
640633
}
641634

642635
pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &'v Path) {
643-
visitor.visit_def_mention(path.def);
644636
for segment in &path.segments {
645637
visitor.visit_path_segment(path.span, segment);
646638
}
@@ -698,7 +690,6 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
698690
visitor.visit_pat(subpattern)
699691
}
700692
PatKind::Binding(_, _hir_id, ident, ref optional_subpattern) => {
701-
// visitor.visit_def_mention(Def::Local(hir_id));
702693
visitor.visit_ident(ident);
703694
walk_list!(visitor, visit_pat, optional_subpattern);
704695
}
@@ -1064,22 +1055,12 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
10641055
ExprKind::Break(ref destination, ref opt_expr) => {
10651056
if let Some(ref label) = destination.label {
10661057
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-
*/
10721058
}
10731059
walk_list!(visitor, visit_expr, opt_expr);
10741060
}
10751061
ExprKind::Continue(ref destination) => {
10761062
if let Some(ref label) = destination.label {
10771063
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-
*/
10831064
}
10841065
}
10851066
ExprKind::Ret(ref optional_expression) => {

0 commit comments

Comments
 (0)