@@ -268,8 +268,8 @@ pub trait Visitor<'ast>: Sized {
268
268
fn visit_fn_ret_ty ( & mut self , ret_ty : & ' ast FnRetTy ) -> Self :: Result {
269
269
walk_fn_ret_ty ( self , ret_ty)
270
270
}
271
- fn visit_fn_header ( & mut self , _header : & ' ast FnHeader ) -> Self :: Result {
272
- Self :: Result :: output ( )
271
+ fn visit_fn_header ( & mut self , header : & ' ast FnHeader ) -> Self :: Result {
272
+ walk_fn_header ( self , header )
273
273
}
274
274
fn visit_expr_field ( & mut self , f : & ' ast ExprField ) -> Self :: Result {
275
275
walk_expr_field ( self , f)
@@ -292,6 +292,9 @@ pub trait Visitor<'ast>: Sized {
292
292
fn visit_capture_by ( & mut self , _capture_by : & ' ast CaptureBy ) -> Self :: Result {
293
293
Self :: Result :: output ( )
294
294
}
295
+ fn visit_coroutine_kind ( & mut self , _coroutine_kind : & ' ast CoroutineKind ) -> Self :: Result {
296
+ Self :: Result :: output ( )
297
+ }
295
298
}
296
299
297
300
pub fn walk_crate < ' a , V : Visitor < ' a > > ( visitor : & mut V , krate : & ' a Crate ) -> V :: Result {
@@ -813,6 +816,12 @@ pub fn walk_fn_ret_ty<'a, V: Visitor<'a>>(visitor: &mut V, ret_ty: &'a FnRetTy)
813
816
V :: Result :: output ( )
814
817
}
815
818
819
+ pub fn walk_fn_header < ' a , V : Visitor < ' a > > ( visitor : & mut V , fn_header : & ' a FnHeader ) -> V :: Result {
820
+ let FnHeader { safety : _, coroutine_kind, constness : _, ext : _ } = fn_header;
821
+ visit_opt ! ( visitor, visit_coroutine_kind, coroutine_kind. as_ref( ) ) ;
822
+ V :: Result :: output ( )
823
+ }
824
+
816
825
pub fn walk_fn_decl < ' a , V : Visitor < ' a > > (
817
826
visitor : & mut V ,
818
827
FnDecl { inputs, output } : & ' a FnDecl ,
@@ -830,8 +839,9 @@ pub fn walk_fn<'a, V: Visitor<'a>>(visitor: &mut V, kind: FnKind<'a>) -> V::Resu
830
839
try_visit ! ( walk_fn_decl( visitor, decl) ) ;
831
840
visit_opt ! ( visitor, visit_block, body) ;
832
841
}
833
- FnKind :: Closure ( binder, _coroutine_kind , decl, body) => {
842
+ FnKind :: Closure ( binder, coroutine_kind , decl, body) => {
834
843
try_visit ! ( visitor. visit_closure_binder( binder) ) ;
844
+ visit_opt ! ( visitor, visit_coroutine_kind, coroutine_kind. as_ref( ) ) ;
835
845
try_visit ! ( walk_fn_decl( visitor, decl) ) ;
836
846
try_visit ! ( visitor. visit_expr( body) ) ;
837
847
}
0 commit comments