@@ -410,12 +410,7 @@ pub trait Visitor<'v>: Sized {
410
410
walk_inf ( self , inf) ;
411
411
}
412
412
fn visit_generic_arg ( & mut self , generic_arg : & ' v GenericArg < ' v > ) {
413
- match generic_arg {
414
- GenericArg :: Lifetime ( lt) => self . visit_lifetime ( lt) ,
415
- GenericArg :: Type ( ty) => self . visit_ty ( ty) ,
416
- GenericArg :: Const ( ct) => self . visit_anon_const ( & ct. value ) ,
417
- GenericArg :: Infer ( inf) => self . visit_infer ( inf) ,
418
- }
413
+ walk_generic_arg ( self , generic_arg) ;
419
414
}
420
415
fn visit_lifetime ( & mut self , lifetime : & ' v Lifetime ) {
421
416
walk_lifetime ( self , lifetime)
@@ -480,6 +475,15 @@ pub fn walk_label<'v, V: Visitor<'v>>(visitor: &mut V, label: &'v Label) {
480
475
visitor. visit_ident ( label. ident ) ;
481
476
}
482
477
478
+ pub fn walk_generic_arg < ' v , V : Visitor < ' v > > ( visitor : & mut V , generic_arg : & ' v GenericArg < ' v > ) {
479
+ match generic_arg {
480
+ GenericArg :: Lifetime ( lt) => visitor. visit_lifetime ( lt) ,
481
+ GenericArg :: Type ( ty) => visitor. visit_ty ( ty) ,
482
+ GenericArg :: Const ( ct) => visitor. visit_anon_const ( & ct. value ) ,
483
+ GenericArg :: Infer ( inf) => visitor. visit_infer ( inf) ,
484
+ }
485
+ }
486
+
483
487
pub fn walk_lifetime < ' v , V : Visitor < ' v > > ( visitor : & mut V , lifetime : & ' v Lifetime ) {
484
488
visitor. visit_id ( lifetime. hir_id ) ;
485
489
match lifetime. name {
0 commit comments