@@ -298,7 +298,7 @@ pub trait Visitor<'v>: Sized {
298298 fn visit_id ( & mut self , _hir_id : HirId ) {
299299 // Nothing to do.
300300 }
301- fn visit_name ( & mut self , _span : Span , _name : Symbol ) {
301+ fn visit_name ( & mut self , _name : Symbol ) {
302302 // Nothing to do.
303303 }
304304 fn visit_ident ( & mut self , ident : Ident ) {
@@ -361,8 +361,8 @@ pub trait Visitor<'v>: Sized {
361361 fn visit_fn_decl ( & mut self , fd : & ' v FnDecl < ' v > ) {
362362 walk_fn_decl ( self , fd)
363363 }
364- fn visit_fn ( & mut self , fk : FnKind < ' v > , fd : & ' v FnDecl < ' v > , b : BodyId , s : Span , id : HirId ) {
365- walk_fn ( self , fk, fd, b, s , id)
364+ fn visit_fn ( & mut self , fk : FnKind < ' v > , fd : & ' v FnDecl < ' v > , b : BodyId , _ : Span , id : HirId ) {
365+ walk_fn ( self , fk, fd, b, id)
366366 }
367367 fn visit_use ( & mut self , path : & ' v Path < ' v > , hir_id : HirId ) {
368368 walk_use ( self , path, hir_id)
@@ -388,8 +388,8 @@ pub trait Visitor<'v>: Sized {
388388 fn visit_param_bound ( & mut self , bounds : & ' v GenericBound < ' v > ) {
389389 walk_param_bound ( self , bounds)
390390 }
391- fn visit_poly_trait_ref ( & mut self , t : & ' v PolyTraitRef < ' v > , m : TraitBoundModifier ) {
392- walk_poly_trait_ref ( self , t, m )
391+ fn visit_poly_trait_ref ( & mut self , t : & ' v PolyTraitRef < ' v > ) {
392+ walk_poly_trait_ref ( self , t)
393393 }
394394 fn visit_variant_data ( & mut self , s : & ' v VariantData < ' v > ) {
395395 walk_struct_def ( self , s)
@@ -420,17 +420,18 @@ pub trait Visitor<'v>: Sized {
420420 fn visit_lifetime ( & mut self , lifetime : & ' v Lifetime ) {
421421 walk_lifetime ( self , lifetime)
422422 }
423- fn visit_qpath ( & mut self , qpath : & ' v QPath < ' v > , id : HirId , span : Span ) {
424- walk_qpath ( self , qpath, id, span)
423+ // The span is that of the surrounding type/pattern/expr/whatever.
424+ fn visit_qpath ( & mut self , qpath : & ' v QPath < ' v > , id : HirId , _span : Span ) {
425+ walk_qpath ( self , qpath, id)
425426 }
426427 fn visit_path ( & mut self , path : & ' v Path < ' v > , _id : HirId ) {
427428 walk_path ( self , path)
428429 }
429- fn visit_path_segment ( & mut self , path_span : Span , path_segment : & ' v PathSegment < ' v > ) {
430- walk_path_segment ( self , path_span , path_segment)
430+ fn visit_path_segment ( & mut self , path_segment : & ' v PathSegment < ' v > ) {
431+ walk_path_segment ( self , path_segment)
431432 }
432- fn visit_generic_args ( & mut self , path_span : Span , generic_args : & ' v GenericArgs < ' v > ) {
433- walk_generic_args ( self , path_span , generic_args)
433+ fn visit_generic_args ( & mut self , generic_args : & ' v GenericArgs < ' v > ) {
434+ walk_generic_args ( self , generic_args)
434435 }
435436 fn visit_assoc_type_binding ( & mut self , type_binding : & ' v TypeBinding < ' v > ) {
436437 walk_assoc_type_binding ( self , type_binding)
@@ -472,7 +473,7 @@ pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v Local<'v>) {
472473}
473474
474475pub fn walk_ident < ' v , V : Visitor < ' v > > ( visitor : & mut V , ident : Ident ) {
475- visitor. visit_name ( ident. span , ident . name ) ;
476+ visitor. visit_name ( ident. name ) ;
476477}
477478
478479pub fn walk_label < ' v , V : Visitor < ' v > > ( visitor : & mut V , label : & ' v Label ) {
@@ -494,11 +495,7 @@ pub fn walk_lifetime<'v, V: Visitor<'v>>(visitor: &mut V, lifetime: &'v Lifetime
494495 }
495496}
496497
497- pub fn walk_poly_trait_ref < ' v , V : Visitor < ' v > > (
498- visitor : & mut V ,
499- trait_ref : & ' v PolyTraitRef < ' v > ,
500- _modifier : TraitBoundModifier ,
501- ) {
498+ pub fn walk_poly_trait_ref < ' v , V : Visitor < ' v > > ( visitor : & mut V , trait_ref : & ' v PolyTraitRef < ' v > ) {
502499 walk_list ! ( visitor, visit_generic_param, trait_ref. bound_generic_params) ;
503500 visitor. visit_trait_ref ( & trait_ref. trait_ref ) ;
504501}
@@ -519,7 +516,7 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item<'v>) {
519516 ItemKind :: ExternCrate ( orig_name) => {
520517 visitor. visit_id ( item. hir_id ( ) ) ;
521518 if let Some ( orig_name) = orig_name {
522- visitor. visit_name ( item . span , orig_name) ;
519+ visitor. visit_name ( orig_name) ;
523520 }
524521 }
525522 ItemKind :: Use ( ref path, _) => {
@@ -680,7 +677,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) {
680677 }
681678 TyKind :: TraitObject ( bounds, ref lifetime, _syntax) => {
682679 for bound in bounds {
683- visitor. visit_poly_trait_ref ( bound, TraitBoundModifier :: None ) ;
680+ visitor. visit_poly_trait_ref ( bound) ;
684681 }
685682 visitor. visit_lifetime ( lifetime) ;
686683 }
@@ -693,48 +690,35 @@ pub fn walk_inf<'v, V: Visitor<'v>>(visitor: &mut V, inf: &'v InferArg) {
693690 visitor. visit_id ( inf. hir_id ) ;
694691}
695692
696- pub fn walk_qpath < ' v , V : Visitor < ' v > > (
697- visitor : & mut V ,
698- qpath : & ' v QPath < ' v > ,
699- id : HirId ,
700- span : Span ,
701- ) {
693+ pub fn walk_qpath < ' v , V : Visitor < ' v > > ( visitor : & mut V , qpath : & ' v QPath < ' v > , id : HirId ) {
702694 match * qpath {
703695 QPath :: Resolved ( ref maybe_qself, ref path) => {
704696 walk_list ! ( visitor, visit_ty, maybe_qself) ;
705697 visitor. visit_path ( path, id)
706698 }
707699 QPath :: TypeRelative ( ref qself, ref segment) => {
708700 visitor. visit_ty ( qself) ;
709- visitor. visit_path_segment ( span , segment) ;
701+ visitor. visit_path_segment ( segment) ;
710702 }
711703 QPath :: LangItem ( ..) => { }
712704 }
713705}
714706
715707pub fn walk_path < ' v , V : Visitor < ' v > > ( visitor : & mut V , path : & ' v Path < ' v > ) {
716708 for segment in path. segments {
717- visitor. visit_path_segment ( path . span , segment) ;
709+ visitor. visit_path_segment ( segment) ;
718710 }
719711}
720712
721- pub fn walk_path_segment < ' v , V : Visitor < ' v > > (
722- visitor : & mut V ,
723- path_span : Span ,
724- segment : & ' v PathSegment < ' v > ,
725- ) {
713+ pub fn walk_path_segment < ' v , V : Visitor < ' v > > ( visitor : & mut V , segment : & ' v PathSegment < ' v > ) {
726714 visitor. visit_ident ( segment. ident ) ;
727715 visitor. visit_id ( segment. hir_id ) ;
728716 if let Some ( ref args) = segment. args {
729- visitor. visit_generic_args ( path_span , args) ;
717+ visitor. visit_generic_args ( args) ;
730718 }
731719}
732720
733- pub fn walk_generic_args < ' v , V : Visitor < ' v > > (
734- visitor : & mut V ,
735- _path_span : Span ,
736- generic_args : & ' v GenericArgs < ' v > ,
737- ) {
721+ pub fn walk_generic_args < ' v , V : Visitor < ' v > > ( visitor : & mut V , generic_args : & ' v GenericArgs < ' v > ) {
738722 walk_list ! ( visitor, visit_generic_arg, generic_args. args) ;
739723 walk_list ! ( visitor, visit_assoc_type_binding, generic_args. bindings) ;
740724}
@@ -745,7 +729,7 @@ pub fn walk_assoc_type_binding<'v, V: Visitor<'v>>(
745729) {
746730 visitor. visit_id ( type_binding. hir_id ) ;
747731 visitor. visit_ident ( type_binding. ident ) ;
748- visitor. visit_generic_args ( type_binding. span , type_binding . gen_args ) ;
732+ visitor. visit_generic_args ( type_binding. gen_args ) ;
749733 match type_binding. kind {
750734 TypeBindingKind :: Equality { ref term } => match term {
751735 Term :: Ty ( ref ty) => visitor. visit_ty ( ty) ,
@@ -819,12 +803,12 @@ pub fn walk_foreign_item<'v, V: Visitor<'v>>(visitor: &mut V, foreign_item: &'v
819803
820804pub fn walk_param_bound < ' v , V : Visitor < ' v > > ( visitor : & mut V , bound : & ' v GenericBound < ' v > ) {
821805 match * bound {
822- GenericBound :: Trait ( ref typ, modifier ) => {
823- visitor. visit_poly_trait_ref ( typ, modifier ) ;
806+ GenericBound :: Trait ( ref typ, _modifier ) => {
807+ visitor. visit_poly_trait_ref ( typ) ;
824808 }
825- GenericBound :: LangItemTrait ( _, span , hir_id, args) => {
809+ GenericBound :: LangItemTrait ( _, _span , hir_id, args) => {
826810 visitor. visit_id ( hir_id) ;
827- visitor. visit_generic_args ( span , args) ;
811+ visitor. visit_generic_args ( args) ;
828812 }
829813 GenericBound :: Outlives ( ref lifetime) => visitor. visit_lifetime ( lifetime) ,
830814 }
@@ -910,7 +894,6 @@ pub fn walk_fn<'v, V: Visitor<'v>>(
910894 function_kind : FnKind < ' v > ,
911895 function_declaration : & ' v FnDecl < ' v > ,
912896 body_id : BodyId ,
913- _span : Span ,
914897 id : HirId ,
915898) {
916899 visitor. visit_id ( id) ;
@@ -1095,7 +1078,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>)
10951078 walk_list ! ( visitor, visit_expr, arguments) ;
10961079 }
10971080 ExprKind :: MethodCall ( ref segment, receiver, arguments, _) => {
1098- visitor. visit_path_segment ( expression . span , segment) ;
1081+ visitor. visit_path_segment ( segment) ;
10991082 visitor. visit_expr ( receiver) ;
11001083 walk_list ! ( visitor, visit_expr, arguments) ;
11011084 }
0 commit comments