@@ -515,6 +515,18 @@ macro_rules! make_ast_visitor {
515515 return_result!( V )
516516 }
517517
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+
518530 pub fn walk_generic_args<$( $lt, ) ? V : $trait$( <$lt>) ?>(
519531 vis: & mut V ,
520532 generic_args: ref_t!( GenericArgs )
@@ -1130,17 +1142,6 @@ pub mod visit {
11301142 V :: Result :: output ( )
11311143 }
11321144
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-
11441145 pub fn walk_assoc_item_constraint < ' a , V : Visitor < ' a > > (
11451146 visitor : & mut V ,
11461147 constraint : & ' a AssocItemConstraint ,
@@ -1846,14 +1847,6 @@ pub mod mut_visit {
18461847 smallvec ! [ variant]
18471848 }
18481849
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-
18571850 fn walk_attribute < T : MutVisitor > ( vis : & mut T , attr : & mut Attribute ) {
18581851 let Attribute { kind, id : _, style : _, span } = attr;
18591852 match kind {
0 commit comments