@@ -515,6 +515,18 @@ macro_rules! make_ast_visitor {
515
515
return_result!( V )
516
516
}
517
517
518
+ pub fn walk_generic_arg<$( $lt, ) ? V : $trait$( <$lt>) ?>(
519
+ vis: & mut V ,
520
+ arg: ref_t!( GenericArg )
521
+ ) -> result!( V ) {
522
+ match arg {
523
+ GenericArg :: Lifetime ( lt) => try_v!( vis. visit_lifetime( lt, LifetimeCtxt :: GenericArg ) ) ,
524
+ GenericArg :: Type ( ty) => try_v!( vis. visit_ty( ty) ) ,
525
+ GenericArg :: Const ( ct) => try_v!( vis. visit_anon_const( ct) ) ,
526
+ }
527
+ return_result!( V )
528
+ }
529
+
518
530
pub fn walk_generic_args<$( $lt, ) ? V : $trait$( <$lt>) ?>(
519
531
vis: & mut V ,
520
532
generic_args: ref_t!( GenericArgs )
@@ -1130,17 +1142,6 @@ pub mod visit {
1130
1142
V :: Result :: output ( )
1131
1143
}
1132
1144
1133
- pub fn walk_generic_arg < ' a , V > ( visitor : & mut V , generic_arg : & ' a GenericArg ) -> V :: Result
1134
- where
1135
- V : Visitor < ' a > ,
1136
- {
1137
- match generic_arg {
1138
- GenericArg :: Lifetime ( lt) => visitor. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ,
1139
- GenericArg :: Type ( ty) => visitor. visit_ty ( ty) ,
1140
- GenericArg :: Const ( ct) => visitor. visit_anon_const ( ct) ,
1141
- }
1142
- }
1143
-
1144
1145
pub fn walk_assoc_item_constraint < ' a , V : Visitor < ' a > > (
1145
1146
visitor : & mut V ,
1146
1147
constraint : & ' a AssocItemConstraint ,
@@ -1846,14 +1847,6 @@ pub mod mut_visit {
1846
1847
smallvec ! [ variant]
1847
1848
}
1848
1849
1849
- fn walk_generic_arg < T : MutVisitor > ( vis : & mut T , arg : & mut GenericArg ) {
1850
- match arg {
1851
- GenericArg :: Lifetime ( lt) => vis. visit_lifetime ( lt, LifetimeCtxt :: GenericArg ) ,
1852
- GenericArg :: Type ( ty) => vis. visit_ty ( ty) ,
1853
- GenericArg :: Const ( ct) => vis. visit_anon_const ( ct) ,
1854
- }
1855
- }
1856
-
1857
1850
fn walk_attribute < T : MutVisitor > ( vis : & mut T , attr : & mut Attribute ) {
1858
1851
let Attribute { kind, id : _, style : _, span } = attr;
1859
1852
match kind {
0 commit comments