@@ -188,7 +188,6 @@ macro_rules! make_ast_visitor {
188
188
// field access version will continue working and it would be easy to
189
189
// forget to add handling for it.
190
190
191
- make_visit!{ CaptureBy ; visit_capture_by, walk_capture_by}
192
191
make_visit!{ CoroutineKind ; visit_coroutine_kind, walk_coroutine_kind}
193
192
make_visit!{ FnHeader ; visit_fn_header, walk_fn_header}
194
193
make_visit!{ ForeignMod ; visit_foreign_mod, walk_foreign_mod}
@@ -314,15 +313,13 @@ macro_rules! make_ast_visitor {
314
313
fn visit_fn_header( & mut self , _header: & ' ast FnHeader ) -> Self :: Result {
315
314
Self :: Result :: output( )
316
315
}
317
- fn visit_capture_by( & mut self , _capture_by: & ' ast CaptureBy ) -> Self :: Result {
318
- Self :: Result :: output( )
319
- }
320
316
} }
321
317
322
318
make_visit!{ AngleBracketedArgs ; visit_angle_bracketed_parameter_data, walk_angle_bracketed_parameter_data}
323
319
make_visit!{ AnonConst ; visit_anon_const, walk_anon_const}
324
320
make_visit!{ AssocItemConstraint ; visit_assoc_item_constraint, walk_assoc_item_constraint}
325
321
make_visit!{ Attribute ; visit_attribute, walk_attribute}
322
+ make_visit!{ CaptureBy ; visit_capture_by, walk_capture_by}
326
323
make_visit!{ ClosureBinder ; visit_closure_binder, walk_closure_binder}
327
324
make_visit!{ Crate ; visit_crate, walk_crate}
328
325
make_visit!{ FnDecl ; visit_fn_decl, walk_fn_decl}
@@ -380,6 +377,19 @@ macro_rules! make_ast_visitor {
380
377
return_result!( V )
381
378
}
382
379
380
+ pub fn walk_capture_by<$( $lt, ) ? V : $trait$( <$lt>) ?>(
381
+ vis: & mut V ,
382
+ capture_by: ref_t!( CaptureBy )
383
+ ) -> result!( V ) {
384
+ match capture_by {
385
+ CaptureBy :: Ref => { }
386
+ CaptureBy :: Value { move_kw } => {
387
+ try_v!( visit_span!( vis, move_kw) )
388
+ }
389
+ }
390
+ return_result!( V )
391
+ }
392
+
383
393
pub fn walk_closure_binder<$( $lt, ) ? V : $trait$( <$lt>) ?>(
384
394
vis: & mut V ,
385
395
binder: ref_t!( ClosureBinder )
@@ -2850,15 +2860,6 @@ pub mod mut_visit {
2850
2860
vis. visit_span ( span) ;
2851
2861
}
2852
2862
2853
- fn walk_capture_by < T : MutVisitor > ( vis : & mut T , capture_by : & mut CaptureBy ) {
2854
- match capture_by {
2855
- CaptureBy :: Ref => { }
2856
- CaptureBy :: Value { move_kw } => {
2857
- vis. visit_span ( move_kw) ;
2858
- }
2859
- }
2860
- }
2861
-
2862
2863
/// Some value for the AST node that is valid but possibly meaningless. Similar
2863
2864
/// to `Default` but not intended for wide use. The value will never be used
2864
2865
/// meaningfully, it exists just to support unwinding in `visit_clobber` in the
0 commit comments