@@ -299,6 +299,12 @@ pub trait Visitor<'ast>: Sized {
299
299
fn visit_coroutine_kind ( & mut self , _coroutine_kind : & ' ast CoroutineKind ) -> Self :: Result {
300
300
Self :: Result :: output ( )
301
301
}
302
+ fn visit_fn_decl ( & mut self , fn_decl : & ' ast FnDecl ) -> Self :: Result {
303
+ walk_fn_decl ( self , fn_decl)
304
+ }
305
+ fn visit_qself ( & mut self , qs : & ' ast Option < P < QSelf > > ) -> Self :: Result {
306
+ walk_qself ( self , qs)
307
+ }
302
308
}
303
309
304
310
pub fn walk_crate < ' a , V : Visitor < ' a > > ( visitor : & mut V , krate : & ' a Crate ) -> V :: Result {
@@ -434,13 +440,13 @@ impl WalkItemKind for ItemKind {
434
440
body,
435
441
from_glob : _,
436
442
} ) => {
437
- try_visit ! ( walk_qself ( visitor, qself) ) ;
443
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
438
444
try_visit ! ( visitor. visit_path( path, * id) ) ;
439
445
visit_opt ! ( visitor, visit_ident, rename) ;
440
446
visit_opt ! ( visitor, visit_block, body) ;
441
447
}
442
448
ItemKind :: DelegationMac ( box DelegationMac { qself, prefix, suffixes, body } ) => {
443
- try_visit ! ( walk_qself ( visitor, qself) ) ;
449
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
444
450
try_visit ! ( visitor. visit_path( prefix, id) ) ;
445
451
if let Some ( suffixes) = suffixes {
446
452
for ( ident, rename) in suffixes {
@@ -518,10 +524,10 @@ pub fn walk_ty<'a, V: Visitor<'a>>(visitor: &mut V, typ: &'a Ty) -> V::Result {
518
524
let BareFnTy { safety : _, ext : _, generic_params, decl, decl_span : _ } =
519
525
& * * function_declaration;
520
526
walk_list ! ( visitor, visit_generic_param, generic_params) ;
521
- try_visit ! ( walk_fn_decl ( visitor, decl) ) ;
527
+ try_visit ! ( visitor. visit_fn_decl ( decl) ) ;
522
528
}
523
529
TyKind :: Path ( maybe_qself, path) => {
524
- try_visit ! ( walk_qself ( visitor, maybe_qself) ) ;
530
+ try_visit ! ( visitor. visit_qself ( maybe_qself) ) ;
525
531
try_visit ! ( visitor. visit_path( path, * id) ) ;
526
532
}
527
533
TyKind :: Pat ( ty, pat) => {
@@ -652,16 +658,16 @@ pub fn walk_pat<'a, V: Visitor<'a>>(visitor: &mut V, pattern: &'a Pat) -> V::Res
652
658
let Pat { id, kind, span : _, tokens : _ } = pattern;
653
659
match kind {
654
660
PatKind :: TupleStruct ( opt_qself, path, elems) => {
655
- try_visit ! ( walk_qself ( visitor, opt_qself) ) ;
661
+ try_visit ! ( visitor. visit_qself ( opt_qself) ) ;
656
662
try_visit ! ( visitor. visit_path( path, * id) ) ;
657
663
walk_list ! ( visitor, visit_pat, elems) ;
658
664
}
659
665
PatKind :: Path ( opt_qself, path) => {
660
- try_visit ! ( walk_qself ( visitor, opt_qself) ) ;
666
+ try_visit ! ( visitor. visit_qself ( opt_qself) ) ;
661
667
try_visit ! ( visitor. visit_path( path, * id) )
662
668
}
663
669
PatKind :: Struct ( opt_qself, path, fields, _rest) => {
664
- try_visit ! ( walk_qself ( visitor, opt_qself) ) ;
670
+ try_visit ! ( visitor. visit_qself ( opt_qself) ) ;
665
671
try_visit ! ( visitor. visit_path( path, * id) ) ;
666
672
walk_list ! ( visitor, visit_pat_field, fields) ;
667
673
}
@@ -846,13 +852,13 @@ pub fn walk_fn<'a, V: Visitor<'a>>(visitor: &mut V, kind: FnKind<'a>) -> V::Resu
846
852
// Identifier and visibility are visited as a part of the item.
847
853
try_visit ! ( visitor. visit_fn_header( header) ) ;
848
854
try_visit ! ( visitor. visit_generics( generics) ) ;
849
- try_visit ! ( walk_fn_decl ( visitor, decl) ) ;
855
+ try_visit ! ( visitor. visit_fn_decl ( decl) ) ;
850
856
visit_opt ! ( visitor, visit_block, body) ;
851
857
}
852
858
FnKind :: Closure ( binder, coroutine_kind, decl, body) => {
853
859
try_visit ! ( visitor. visit_closure_binder( binder) ) ;
854
860
visit_opt ! ( visitor, visit_coroutine_kind, coroutine_kind. as_ref( ) ) ;
855
- try_visit ! ( walk_fn_decl ( visitor, decl) ) ;
861
+ try_visit ! ( visitor. visit_fn_decl ( decl) ) ;
856
862
try_visit ! ( visitor. visit_expr( body) ) ;
857
863
}
858
864
}
@@ -902,13 +908,13 @@ impl WalkItemKind for AssocItemKind {
902
908
body,
903
909
from_glob : _,
904
910
} ) => {
905
- try_visit ! ( walk_qself ( visitor, qself) ) ;
911
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
906
912
try_visit ! ( visitor. visit_path( path, * id) ) ;
907
913
visit_opt ! ( visitor, visit_ident, rename) ;
908
914
visit_opt ! ( visitor, visit_block, body) ;
909
915
}
910
916
AssocItemKind :: DelegationMac ( box DelegationMac { qself, prefix, suffixes, body } ) => {
911
- try_visit ! ( walk_qself ( visitor, qself) ) ;
917
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
912
918
try_visit ! ( visitor. visit_path( prefix, id) ) ;
913
919
if let Some ( suffixes) = suffixes {
914
920
for ( ident, rename) in suffixes {
@@ -1023,7 +1029,7 @@ pub fn walk_inline_asm_sym<'a, V: Visitor<'a>>(
1023
1029
visitor : & mut V ,
1024
1030
InlineAsmSym { id, qself, path } : & ' a InlineAsmSym ,
1025
1031
) -> V :: Result {
1026
- try_visit ! ( walk_qself ( visitor, qself) ) ;
1032
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
1027
1033
visitor. visit_path ( path, * id)
1028
1034
}
1029
1035
@@ -1055,7 +1061,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
1055
1061
}
1056
1062
ExprKind :: Struct ( se) => {
1057
1063
let StructExpr { qself, path, fields, rest } = & * * se;
1058
- try_visit ! ( walk_qself ( visitor, qself) ) ;
1064
+ try_visit ! ( visitor. visit_qself ( qself) ) ;
1059
1065
try_visit ! ( visitor. visit_path( path, * id) ) ;
1060
1066
walk_list ! ( visitor, visit_expr_field, fields) ;
1061
1067
match rest {
@@ -1164,7 +1170,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
1164
1170
}
1165
1171
ExprKind :: Underscore => { }
1166
1172
ExprKind :: Path ( maybe_qself, path) => {
1167
- try_visit ! ( walk_qself ( visitor, maybe_qself) ) ;
1173
+ try_visit ! ( visitor. visit_qself ( maybe_qself) ) ;
1168
1174
try_visit ! ( visitor. visit_path( path, * id) ) ;
1169
1175
}
1170
1176
ExprKind :: Break ( opt_label, opt_expr) => {
0 commit comments