@@ -509,6 +509,18 @@ macro_rules! make_ast_visitor {
509
509
return_result!( V )
510
510
}
511
511
512
+ pub fn walk_generic_arg<$( $lt, ) ? V : $trait$( <$lt>) ?>(
513
+ vis: & mut V ,
514
+ arg: ref_t!( GenericArg )
515
+ ) -> result!( V ) {
516
+ match arg {
517
+ GenericArg :: Lifetime ( lt) => try_v!( vis. visit_lifetime( lt, LifetimeCtxt :: GenericArg ) ) ,
518
+ GenericArg :: Type ( ty) => try_v!( vis. visit_ty( ty) ) ,
519
+ GenericArg :: Const ( ct) => try_v!( vis. visit_anon_const( ct) ) ,
520
+ }
521
+ return_result!( V )
522
+ }
523
+
512
524
pub fn walk_generic_args<$( $lt, ) ? V : $trait$( <$lt>) ?>(
513
525
vis: & mut V ,
514
526
generic_args: ref_t!( GenericArgs )
@@ -1124,17 +1136,6 @@ pub mod visit {
1124
1136
V :: Result :: output ( )
1125
1137
}
1126
1138
1127
- pub fn walk_generic_arg < ' a , V > ( visitor : & mut V , generic_arg : & ' a GenericArg ) -> V :: Result
1128
- where
1129
- V : Visitor < ' a > ,
1130
- {
1131
- match generic_arg {
1132
- GenericArg :: Lifetime ( lt) => visitor. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ,
1133
- GenericArg :: Type ( ty) => visitor. visit_ty ( ty) ,
1134
- GenericArg :: Const ( ct) => visitor. visit_anon_const ( ct) ,
1135
- }
1136
- }
1137
-
1138
1139
pub fn walk_assoc_item_constraint < ' a , V : Visitor < ' a > > (
1139
1140
visitor : & mut V ,
1140
1141
constraint : & ' a AssocItemConstraint ,
@@ -1840,14 +1841,6 @@ pub mod mut_visit {
1840
1841
smallvec ! [ variant]
1841
1842
}
1842
1843
1843
- fn walk_generic_arg < T : MutVisitor > ( vis : & mut T , arg : & mut GenericArg ) {
1844
- match arg {
1845
- GenericArg :: Lifetime ( lt) => vis. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ,
1846
- GenericArg :: Type ( ty) => vis. visit_ty ( ty) ,
1847
- GenericArg :: Const ( ct) => vis. visit_anon_const ( ct) ,
1848
- }
1849
- }
1850
-
1851
1844
fn walk_attribute < T : MutVisitor > ( vis : & mut T , attr : & mut Attribute ) {
1852
1845
let Attribute { kind, id : _, style : _, span } = attr;
1853
1846
match kind {
0 commit comments