1 // This file is @generated by syn-internal-codegen.
2 // It is not intended for manual editing.
4 #![allow(unreachable_code, unused_variables)]
5 #![allow(clippy::match_wildcard_for_single_variants)]
6 #[cfg(any(feature = "full", feature = "derive"))]
7 use crate::gen
::helper
::fold
::*;
8 #[cfg(any(feature = "full", feature = "derive"))]
9 use crate::token
::{Brace, Bracket, Group, Paren}
;
11 use proc_macro2
::Span
;
12 #[cfg(feature = "full")]
18 #[cfg(all(feature = "derive", not(feature = "full")))]
24 /// Syntax tree traversal to transform the nodes of an owned syntax tree.
26 /// See the [module documentation] for details.
28 /// [module documentation]: self
30 /// *This trait is available only if Syn is built with the `"fold"` feature.*
32 #[cfg(any(feature = "derive", feature = "full"))]
33 fn fold_abi(&mut self, i
: Abi
) -> Abi
{
36 #[cfg(any(feature = "derive", feature = "full"))]
37 fn fold_angle_bracketed_generic_arguments(
39 i
: AngleBracketedGenericArguments
,
40 ) -> AngleBracketedGenericArguments
{
41 fold_angle_bracketed_generic_arguments(self, i
)
43 #[cfg(feature = "full")]
44 fn fold_arm(&mut self, i
: Arm
) -> Arm
{
47 #[cfg(any(feature = "derive", feature = "full"))]
48 fn fold_attr_style(&mut self, i
: AttrStyle
) -> AttrStyle
{
49 fold_attr_style(self, i
)
51 #[cfg(any(feature = "derive", feature = "full"))]
52 fn fold_attribute(&mut self, i
: Attribute
) -> Attribute
{
53 fold_attribute(self, i
)
55 #[cfg(any(feature = "derive", feature = "full"))]
56 fn fold_bare_fn_arg(&mut self, i
: BareFnArg
) -> BareFnArg
{
57 fold_bare_fn_arg(self, i
)
59 #[cfg(any(feature = "derive", feature = "full"))]
60 fn fold_bin_op(&mut self, i
: BinOp
) -> BinOp
{
63 #[cfg(any(feature = "derive", feature = "full"))]
64 fn fold_binding(&mut self, i
: Binding
) -> Binding
{
67 #[cfg(feature = "full")]
68 fn fold_block(&mut self, i
: Block
) -> Block
{
71 #[cfg(any(feature = "derive", feature = "full"))]
72 fn fold_bound_lifetimes(&mut self, i
: BoundLifetimes
) -> BoundLifetimes
{
73 fold_bound_lifetimes(self, i
)
75 #[cfg(any(feature = "derive", feature = "full"))]
76 fn fold_const_param(&mut self, i
: ConstParam
) -> ConstParam
{
77 fold_const_param(self, i
)
79 #[cfg(any(feature = "derive", feature = "full"))]
80 fn fold_constraint(&mut self, i
: Constraint
) -> Constraint
{
81 fold_constraint(self, i
)
83 #[cfg(feature = "derive")]
84 fn fold_data(&mut self, i
: Data
) -> Data
{
87 #[cfg(feature = "derive")]
88 fn fold_data_enum(&mut self, i
: DataEnum
) -> DataEnum
{
89 fold_data_enum(self, i
)
91 #[cfg(feature = "derive")]
92 fn fold_data_struct(&mut self, i
: DataStruct
) -> DataStruct
{
93 fold_data_struct(self, i
)
95 #[cfg(feature = "derive")]
96 fn fold_data_union(&mut self, i
: DataUnion
) -> DataUnion
{
97 fold_data_union(self, i
)
99 #[cfg(feature = "derive")]
100 fn fold_derive_input(&mut self, i
: DeriveInput
) -> DeriveInput
{
101 fold_derive_input(self, i
)
103 #[cfg(any(feature = "derive", feature = "full"))]
104 fn fold_expr(&mut self, i
: Expr
) -> Expr
{
107 #[cfg(feature = "full")]
108 fn fold_expr_array(&mut self, i
: ExprArray
) -> ExprArray
{
109 fold_expr_array(self, i
)
111 #[cfg(feature = "full")]
112 fn fold_expr_assign(&mut self, i
: ExprAssign
) -> ExprAssign
{
113 fold_expr_assign(self, i
)
115 #[cfg(feature = "full")]
116 fn fold_expr_assign_op(&mut self, i
: ExprAssignOp
) -> ExprAssignOp
{
117 fold_expr_assign_op(self, i
)
119 #[cfg(feature = "full")]
120 fn fold_expr_async(&mut self, i
: ExprAsync
) -> ExprAsync
{
121 fold_expr_async(self, i
)
123 #[cfg(feature = "full")]
124 fn fold_expr_await(&mut self, i
: ExprAwait
) -> ExprAwait
{
125 fold_expr_await(self, i
)
127 #[cfg(any(feature = "derive", feature = "full"))]
128 fn fold_expr_binary(&mut self, i
: ExprBinary
) -> ExprBinary
{
129 fold_expr_binary(self, i
)
131 #[cfg(feature = "full")]
132 fn fold_expr_block(&mut self, i
: ExprBlock
) -> ExprBlock
{
133 fold_expr_block(self, i
)
135 #[cfg(feature = "full")]
136 fn fold_expr_box(&mut self, i
: ExprBox
) -> ExprBox
{
137 fold_expr_box(self, i
)
139 #[cfg(feature = "full")]
140 fn fold_expr_break(&mut self, i
: ExprBreak
) -> ExprBreak
{
141 fold_expr_break(self, i
)
143 #[cfg(any(feature = "derive", feature = "full"))]
144 fn fold_expr_call(&mut self, i
: ExprCall
) -> ExprCall
{
145 fold_expr_call(self, i
)
147 #[cfg(any(feature = "derive", feature = "full"))]
148 fn fold_expr_cast(&mut self, i
: ExprCast
) -> ExprCast
{
149 fold_expr_cast(self, i
)
151 #[cfg(feature = "full")]
152 fn fold_expr_closure(&mut self, i
: ExprClosure
) -> ExprClosure
{
153 fold_expr_closure(self, i
)
155 #[cfg(feature = "full")]
156 fn fold_expr_continue(&mut self, i
: ExprContinue
) -> ExprContinue
{
157 fold_expr_continue(self, i
)
159 #[cfg(any(feature = "derive", feature = "full"))]
160 fn fold_expr_field(&mut self, i
: ExprField
) -> ExprField
{
161 fold_expr_field(self, i
)
163 #[cfg(feature = "full")]
164 fn fold_expr_for_loop(&mut self, i
: ExprForLoop
) -> ExprForLoop
{
165 fold_expr_for_loop(self, i
)
167 #[cfg(feature = "full")]
168 fn fold_expr_group(&mut self, i
: ExprGroup
) -> ExprGroup
{
169 fold_expr_group(self, i
)
171 #[cfg(feature = "full")]
172 fn fold_expr_if(&mut self, i
: ExprIf
) -> ExprIf
{
173 fold_expr_if(self, i
)
175 #[cfg(any(feature = "derive", feature = "full"))]
176 fn fold_expr_index(&mut self, i
: ExprIndex
) -> ExprIndex
{
177 fold_expr_index(self, i
)
179 #[cfg(feature = "full")]
180 fn fold_expr_let(&mut self, i
: ExprLet
) -> ExprLet
{
181 fold_expr_let(self, i
)
183 #[cfg(any(feature = "derive", feature = "full"))]
184 fn fold_expr_lit(&mut self, i
: ExprLit
) -> ExprLit
{
185 fold_expr_lit(self, i
)
187 #[cfg(feature = "full")]
188 fn fold_expr_loop(&mut self, i
: ExprLoop
) -> ExprLoop
{
189 fold_expr_loop(self, i
)
191 #[cfg(feature = "full")]
192 fn fold_expr_macro(&mut self, i
: ExprMacro
) -> ExprMacro
{
193 fold_expr_macro(self, i
)
195 #[cfg(feature = "full")]
196 fn fold_expr_match(&mut self, i
: ExprMatch
) -> ExprMatch
{
197 fold_expr_match(self, i
)
199 #[cfg(feature = "full")]
200 fn fold_expr_method_call(&mut self, i
: ExprMethodCall
) -> ExprMethodCall
{
201 fold_expr_method_call(self, i
)
203 #[cfg(any(feature = "derive", feature = "full"))]
204 fn fold_expr_paren(&mut self, i
: ExprParen
) -> ExprParen
{
205 fold_expr_paren(self, i
)
207 #[cfg(any(feature = "derive", feature = "full"))]
208 fn fold_expr_path(&mut self, i
: ExprPath
) -> ExprPath
{
209 fold_expr_path(self, i
)
211 #[cfg(feature = "full")]
212 fn fold_expr_range(&mut self, i
: ExprRange
) -> ExprRange
{
213 fold_expr_range(self, i
)
215 #[cfg(feature = "full")]
216 fn fold_expr_reference(&mut self, i
: ExprReference
) -> ExprReference
{
217 fold_expr_reference(self, i
)
219 #[cfg(feature = "full")]
220 fn fold_expr_repeat(&mut self, i
: ExprRepeat
) -> ExprRepeat
{
221 fold_expr_repeat(self, i
)
223 #[cfg(feature = "full")]
224 fn fold_expr_return(&mut self, i
: ExprReturn
) -> ExprReturn
{
225 fold_expr_return(self, i
)
227 #[cfg(feature = "full")]
228 fn fold_expr_struct(&mut self, i
: ExprStruct
) -> ExprStruct
{
229 fold_expr_struct(self, i
)
231 #[cfg(feature = "full")]
232 fn fold_expr_try(&mut self, i
: ExprTry
) -> ExprTry
{
233 fold_expr_try(self, i
)
235 #[cfg(feature = "full")]
236 fn fold_expr_try_block(&mut self, i
: ExprTryBlock
) -> ExprTryBlock
{
237 fold_expr_try_block(self, i
)
239 #[cfg(feature = "full")]
240 fn fold_expr_tuple(&mut self, i
: ExprTuple
) -> ExprTuple
{
241 fold_expr_tuple(self, i
)
243 #[cfg(feature = "full")]
244 fn fold_expr_type(&mut self, i
: ExprType
) -> ExprType
{
245 fold_expr_type(self, i
)
247 #[cfg(any(feature = "derive", feature = "full"))]
248 fn fold_expr_unary(&mut self, i
: ExprUnary
) -> ExprUnary
{
249 fold_expr_unary(self, i
)
251 #[cfg(feature = "full")]
252 fn fold_expr_unsafe(&mut self, i
: ExprUnsafe
) -> ExprUnsafe
{
253 fold_expr_unsafe(self, i
)
255 #[cfg(feature = "full")]
256 fn fold_expr_while(&mut self, i
: ExprWhile
) -> ExprWhile
{
257 fold_expr_while(self, i
)
259 #[cfg(feature = "full")]
260 fn fold_expr_yield(&mut self, i
: ExprYield
) -> ExprYield
{
261 fold_expr_yield(self, i
)
263 #[cfg(any(feature = "derive", feature = "full"))]
264 fn fold_field(&mut self, i
: Field
) -> Field
{
267 #[cfg(feature = "full")]
268 fn fold_field_pat(&mut self, i
: FieldPat
) -> FieldPat
{
269 fold_field_pat(self, i
)
271 #[cfg(feature = "full")]
272 fn fold_field_value(&mut self, i
: FieldValue
) -> FieldValue
{
273 fold_field_value(self, i
)
275 #[cfg(any(feature = "derive", feature = "full"))]
276 fn fold_fields(&mut self, i
: Fields
) -> Fields
{
279 #[cfg(any(feature = "derive", feature = "full"))]
280 fn fold_fields_named(&mut self, i
: FieldsNamed
) -> FieldsNamed
{
281 fold_fields_named(self, i
)
283 #[cfg(any(feature = "derive", feature = "full"))]
284 fn fold_fields_unnamed(&mut self, i
: FieldsUnnamed
) -> FieldsUnnamed
{
285 fold_fields_unnamed(self, i
)
287 #[cfg(feature = "full")]
288 fn fold_file(&mut self, i
: File
) -> File
{
291 #[cfg(feature = "full")]
292 fn fold_fn_arg(&mut self, i
: FnArg
) -> FnArg
{
295 #[cfg(feature = "full")]
296 fn fold_foreign_item(&mut self, i
: ForeignItem
) -> ForeignItem
{
297 fold_foreign_item(self, i
)
299 #[cfg(feature = "full")]
300 fn fold_foreign_item_fn(&mut self, i
: ForeignItemFn
) -> ForeignItemFn
{
301 fold_foreign_item_fn(self, i
)
303 #[cfg(feature = "full")]
304 fn fold_foreign_item_macro(&mut self, i
: ForeignItemMacro
) -> ForeignItemMacro
{
305 fold_foreign_item_macro(self, i
)
307 #[cfg(feature = "full")]
308 fn fold_foreign_item_static(&mut self, i
: ForeignItemStatic
) -> ForeignItemStatic
{
309 fold_foreign_item_static(self, i
)
311 #[cfg(feature = "full")]
312 fn fold_foreign_item_type(&mut self, i
: ForeignItemType
) -> ForeignItemType
{
313 fold_foreign_item_type(self, i
)
315 #[cfg(any(feature = "derive", feature = "full"))]
316 fn fold_generic_argument(&mut self, i
: GenericArgument
) -> GenericArgument
{
317 fold_generic_argument(self, i
)
319 #[cfg(feature = "full")]
320 fn fold_generic_method_argument(&mut self, i
: GenericMethodArgument
) -> GenericMethodArgument
{
321 fold_generic_method_argument(self, i
)
323 #[cfg(any(feature = "derive", feature = "full"))]
324 fn fold_generic_param(&mut self, i
: GenericParam
) -> GenericParam
{
325 fold_generic_param(self, i
)
327 #[cfg(any(feature = "derive", feature = "full"))]
328 fn fold_generics(&mut self, i
: Generics
) -> Generics
{
329 fold_generics(self, i
)
331 fn fold_ident(&mut self, i
: Ident
) -> Ident
{
334 #[cfg(feature = "full")]
335 fn fold_impl_item(&mut self, i
: ImplItem
) -> ImplItem
{
336 fold_impl_item(self, i
)
338 #[cfg(feature = "full")]
339 fn fold_impl_item_const(&mut self, i
: ImplItemConst
) -> ImplItemConst
{
340 fold_impl_item_const(self, i
)
342 #[cfg(feature = "full")]
343 fn fold_impl_item_macro(&mut self, i
: ImplItemMacro
) -> ImplItemMacro
{
344 fold_impl_item_macro(self, i
)
346 #[cfg(feature = "full")]
347 fn fold_impl_item_method(&mut self, i
: ImplItemMethod
) -> ImplItemMethod
{
348 fold_impl_item_method(self, i
)
350 #[cfg(feature = "full")]
351 fn fold_impl_item_type(&mut self, i
: ImplItemType
) -> ImplItemType
{
352 fold_impl_item_type(self, i
)
354 #[cfg(any(feature = "derive", feature = "full"))]
355 fn fold_index(&mut self, i
: Index
) -> Index
{
358 #[cfg(feature = "full")]
359 fn fold_item(&mut self, i
: Item
) -> Item
{
362 #[cfg(feature = "full")]
363 fn fold_item_const(&mut self, i
: ItemConst
) -> ItemConst
{
364 fold_item_const(self, i
)
366 #[cfg(feature = "full")]
367 fn fold_item_enum(&mut self, i
: ItemEnum
) -> ItemEnum
{
368 fold_item_enum(self, i
)
370 #[cfg(feature = "full")]
371 fn fold_item_extern_crate(&mut self, i
: ItemExternCrate
) -> ItemExternCrate
{
372 fold_item_extern_crate(self, i
)
374 #[cfg(feature = "full")]
375 fn fold_item_fn(&mut self, i
: ItemFn
) -> ItemFn
{
376 fold_item_fn(self, i
)
378 #[cfg(feature = "full")]
379 fn fold_item_foreign_mod(&mut self, i
: ItemForeignMod
) -> ItemForeignMod
{
380 fold_item_foreign_mod(self, i
)
382 #[cfg(feature = "full")]
383 fn fold_item_impl(&mut self, i
: ItemImpl
) -> ItemImpl
{
384 fold_item_impl(self, i
)
386 #[cfg(feature = "full")]
387 fn fold_item_macro(&mut self, i
: ItemMacro
) -> ItemMacro
{
388 fold_item_macro(self, i
)
390 #[cfg(feature = "full")]
391 fn fold_item_macro2(&mut self, i
: ItemMacro2
) -> ItemMacro2
{
392 fold_item_macro2(self, i
)
394 #[cfg(feature = "full")]
395 fn fold_item_mod(&mut self, i
: ItemMod
) -> ItemMod
{
396 fold_item_mod(self, i
)
398 #[cfg(feature = "full")]
399 fn fold_item_static(&mut self, i
: ItemStatic
) -> ItemStatic
{
400 fold_item_static(self, i
)
402 #[cfg(feature = "full")]
403 fn fold_item_struct(&mut self, i
: ItemStruct
) -> ItemStruct
{
404 fold_item_struct(self, i
)
406 #[cfg(feature = "full")]
407 fn fold_item_trait(&mut self, i
: ItemTrait
) -> ItemTrait
{
408 fold_item_trait(self, i
)
410 #[cfg(feature = "full")]
411 fn fold_item_trait_alias(&mut self, i
: ItemTraitAlias
) -> ItemTraitAlias
{
412 fold_item_trait_alias(self, i
)
414 #[cfg(feature = "full")]
415 fn fold_item_type(&mut self, i
: ItemType
) -> ItemType
{
416 fold_item_type(self, i
)
418 #[cfg(feature = "full")]
419 fn fold_item_union(&mut self, i
: ItemUnion
) -> ItemUnion
{
420 fold_item_union(self, i
)
422 #[cfg(feature = "full")]
423 fn fold_item_use(&mut self, i
: ItemUse
) -> ItemUse
{
424 fold_item_use(self, i
)
426 #[cfg(feature = "full")]
427 fn fold_label(&mut self, i
: Label
) -> Label
{
430 fn fold_lifetime(&mut self, i
: Lifetime
) -> Lifetime
{
431 fold_lifetime(self, i
)
433 #[cfg(any(feature = "derive", feature = "full"))]
434 fn fold_lifetime_def(&mut self, i
: LifetimeDef
) -> LifetimeDef
{
435 fold_lifetime_def(self, i
)
437 fn fold_lit(&mut self, i
: Lit
) -> Lit
{
440 fn fold_lit_bool(&mut self, i
: LitBool
) -> LitBool
{
441 fold_lit_bool(self, i
)
443 fn fold_lit_byte(&mut self, i
: LitByte
) -> LitByte
{
444 fold_lit_byte(self, i
)
446 fn fold_lit_byte_str(&mut self, i
: LitByteStr
) -> LitByteStr
{
447 fold_lit_byte_str(self, i
)
449 fn fold_lit_char(&mut self, i
: LitChar
) -> LitChar
{
450 fold_lit_char(self, i
)
452 fn fold_lit_float(&mut self, i
: LitFloat
) -> LitFloat
{
453 fold_lit_float(self, i
)
455 fn fold_lit_int(&mut self, i
: LitInt
) -> LitInt
{
456 fold_lit_int(self, i
)
458 fn fold_lit_str(&mut self, i
: LitStr
) -> LitStr
{
459 fold_lit_str(self, i
)
461 #[cfg(feature = "full")]
462 fn fold_local(&mut self, i
: Local
) -> Local
{
465 #[cfg(any(feature = "derive", feature = "full"))]
466 fn fold_macro(&mut self, i
: Macro
) -> Macro
{
469 #[cfg(any(feature = "derive", feature = "full"))]
470 fn fold_macro_delimiter(&mut self, i
: MacroDelimiter
) -> MacroDelimiter
{
471 fold_macro_delimiter(self, i
)
473 #[cfg(any(feature = "derive", feature = "full"))]
474 fn fold_member(&mut self, i
: Member
) -> Member
{
477 #[cfg(any(feature = "derive", feature = "full"))]
478 fn fold_meta(&mut self, i
: Meta
) -> Meta
{
481 #[cfg(any(feature = "derive", feature = "full"))]
482 fn fold_meta_list(&mut self, i
: MetaList
) -> MetaList
{
483 fold_meta_list(self, i
)
485 #[cfg(any(feature = "derive", feature = "full"))]
486 fn fold_meta_name_value(&mut self, i
: MetaNameValue
) -> MetaNameValue
{
487 fold_meta_name_value(self, i
)
489 #[cfg(feature = "full")]
490 fn fold_method_turbofish(&mut self, i
: MethodTurbofish
) -> MethodTurbofish
{
491 fold_method_turbofish(self, i
)
493 #[cfg(any(feature = "derive", feature = "full"))]
494 fn fold_nested_meta(&mut self, i
: NestedMeta
) -> NestedMeta
{
495 fold_nested_meta(self, i
)
497 #[cfg(any(feature = "derive", feature = "full"))]
498 fn fold_parenthesized_generic_arguments(
500 i
: ParenthesizedGenericArguments
,
501 ) -> ParenthesizedGenericArguments
{
502 fold_parenthesized_generic_arguments(self, i
)
504 #[cfg(feature = "full")]
505 fn fold_pat(&mut self, i
: Pat
) -> Pat
{
508 #[cfg(feature = "full")]
509 fn fold_pat_box(&mut self, i
: PatBox
) -> PatBox
{
510 fold_pat_box(self, i
)
512 #[cfg(feature = "full")]
513 fn fold_pat_ident(&mut self, i
: PatIdent
) -> PatIdent
{
514 fold_pat_ident(self, i
)
516 #[cfg(feature = "full")]
517 fn fold_pat_lit(&mut self, i
: PatLit
) -> PatLit
{
518 fold_pat_lit(self, i
)
520 #[cfg(feature = "full")]
521 fn fold_pat_macro(&mut self, i
: PatMacro
) -> PatMacro
{
522 fold_pat_macro(self, i
)
524 #[cfg(feature = "full")]
525 fn fold_pat_or(&mut self, i
: PatOr
) -> PatOr
{
528 #[cfg(feature = "full")]
529 fn fold_pat_path(&mut self, i
: PatPath
) -> PatPath
{
530 fold_pat_path(self, i
)
532 #[cfg(feature = "full")]
533 fn fold_pat_range(&mut self, i
: PatRange
) -> PatRange
{
534 fold_pat_range(self, i
)
536 #[cfg(feature = "full")]
537 fn fold_pat_reference(&mut self, i
: PatReference
) -> PatReference
{
538 fold_pat_reference(self, i
)
540 #[cfg(feature = "full")]
541 fn fold_pat_rest(&mut self, i
: PatRest
) -> PatRest
{
542 fold_pat_rest(self, i
)
544 #[cfg(feature = "full")]
545 fn fold_pat_slice(&mut self, i
: PatSlice
) -> PatSlice
{
546 fold_pat_slice(self, i
)
548 #[cfg(feature = "full")]
549 fn fold_pat_struct(&mut self, i
: PatStruct
) -> PatStruct
{
550 fold_pat_struct(self, i
)
552 #[cfg(feature = "full")]
553 fn fold_pat_tuple(&mut self, i
: PatTuple
) -> PatTuple
{
554 fold_pat_tuple(self, i
)
556 #[cfg(feature = "full")]
557 fn fold_pat_tuple_struct(&mut self, i
: PatTupleStruct
) -> PatTupleStruct
{
558 fold_pat_tuple_struct(self, i
)
560 #[cfg(feature = "full")]
561 fn fold_pat_type(&mut self, i
: PatType
) -> PatType
{
562 fold_pat_type(self, i
)
564 #[cfg(feature = "full")]
565 fn fold_pat_wild(&mut self, i
: PatWild
) -> PatWild
{
566 fold_pat_wild(self, i
)
568 #[cfg(any(feature = "derive", feature = "full"))]
569 fn fold_path(&mut self, i
: Path
) -> Path
{
572 #[cfg(any(feature = "derive", feature = "full"))]
573 fn fold_path_arguments(&mut self, i
: PathArguments
) -> PathArguments
{
574 fold_path_arguments(self, i
)
576 #[cfg(any(feature = "derive", feature = "full"))]
577 fn fold_path_segment(&mut self, i
: PathSegment
) -> PathSegment
{
578 fold_path_segment(self, i
)
580 #[cfg(any(feature = "derive", feature = "full"))]
581 fn fold_predicate_eq(&mut self, i
: PredicateEq
) -> PredicateEq
{
582 fold_predicate_eq(self, i
)
584 #[cfg(any(feature = "derive", feature = "full"))]
585 fn fold_predicate_lifetime(&mut self, i
: PredicateLifetime
) -> PredicateLifetime
{
586 fold_predicate_lifetime(self, i
)
588 #[cfg(any(feature = "derive", feature = "full"))]
589 fn fold_predicate_type(&mut self, i
: PredicateType
) -> PredicateType
{
590 fold_predicate_type(self, i
)
592 #[cfg(any(feature = "derive", feature = "full"))]
593 fn fold_qself(&mut self, i
: QSelf
) -> QSelf
{
596 #[cfg(feature = "full")]
597 fn fold_range_limits(&mut self, i
: RangeLimits
) -> RangeLimits
{
598 fold_range_limits(self, i
)
600 #[cfg(feature = "full")]
601 fn fold_receiver(&mut self, i
: Receiver
) -> Receiver
{
602 fold_receiver(self, i
)
604 #[cfg(any(feature = "derive", feature = "full"))]
605 fn fold_return_type(&mut self, i
: ReturnType
) -> ReturnType
{
606 fold_return_type(self, i
)
608 #[cfg(feature = "full")]
609 fn fold_signature(&mut self, i
: Signature
) -> Signature
{
610 fold_signature(self, i
)
612 fn fold_span(&mut self, i
: Span
) -> Span
{
615 #[cfg(feature = "full")]
616 fn fold_stmt(&mut self, i
: Stmt
) -> Stmt
{
619 #[cfg(any(feature = "derive", feature = "full"))]
620 fn fold_trait_bound(&mut self, i
: TraitBound
) -> TraitBound
{
621 fold_trait_bound(self, i
)
623 #[cfg(any(feature = "derive", feature = "full"))]
624 fn fold_trait_bound_modifier(&mut self, i
: TraitBoundModifier
) -> TraitBoundModifier
{
625 fold_trait_bound_modifier(self, i
)
627 #[cfg(feature = "full")]
628 fn fold_trait_item(&mut self, i
: TraitItem
) -> TraitItem
{
629 fold_trait_item(self, i
)
631 #[cfg(feature = "full")]
632 fn fold_trait_item_const(&mut self, i
: TraitItemConst
) -> TraitItemConst
{
633 fold_trait_item_const(self, i
)
635 #[cfg(feature = "full")]
636 fn fold_trait_item_macro(&mut self, i
: TraitItemMacro
) -> TraitItemMacro
{
637 fold_trait_item_macro(self, i
)
639 #[cfg(feature = "full")]
640 fn fold_trait_item_method(&mut self, i
: TraitItemMethod
) -> TraitItemMethod
{
641 fold_trait_item_method(self, i
)
643 #[cfg(feature = "full")]
644 fn fold_trait_item_type(&mut self, i
: TraitItemType
) -> TraitItemType
{
645 fold_trait_item_type(self, i
)
647 #[cfg(any(feature = "derive", feature = "full"))]
648 fn fold_type(&mut self, i
: Type
) -> Type
{
651 #[cfg(any(feature = "derive", feature = "full"))]
652 fn fold_type_array(&mut self, i
: TypeArray
) -> TypeArray
{
653 fold_type_array(self, i
)
655 #[cfg(any(feature = "derive", feature = "full"))]
656 fn fold_type_bare_fn(&mut self, i
: TypeBareFn
) -> TypeBareFn
{
657 fold_type_bare_fn(self, i
)
659 #[cfg(any(feature = "derive", feature = "full"))]
660 fn fold_type_group(&mut self, i
: TypeGroup
) -> TypeGroup
{
661 fold_type_group(self, i
)
663 #[cfg(any(feature = "derive", feature = "full"))]
664 fn fold_type_impl_trait(&mut self, i
: TypeImplTrait
) -> TypeImplTrait
{
665 fold_type_impl_trait(self, i
)
667 #[cfg(any(feature = "derive", feature = "full"))]
668 fn fold_type_infer(&mut self, i
: TypeInfer
) -> TypeInfer
{
669 fold_type_infer(self, i
)
671 #[cfg(any(feature = "derive", feature = "full"))]
672 fn fold_type_macro(&mut self, i
: TypeMacro
) -> TypeMacro
{
673 fold_type_macro(self, i
)
675 #[cfg(any(feature = "derive", feature = "full"))]
676 fn fold_type_never(&mut self, i
: TypeNever
) -> TypeNever
{
677 fold_type_never(self, i
)
679 #[cfg(any(feature = "derive", feature = "full"))]
680 fn fold_type_param(&mut self, i
: TypeParam
) -> TypeParam
{
681 fold_type_param(self, i
)
683 #[cfg(any(feature = "derive", feature = "full"))]
684 fn fold_type_param_bound(&mut self, i
: TypeParamBound
) -> TypeParamBound
{
685 fold_type_param_bound(self, i
)
687 #[cfg(any(feature = "derive", feature = "full"))]
688 fn fold_type_paren(&mut self, i
: TypeParen
) -> TypeParen
{
689 fold_type_paren(self, i
)
691 #[cfg(any(feature = "derive", feature = "full"))]
692 fn fold_type_path(&mut self, i
: TypePath
) -> TypePath
{
693 fold_type_path(self, i
)
695 #[cfg(any(feature = "derive", feature = "full"))]
696 fn fold_type_ptr(&mut self, i
: TypePtr
) -> TypePtr
{
697 fold_type_ptr(self, i
)
699 #[cfg(any(feature = "derive", feature = "full"))]
700 fn fold_type_reference(&mut self, i
: TypeReference
) -> TypeReference
{
701 fold_type_reference(self, i
)
703 #[cfg(any(feature = "derive", feature = "full"))]
704 fn fold_type_slice(&mut self, i
: TypeSlice
) -> TypeSlice
{
705 fold_type_slice(self, i
)
707 #[cfg(any(feature = "derive", feature = "full"))]
708 fn fold_type_trait_object(&mut self, i
: TypeTraitObject
) -> TypeTraitObject
{
709 fold_type_trait_object(self, i
)
711 #[cfg(any(feature = "derive", feature = "full"))]
712 fn fold_type_tuple(&mut self, i
: TypeTuple
) -> TypeTuple
{
713 fold_type_tuple(self, i
)
715 #[cfg(any(feature = "derive", feature = "full"))]
716 fn fold_un_op(&mut self, i
: UnOp
) -> UnOp
{
719 #[cfg(feature = "full")]
720 fn fold_use_glob(&mut self, i
: UseGlob
) -> UseGlob
{
721 fold_use_glob(self, i
)
723 #[cfg(feature = "full")]
724 fn fold_use_group(&mut self, i
: UseGroup
) -> UseGroup
{
725 fold_use_group(self, i
)
727 #[cfg(feature = "full")]
728 fn fold_use_name(&mut self, i
: UseName
) -> UseName
{
729 fold_use_name(self, i
)
731 #[cfg(feature = "full")]
732 fn fold_use_path(&mut self, i
: UsePath
) -> UsePath
{
733 fold_use_path(self, i
)
735 #[cfg(feature = "full")]
736 fn fold_use_rename(&mut self, i
: UseRename
) -> UseRename
{
737 fold_use_rename(self, i
)
739 #[cfg(feature = "full")]
740 fn fold_use_tree(&mut self, i
: UseTree
) -> UseTree
{
741 fold_use_tree(self, i
)
743 #[cfg(any(feature = "derive", feature = "full"))]
744 fn fold_variadic(&mut self, i
: Variadic
) -> Variadic
{
745 fold_variadic(self, i
)
747 #[cfg(any(feature = "derive", feature = "full"))]
748 fn fold_variant(&mut self, i
: Variant
) -> Variant
{
749 fold_variant(self, i
)
751 #[cfg(any(feature = "derive", feature = "full"))]
752 fn fold_vis_crate(&mut self, i
: VisCrate
) -> VisCrate
{
753 fold_vis_crate(self, i
)
755 #[cfg(any(feature = "derive", feature = "full"))]
756 fn fold_vis_public(&mut self, i
: VisPublic
) -> VisPublic
{
757 fold_vis_public(self, i
)
759 #[cfg(any(feature = "derive", feature = "full"))]
760 fn fold_vis_restricted(&mut self, i
: VisRestricted
) -> VisRestricted
{
761 fold_vis_restricted(self, i
)
763 #[cfg(any(feature = "derive", feature = "full"))]
764 fn fold_visibility(&mut self, i
: Visibility
) -> Visibility
{
765 fold_visibility(self, i
)
767 #[cfg(any(feature = "derive", feature = "full"))]
768 fn fold_where_clause(&mut self, i
: WhereClause
) -> WhereClause
{
769 fold_where_clause(self, i
)
771 #[cfg(any(feature = "derive", feature = "full"))]
772 fn fold_where_predicate(&mut self, i
: WherePredicate
) -> WherePredicate
{
773 fold_where_predicate(self, i
)
776 #[cfg(any(feature = "derive", feature = "full"))]
777 pub fn fold_abi
<F
>(f
: &mut F
, node
: Abi
) -> Abi
782 extern_token
: Token
![extern](tokens_helper(f
, &node
.extern_token
.span
)),
783 name
: (node
.name
).map(|it
| f
.fold_lit_str(it
)),
786 #[cfg(any(feature = "derive", feature = "full"))]
787 pub fn fold_angle_bracketed_generic_arguments
<F
>(
789 node
: AngleBracketedGenericArguments
,
790 ) -> AngleBracketedGenericArguments
794 AngleBracketedGenericArguments
{
795 colon2_token
: (node
.colon2_token
).map(|it
| Token
! [ :: ](tokens_helper(f
, &it
.spans
))),
796 lt_token
: Token
! [ < ](tokens_helper(f
, &node
.lt_token
.spans
)),
797 args
: FoldHelper
::lift(node
.args
, |it
| f
.fold_generic_argument(it
)),
798 gt_token
: Token
! [ > ](tokens_helper(f
, &node
.gt_token
.spans
)),
801 #[cfg(feature = "full")]
802 pub fn fold_arm
<F
>(f
: &mut F
, node
: Arm
) -> Arm
807 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
808 pat
: f
.fold_pat(node
.pat
),
809 guard
: (node
.guard
).map(|it
| {
811 Token
![if](tokens_helper(f
, &(it
).0.span
)),
812 Box
::new(f
.fold_expr(*(it
).1)),
815 fat_arrow_token
: Token
! [ => ](tokens_helper(f
, &node
.fat_arrow_token
.spans
)),
816 body
: Box
::new(f
.fold_expr(*node
.body
)),
817 comma
: (node
.comma
).map(|it
| Token
! [ , ](tokens_helper(f
, &it
.spans
))),
820 #[cfg(any(feature = "derive", feature = "full"))]
821 pub fn fold_attr_style
<F
>(f
: &mut F
, node
: AttrStyle
) -> AttrStyle
826 AttrStyle
::Outer
=> AttrStyle
::Outer
,
827 AttrStyle
::Inner(_binding_0
) => {
828 AttrStyle
::Inner(Token
![!](tokens_helper(f
, &_binding_0
.spans
)))
832 #[cfg(any(feature = "derive", feature = "full"))]
833 pub fn fold_attribute
<F
>(f
: &mut F
, node
: Attribute
) -> Attribute
838 pound_token
: Token
! [ # ](tokens_helper(f, &node.pound_token.spans)),
839 style
: f
.fold_attr_style(node
.style
),
840 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
841 path
: f
.fold_path(node
.path
),
845 #[cfg(any(feature = "derive", feature = "full"))]
846 pub fn fold_bare_fn_arg
<F
>(f
: &mut F
, node
: BareFnArg
) -> BareFnArg
851 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
852 name
: (node
.name
).map(|it
| {
854 f
.fold_ident((it
).0),
855 Token
! [ : ](tokens_helper(f
, &(it
).1.spans
)),
858 ty
: f
.fold_type(node
.ty
),
861 #[cfg(any(feature = "derive", feature = "full"))]
862 pub fn fold_bin_op
<F
>(f
: &mut F
, node
: BinOp
) -> BinOp
867 BinOp
::Add(_binding_0
) => BinOp
::Add(Token
! [ + ](tokens_helper(f
, &_binding_0
.spans
))),
868 BinOp
::Sub(_binding_0
) => BinOp
::Sub(Token
! [ - ](tokens_helper(f
, &_binding_0
.spans
))),
869 BinOp
::Mul(_binding_0
) => BinOp
::Mul(Token
! [ * ](tokens_helper(f
, &_binding_0
.spans
))),
870 BinOp
::Div(_binding_0
) => BinOp
::Div(Token
! [ / ](tokens_helper(f
, &_binding_0
.spans
))),
871 BinOp
::Rem(_binding_0
) => BinOp
::Rem(Token
! [ % ](tokens_helper(f
, &_binding_0
.spans
))),
872 BinOp
::And(_binding_0
) => BinOp
::And(Token
! [ && ](tokens_helper(f
, &_binding_0
.spans
))),
873 BinOp
::Or(_binding_0
) => BinOp
::Or(Token
! [ || ](tokens_helper(f
, &_binding_0
.spans
))),
874 BinOp
::BitXor(_binding_0
) => {
875 BinOp
::BitXor(Token
! [ ^
](tokens_helper(f
, &_binding_0
.spans
)))
877 BinOp
::BitAnd(_binding_0
) => {
878 BinOp
::BitAnd(Token
! [ & ](tokens_helper(f
, &_binding_0
.spans
)))
880 BinOp
::BitOr(_binding_0
) => {
881 BinOp
::BitOr(Token
! [ | ](tokens_helper(f
, &_binding_0
.spans
)))
883 BinOp
::Shl(_binding_0
) => BinOp
::Shl(Token
! [ << ](tokens_helper(f
, &_binding_0
.spans
))),
884 BinOp
::Shr(_binding_0
) => BinOp
::Shr(Token
! [ >> ](tokens_helper(f
, &_binding_0
.spans
))),
885 BinOp
::Eq(_binding_0
) => BinOp
::Eq(Token
! [ == ](tokens_helper(f
, &_binding_0
.spans
))),
886 BinOp
::Lt(_binding_0
) => BinOp
::Lt(Token
! [ < ](tokens_helper(f
, &_binding_0
.spans
))),
887 BinOp
::Le(_binding_0
) => BinOp
::Le(Token
! [ <= ](tokens_helper(f
, &_binding_0
.spans
))),
888 BinOp
::Ne(_binding_0
) => BinOp
::Ne(Token
! [ != ](tokens_helper(f
, &_binding_0
.spans
))),
889 BinOp
::Ge(_binding_0
) => BinOp
::Ge(Token
! [ >= ](tokens_helper(f
, &_binding_0
.spans
))),
890 BinOp
::Gt(_binding_0
) => BinOp
::Gt(Token
! [ > ](tokens_helper(f
, &_binding_0
.spans
))),
891 BinOp
::AddEq(_binding_0
) => {
892 BinOp
::AddEq(Token
! [ += ](tokens_helper(f
, &_binding_0
.spans
)))
894 BinOp
::SubEq(_binding_0
) => {
895 BinOp
::SubEq(Token
! [ -= ](tokens_helper(f
, &_binding_0
.spans
)))
897 BinOp
::MulEq(_binding_0
) => {
898 BinOp
::MulEq(Token
! [ *= ](tokens_helper(f
, &_binding_0
.spans
)))
900 BinOp
::DivEq(_binding_0
) => {
901 BinOp
::DivEq(Token
! [ /= ](tokens_helper(f
, &_binding_0
.spans
)))
903 BinOp
::RemEq(_binding_0
) => {
904 BinOp
::RemEq(Token
! [ %= ](tokens_helper(f
, &_binding_0
.spans
)))
906 BinOp
::BitXorEq(_binding_0
) => {
907 BinOp
::BitXorEq(Token
! [ ^
= ](tokens_helper(f
, &_binding_0
.spans
)))
909 BinOp
::BitAndEq(_binding_0
) => {
910 BinOp
::BitAndEq(Token
! [ &= ](tokens_helper(f
, &_binding_0
.spans
)))
912 BinOp
::BitOrEq(_binding_0
) => {
913 BinOp
::BitOrEq(Token
! [ |= ](tokens_helper(f
, &_binding_0
.spans
)))
915 BinOp
::ShlEq(_binding_0
) => {
916 BinOp
::ShlEq(Token
! [ <<= ](tokens_helper(f
, &_binding_0
.spans
)))
918 BinOp
::ShrEq(_binding_0
) => {
919 BinOp
::ShrEq(Token
! [ >>= ](tokens_helper(f
, &_binding_0
.spans
)))
923 #[cfg(any(feature = "derive", feature = "full"))]
924 pub fn fold_binding
<F
>(f
: &mut F
, node
: Binding
) -> Binding
929 ident
: f
.fold_ident(node
.ident
),
930 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
931 ty
: f
.fold_type(node
.ty
),
934 #[cfg(feature = "full")]
935 pub fn fold_block
<F
>(f
: &mut F
, node
: Block
) -> Block
940 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
941 stmts
: FoldHelper
::lift(node
.stmts
, |it
| f
.fold_stmt(it
)),
944 #[cfg(any(feature = "derive", feature = "full"))]
945 pub fn fold_bound_lifetimes
<F
>(f
: &mut F
, node
: BoundLifetimes
) -> BoundLifetimes
950 for_token
: Token
![for](tokens_helper(f
, &node
.for_token
.span
)),
951 lt_token
: Token
! [ < ](tokens_helper(f
, &node
.lt_token
.spans
)),
952 lifetimes
: FoldHelper
::lift(node
.lifetimes
, |it
| f
.fold_lifetime_def(it
)),
953 gt_token
: Token
! [ > ](tokens_helper(f
, &node
.gt_token
.spans
)),
956 #[cfg(any(feature = "derive", feature = "full"))]
957 pub fn fold_const_param
<F
>(f
: &mut F
, node
: ConstParam
) -> ConstParam
962 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
963 const_token
: Token
![const](tokens_helper(f
, &node
.const_token
.span
)),
964 ident
: f
.fold_ident(node
.ident
),
965 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
966 ty
: f
.fold_type(node
.ty
),
967 eq_token
: (node
.eq_token
).map(|it
| Token
! [ = ](tokens_helper(f
, &it
.spans
))),
968 default: (node
.default).map(|it
| f
.fold_expr(it
)),
971 #[cfg(any(feature = "derive", feature = "full"))]
972 pub fn fold_constraint
<F
>(f
: &mut F
, node
: Constraint
) -> Constraint
977 ident
: f
.fold_ident(node
.ident
),
978 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
979 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
982 #[cfg(feature = "derive")]
983 pub fn fold_data
<F
>(f
: &mut F
, node
: Data
) -> Data
988 Data
::Struct(_binding_0
) => Data
::Struct(f
.fold_data_struct(_binding_0
)),
989 Data
::Enum(_binding_0
) => Data
::Enum(f
.fold_data_enum(_binding_0
)),
990 Data
::Union(_binding_0
) => Data
::Union(f
.fold_data_union(_binding_0
)),
993 #[cfg(feature = "derive")]
994 pub fn fold_data_enum
<F
>(f
: &mut F
, node
: DataEnum
) -> DataEnum
999 enum_token
: Token
![enum](tokens_helper(f
, &node
.enum_token
.span
)),
1000 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1001 variants
: FoldHelper
::lift(node
.variants
, |it
| f
.fold_variant(it
)),
1004 #[cfg(feature = "derive")]
1005 pub fn fold_data_struct
<F
>(f
: &mut F
, node
: DataStruct
) -> DataStruct
1010 struct_token
: Token
![struct](tokens_helper(f
, &node
.struct_token
.span
)),
1011 fields
: f
.fold_fields(node
.fields
),
1012 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
1015 #[cfg(feature = "derive")]
1016 pub fn fold_data_union
<F
>(f
: &mut F
, node
: DataUnion
) -> DataUnion
1021 union_token
: Token
![union](tokens_helper(f
, &node
.union_token
.span
)),
1022 fields
: f
.fold_fields_named(node
.fields
),
1025 #[cfg(feature = "derive")]
1026 pub fn fold_derive_input
<F
>(f
: &mut F
, node
: DeriveInput
) -> DeriveInput
1031 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1032 vis
: f
.fold_visibility(node
.vis
),
1033 ident
: f
.fold_ident(node
.ident
),
1034 generics
: f
.fold_generics(node
.generics
),
1035 data
: f
.fold_data(node
.data
),
1038 #[cfg(any(feature = "derive", feature = "full"))]
1039 pub fn fold_expr
<F
>(f
: &mut F
, node
: Expr
) -> Expr
1044 Expr
::Array(_binding_0
) => Expr
::Array(full
!(f
.fold_expr_array(_binding_0
))),
1045 Expr
::Assign(_binding_0
) => Expr
::Assign(full
!(f
.fold_expr_assign(_binding_0
))),
1046 Expr
::AssignOp(_binding_0
) => Expr
::AssignOp(full
!(f
.fold_expr_assign_op(_binding_0
))),
1047 Expr
::Async(_binding_0
) => Expr
::Async(full
!(f
.fold_expr_async(_binding_0
))),
1048 Expr
::Await(_binding_0
) => Expr
::Await(full
!(f
.fold_expr_await(_binding_0
))),
1049 Expr
::Binary(_binding_0
) => Expr
::Binary(f
.fold_expr_binary(_binding_0
)),
1050 Expr
::Block(_binding_0
) => Expr
::Block(full
!(f
.fold_expr_block(_binding_0
))),
1051 Expr
::Box(_binding_0
) => Expr
::Box(full
!(f
.fold_expr_box(_binding_0
))),
1052 Expr
::Break(_binding_0
) => Expr
::Break(full
!(f
.fold_expr_break(_binding_0
))),
1053 Expr
::Call(_binding_0
) => Expr
::Call(f
.fold_expr_call(_binding_0
)),
1054 Expr
::Cast(_binding_0
) => Expr
::Cast(f
.fold_expr_cast(_binding_0
)),
1055 Expr
::Closure(_binding_0
) => Expr
::Closure(full
!(f
.fold_expr_closure(_binding_0
))),
1056 Expr
::Continue(_binding_0
) => Expr
::Continue(full
!(f
.fold_expr_continue(_binding_0
))),
1057 Expr
::Field(_binding_0
) => Expr
::Field(f
.fold_expr_field(_binding_0
)),
1058 Expr
::ForLoop(_binding_0
) => Expr
::ForLoop(full
!(f
.fold_expr_for_loop(_binding_0
))),
1059 Expr
::Group(_binding_0
) => Expr
::Group(full
!(f
.fold_expr_group(_binding_0
))),
1060 Expr
::If(_binding_0
) => Expr
::If(full
!(f
.fold_expr_if(_binding_0
))),
1061 Expr
::Index(_binding_0
) => Expr
::Index(f
.fold_expr_index(_binding_0
)),
1062 Expr
::Let(_binding_0
) => Expr
::Let(full
!(f
.fold_expr_let(_binding_0
))),
1063 Expr
::Lit(_binding_0
) => Expr
::Lit(f
.fold_expr_lit(_binding_0
)),
1064 Expr
::Loop(_binding_0
) => Expr
::Loop(full
!(f
.fold_expr_loop(_binding_0
))),
1065 Expr
::Macro(_binding_0
) => Expr
::Macro(full
!(f
.fold_expr_macro(_binding_0
))),
1066 Expr
::Match(_binding_0
) => Expr
::Match(full
!(f
.fold_expr_match(_binding_0
))),
1067 Expr
::MethodCall(_binding_0
) => {
1068 Expr
::MethodCall(full
!(f
.fold_expr_method_call(_binding_0
)))
1070 Expr
::Paren(_binding_0
) => Expr
::Paren(f
.fold_expr_paren(_binding_0
)),
1071 Expr
::Path(_binding_0
) => Expr
::Path(f
.fold_expr_path(_binding_0
)),
1072 Expr
::Range(_binding_0
) => Expr
::Range(full
!(f
.fold_expr_range(_binding_0
))),
1073 Expr
::Reference(_binding_0
) => Expr
::Reference(full
!(f
.fold_expr_reference(_binding_0
))),
1074 Expr
::Repeat(_binding_0
) => Expr
::Repeat(full
!(f
.fold_expr_repeat(_binding_0
))),
1075 Expr
::Return(_binding_0
) => Expr
::Return(full
!(f
.fold_expr_return(_binding_0
))),
1076 Expr
::Struct(_binding_0
) => Expr
::Struct(full
!(f
.fold_expr_struct(_binding_0
))),
1077 Expr
::Try(_binding_0
) => Expr
::Try(full
!(f
.fold_expr_try(_binding_0
))),
1078 Expr
::TryBlock(_binding_0
) => Expr
::TryBlock(full
!(f
.fold_expr_try_block(_binding_0
))),
1079 Expr
::Tuple(_binding_0
) => Expr
::Tuple(full
!(f
.fold_expr_tuple(_binding_0
))),
1080 Expr
::Type(_binding_0
) => Expr
::Type(full
!(f
.fold_expr_type(_binding_0
))),
1081 Expr
::Unary(_binding_0
) => Expr
::Unary(f
.fold_expr_unary(_binding_0
)),
1082 Expr
::Unsafe(_binding_0
) => Expr
::Unsafe(full
!(f
.fold_expr_unsafe(_binding_0
))),
1083 Expr
::Verbatim(_binding_0
) => Expr
::Verbatim(_binding_0
),
1084 Expr
::While(_binding_0
) => Expr
::While(full
!(f
.fold_expr_while(_binding_0
))),
1085 Expr
::Yield(_binding_0
) => Expr
::Yield(full
!(f
.fold_expr_yield(_binding_0
))),
1086 _
=> unreachable
!(),
1089 #[cfg(feature = "full")]
1090 pub fn fold_expr_array
<F
>(f
: &mut F
, node
: ExprArray
) -> ExprArray
1095 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1096 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
1097 elems
: FoldHelper
::lift(node
.elems
, |it
| f
.fold_expr(it
)),
1100 #[cfg(feature = "full")]
1101 pub fn fold_expr_assign
<F
>(f
: &mut F
, node
: ExprAssign
) -> ExprAssign
1106 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1107 left
: Box
::new(f
.fold_expr(*node
.left
)),
1108 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
1109 right
: Box
::new(f
.fold_expr(*node
.right
)),
1112 #[cfg(feature = "full")]
1113 pub fn fold_expr_assign_op
<F
>(f
: &mut F
, node
: ExprAssignOp
) -> ExprAssignOp
1118 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1119 left
: Box
::new(f
.fold_expr(*node
.left
)),
1120 op
: f
.fold_bin_op(node
.op
),
1121 right
: Box
::new(f
.fold_expr(*node
.right
)),
1124 #[cfg(feature = "full")]
1125 pub fn fold_expr_async
<F
>(f
: &mut F
, node
: ExprAsync
) -> ExprAsync
1130 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1131 async_token
: Token
![async
](tokens_helper(f
, &node
.async_token
.span
)),
1132 capture
: (node
.capture
).map(|it
| Token
![move](tokens_helper(f
, &it
.span
))),
1133 block
: f
.fold_block(node
.block
),
1136 #[cfg(feature = "full")]
1137 pub fn fold_expr_await
<F
>(f
: &mut F
, node
: ExprAwait
) -> ExprAwait
1142 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1143 base
: Box
::new(f
.fold_expr(*node
.base
)),
1144 dot_token
: Token
! [ . ](tokens_helper(f
, &node
.dot_token
.spans
)),
1145 await_token
: crate::token
::Await(tokens_helper(f
, &node
.await_token
.span
)),
1148 #[cfg(any(feature = "derive", feature = "full"))]
1149 pub fn fold_expr_binary
<F
>(f
: &mut F
, node
: ExprBinary
) -> ExprBinary
1154 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1155 left
: Box
::new(f
.fold_expr(*node
.left
)),
1156 op
: f
.fold_bin_op(node
.op
),
1157 right
: Box
::new(f
.fold_expr(*node
.right
)),
1160 #[cfg(feature = "full")]
1161 pub fn fold_expr_block
<F
>(f
: &mut F
, node
: ExprBlock
) -> ExprBlock
1166 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1167 label
: (node
.label
).map(|it
| f
.fold_label(it
)),
1168 block
: f
.fold_block(node
.block
),
1171 #[cfg(feature = "full")]
1172 pub fn fold_expr_box
<F
>(f
: &mut F
, node
: ExprBox
) -> ExprBox
1177 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1178 box_token
: Token
![box](tokens_helper(f
, &node
.box_token
.span
)),
1179 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1182 #[cfg(feature = "full")]
1183 pub fn fold_expr_break
<F
>(f
: &mut F
, node
: ExprBreak
) -> ExprBreak
1188 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1189 break_token
: Token
![break](tokens_helper(f
, &node
.break_token
.span
)),
1190 label
: (node
.label
).map(|it
| f
.fold_lifetime(it
)),
1191 expr
: (node
.expr
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1194 #[cfg(any(feature = "derive", feature = "full"))]
1195 pub fn fold_expr_call
<F
>(f
: &mut F
, node
: ExprCall
) -> ExprCall
1200 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1201 func
: Box
::new(f
.fold_expr(*node
.func
)),
1202 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
1203 args
: FoldHelper
::lift(node
.args
, |it
| f
.fold_expr(it
)),
1206 #[cfg(any(feature = "derive", feature = "full"))]
1207 pub fn fold_expr_cast
<F
>(f
: &mut F
, node
: ExprCast
) -> ExprCast
1212 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1213 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1214 as_token
: Token
![as](tokens_helper(f
, &node
.as_token
.span
)),
1215 ty
: Box
::new(f
.fold_type(*node
.ty
)),
1218 #[cfg(feature = "full")]
1219 pub fn fold_expr_closure
<F
>(f
: &mut F
, node
: ExprClosure
) -> ExprClosure
1224 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1225 asyncness
: (node
.asyncness
).map(|it
| Token
![async
](tokens_helper(f
, &it
.span
))),
1226 movability
: (node
.movability
).map(|it
| Token
![static](tokens_helper(f
, &it
.span
))),
1227 capture
: (node
.capture
).map(|it
| Token
![move](tokens_helper(f
, &it
.span
))),
1228 or1_token
: Token
! [ | ](tokens_helper(f
, &node
.or1_token
.spans
)),
1229 inputs
: FoldHelper
::lift(node
.inputs
, |it
| f
.fold_pat(it
)),
1230 or2_token
: Token
! [ | ](tokens_helper(f
, &node
.or2_token
.spans
)),
1231 output
: f
.fold_return_type(node
.output
),
1232 body
: Box
::new(f
.fold_expr(*node
.body
)),
1235 #[cfg(feature = "full")]
1236 pub fn fold_expr_continue
<F
>(f
: &mut F
, node
: ExprContinue
) -> ExprContinue
1241 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1242 continue_token
: Token
![continue](tokens_helper(f
, &node
.continue_token
.span
)),
1243 label
: (node
.label
).map(|it
| f
.fold_lifetime(it
)),
1246 #[cfg(any(feature = "derive", feature = "full"))]
1247 pub fn fold_expr_field
<F
>(f
: &mut F
, node
: ExprField
) -> ExprField
1252 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1253 base
: Box
::new(f
.fold_expr(*node
.base
)),
1254 dot_token
: Token
! [ . ](tokens_helper(f
, &node
.dot_token
.spans
)),
1255 member
: f
.fold_member(node
.member
),
1258 #[cfg(feature = "full")]
1259 pub fn fold_expr_for_loop
<F
>(f
: &mut F
, node
: ExprForLoop
) -> ExprForLoop
1264 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1265 label
: (node
.label
).map(|it
| f
.fold_label(it
)),
1266 for_token
: Token
![for](tokens_helper(f
, &node
.for_token
.span
)),
1267 pat
: f
.fold_pat(node
.pat
),
1268 in_token
: Token
![in](tokens_helper(f
, &node
.in_token
.span
)),
1269 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1270 body
: f
.fold_block(node
.body
),
1273 #[cfg(feature = "full")]
1274 pub fn fold_expr_group
<F
>(f
: &mut F
, node
: ExprGroup
) -> ExprGroup
1279 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1280 group_token
: Group(tokens_helper(f
, &node
.group_token
.span
)),
1281 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1284 #[cfg(feature = "full")]
1285 pub fn fold_expr_if
<F
>(f
: &mut F
, node
: ExprIf
) -> ExprIf
1290 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1291 if_token
: Token
![if](tokens_helper(f
, &node
.if_token
.span
)),
1292 cond
: Box
::new(f
.fold_expr(*node
.cond
)),
1293 then_branch
: f
.fold_block(node
.then_branch
),
1294 else_branch
: (node
.else_branch
).map(|it
| {
1296 Token
![else](tokens_helper(f
, &(it
).0.span
)),
1297 Box
::new(f
.fold_expr(*(it
).1)),
1302 #[cfg(any(feature = "derive", feature = "full"))]
1303 pub fn fold_expr_index
<F
>(f
: &mut F
, node
: ExprIndex
) -> ExprIndex
1308 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1309 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1310 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
1311 index
: Box
::new(f
.fold_expr(*node
.index
)),
1314 #[cfg(feature = "full")]
1315 pub fn fold_expr_let
<F
>(f
: &mut F
, node
: ExprLet
) -> ExprLet
1320 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1321 let_token
: Token
![let](tokens_helper(f
, &node
.let_token
.span
)),
1322 pat
: f
.fold_pat(node
.pat
),
1323 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
1324 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1327 #[cfg(any(feature = "derive", feature = "full"))]
1328 pub fn fold_expr_lit
<F
>(f
: &mut F
, node
: ExprLit
) -> ExprLit
1333 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1334 lit
: f
.fold_lit(node
.lit
),
1337 #[cfg(feature = "full")]
1338 pub fn fold_expr_loop
<F
>(f
: &mut F
, node
: ExprLoop
) -> ExprLoop
1343 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1344 label
: (node
.label
).map(|it
| f
.fold_label(it
)),
1345 loop_token
: Token
![loop](tokens_helper(f
, &node
.loop_token
.span
)),
1346 body
: f
.fold_block(node
.body
),
1349 #[cfg(feature = "full")]
1350 pub fn fold_expr_macro
<F
>(f
: &mut F
, node
: ExprMacro
) -> ExprMacro
1355 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1356 mac
: f
.fold_macro(node
.mac
),
1359 #[cfg(feature = "full")]
1360 pub fn fold_expr_match
<F
>(f
: &mut F
, node
: ExprMatch
) -> ExprMatch
1365 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1366 match_token
: Token
![match](tokens_helper(f
, &node
.match_token
.span
)),
1367 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1368 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1369 arms
: FoldHelper
::lift(node
.arms
, |it
| f
.fold_arm(it
)),
1372 #[cfg(feature = "full")]
1373 pub fn fold_expr_method_call
<F
>(f
: &mut F
, node
: ExprMethodCall
) -> ExprMethodCall
1378 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1379 receiver
: Box
::new(f
.fold_expr(*node
.receiver
)),
1380 dot_token
: Token
! [ . ](tokens_helper(f
, &node
.dot_token
.spans
)),
1381 method
: f
.fold_ident(node
.method
),
1382 turbofish
: (node
.turbofish
).map(|it
| f
.fold_method_turbofish(it
)),
1383 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
1384 args
: FoldHelper
::lift(node
.args
, |it
| f
.fold_expr(it
)),
1387 #[cfg(any(feature = "derive", feature = "full"))]
1388 pub fn fold_expr_paren
<F
>(f
: &mut F
, node
: ExprParen
) -> ExprParen
1393 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1394 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
1395 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1398 #[cfg(any(feature = "derive", feature = "full"))]
1399 pub fn fold_expr_path
<F
>(f
: &mut F
, node
: ExprPath
) -> ExprPath
1404 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1405 qself
: (node
.qself
).map(|it
| f
.fold_qself(it
)),
1406 path
: f
.fold_path(node
.path
),
1409 #[cfg(feature = "full")]
1410 pub fn fold_expr_range
<F
>(f
: &mut F
, node
: ExprRange
) -> ExprRange
1415 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1416 from
: (node
.from
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1417 limits
: f
.fold_range_limits(node
.limits
),
1418 to
: (node
.to
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1421 #[cfg(feature = "full")]
1422 pub fn fold_expr_reference
<F
>(f
: &mut F
, node
: ExprReference
) -> ExprReference
1427 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1428 and_token
: Token
! [ & ](tokens_helper(f
, &node
.and_token
.spans
)),
1430 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
1431 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1434 #[cfg(feature = "full")]
1435 pub fn fold_expr_repeat
<F
>(f
: &mut F
, node
: ExprRepeat
) -> ExprRepeat
1440 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1441 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
1442 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1443 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1444 len
: Box
::new(f
.fold_expr(*node
.len
)),
1447 #[cfg(feature = "full")]
1448 pub fn fold_expr_return
<F
>(f
: &mut F
, node
: ExprReturn
) -> ExprReturn
1453 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1454 return_token
: Token
![return](tokens_helper(f
, &node
.return_token
.span
)),
1455 expr
: (node
.expr
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1458 #[cfg(feature = "full")]
1459 pub fn fold_expr_struct
<F
>(f
: &mut F
, node
: ExprStruct
) -> ExprStruct
1464 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1465 path
: f
.fold_path(node
.path
),
1466 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1467 fields
: FoldHelper
::lift(node
.fields
, |it
| f
.fold_field_value(it
)),
1468 dot2_token
: (node
.dot2_token
).map(|it
| Token
![..](tokens_helper(f
, &it
.spans
))),
1469 rest
: (node
.rest
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1472 #[cfg(feature = "full")]
1473 pub fn fold_expr_try
<F
>(f
: &mut F
, node
: ExprTry
) -> ExprTry
1478 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1479 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1480 question_token
: Token
! [ ?
](tokens_helper(f
, &node
.question_token
.spans
)),
1483 #[cfg(feature = "full")]
1484 pub fn fold_expr_try_block
<F
>(f
: &mut F
, node
: ExprTryBlock
) -> ExprTryBlock
1489 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1490 try_token
: Token
![try
](tokens_helper(f
, &node
.try_token
.span
)),
1491 block
: f
.fold_block(node
.block
),
1494 #[cfg(feature = "full")]
1495 pub fn fold_expr_tuple
<F
>(f
: &mut F
, node
: ExprTuple
) -> ExprTuple
1500 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1501 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
1502 elems
: FoldHelper
::lift(node
.elems
, |it
| f
.fold_expr(it
)),
1505 #[cfg(feature = "full")]
1506 pub fn fold_expr_type
<F
>(f
: &mut F
, node
: ExprType
) -> ExprType
1511 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1512 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1513 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
1514 ty
: Box
::new(f
.fold_type(*node
.ty
)),
1517 #[cfg(any(feature = "derive", feature = "full"))]
1518 pub fn fold_expr_unary
<F
>(f
: &mut F
, node
: ExprUnary
) -> ExprUnary
1523 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1524 op
: f
.fold_un_op(node
.op
),
1525 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1528 #[cfg(feature = "full")]
1529 pub fn fold_expr_unsafe
<F
>(f
: &mut F
, node
: ExprUnsafe
) -> ExprUnsafe
1534 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1535 unsafe_token
: Token
![unsafe](tokens_helper(f
, &node
.unsafe_token
.span
)),
1536 block
: f
.fold_block(node
.block
),
1539 #[cfg(feature = "full")]
1540 pub fn fold_expr_while
<F
>(f
: &mut F
, node
: ExprWhile
) -> ExprWhile
1545 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1546 label
: (node
.label
).map(|it
| f
.fold_label(it
)),
1547 while_token
: Token
![while](tokens_helper(f
, &node
.while_token
.span
)),
1548 cond
: Box
::new(f
.fold_expr(*node
.cond
)),
1549 body
: f
.fold_block(node
.body
),
1552 #[cfg(feature = "full")]
1553 pub fn fold_expr_yield
<F
>(f
: &mut F
, node
: ExprYield
) -> ExprYield
1558 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1559 yield_token
: Token
![yield](tokens_helper(f
, &node
.yield_token
.span
)),
1560 expr
: (node
.expr
).map(|it
| Box
::new(f
.fold_expr(*it
))),
1563 #[cfg(any(feature = "derive", feature = "full"))]
1564 pub fn fold_field
<F
>(f
: &mut F
, node
: Field
) -> Field
1569 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1570 vis
: f
.fold_visibility(node
.vis
),
1571 ident
: (node
.ident
).map(|it
| f
.fold_ident(it
)),
1572 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
1573 ty
: f
.fold_type(node
.ty
),
1576 #[cfg(feature = "full")]
1577 pub fn fold_field_pat
<F
>(f
: &mut F
, node
: FieldPat
) -> FieldPat
1582 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1583 member
: f
.fold_member(node
.member
),
1584 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
1585 pat
: Box
::new(f
.fold_pat(*node
.pat
)),
1588 #[cfg(feature = "full")]
1589 pub fn fold_field_value
<F
>(f
: &mut F
, node
: FieldValue
) -> FieldValue
1594 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1595 member
: f
.fold_member(node
.member
),
1596 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
1597 expr
: f
.fold_expr(node
.expr
),
1600 #[cfg(any(feature = "derive", feature = "full"))]
1601 pub fn fold_fields
<F
>(f
: &mut F
, node
: Fields
) -> Fields
1606 Fields
::Named(_binding_0
) => Fields
::Named(f
.fold_fields_named(_binding_0
)),
1607 Fields
::Unnamed(_binding_0
) => Fields
::Unnamed(f
.fold_fields_unnamed(_binding_0
)),
1608 Fields
::Unit
=> Fields
::Unit
,
1611 #[cfg(any(feature = "derive", feature = "full"))]
1612 pub fn fold_fields_named
<F
>(f
: &mut F
, node
: FieldsNamed
) -> FieldsNamed
1617 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1618 named
: FoldHelper
::lift(node
.named
, |it
| f
.fold_field(it
)),
1621 #[cfg(any(feature = "derive", feature = "full"))]
1622 pub fn fold_fields_unnamed
<F
>(f
: &mut F
, node
: FieldsUnnamed
) -> FieldsUnnamed
1627 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
1628 unnamed
: FoldHelper
::lift(node
.unnamed
, |it
| f
.fold_field(it
)),
1631 #[cfg(feature = "full")]
1632 pub fn fold_file
<F
>(f
: &mut F
, node
: File
) -> File
1637 shebang
: node
.shebang
,
1638 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1639 items
: FoldHelper
::lift(node
.items
, |it
| f
.fold_item(it
)),
1642 #[cfg(feature = "full")]
1643 pub fn fold_fn_arg
<F
>(f
: &mut F
, node
: FnArg
) -> FnArg
1648 FnArg
::Receiver(_binding_0
) => FnArg
::Receiver(f
.fold_receiver(_binding_0
)),
1649 FnArg
::Typed(_binding_0
) => FnArg
::Typed(f
.fold_pat_type(_binding_0
)),
1652 #[cfg(feature = "full")]
1653 pub fn fold_foreign_item
<F
>(f
: &mut F
, node
: ForeignItem
) -> ForeignItem
1658 ForeignItem
::Fn(_binding_0
) => ForeignItem
::Fn(f
.fold_foreign_item_fn(_binding_0
)),
1659 ForeignItem
::Static(_binding_0
) => {
1660 ForeignItem
::Static(f
.fold_foreign_item_static(_binding_0
))
1662 ForeignItem
::Type(_binding_0
) => ForeignItem
::Type(f
.fold_foreign_item_type(_binding_0
)),
1663 ForeignItem
::Macro(_binding_0
) => ForeignItem
::Macro(f
.fold_foreign_item_macro(_binding_0
)),
1664 ForeignItem
::Verbatim(_binding_0
) => ForeignItem
::Verbatim(_binding_0
),
1665 _
=> unreachable
!(),
1668 #[cfg(feature = "full")]
1669 pub fn fold_foreign_item_fn
<F
>(f
: &mut F
, node
: ForeignItemFn
) -> ForeignItemFn
1674 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1675 vis
: f
.fold_visibility(node
.vis
),
1676 sig
: f
.fold_signature(node
.sig
),
1677 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1680 #[cfg(feature = "full")]
1681 pub fn fold_foreign_item_macro
<F
>(f
: &mut F
, node
: ForeignItemMacro
) -> ForeignItemMacro
1686 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1687 mac
: f
.fold_macro(node
.mac
),
1688 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
1691 #[cfg(feature = "full")]
1692 pub fn fold_foreign_item_static
<F
>(f
: &mut F
, node
: ForeignItemStatic
) -> ForeignItemStatic
1697 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1698 vis
: f
.fold_visibility(node
.vis
),
1699 static_token
: Token
![static](tokens_helper(f
, &node
.static_token
.span
)),
1700 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
1701 ident
: f
.fold_ident(node
.ident
),
1702 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
1703 ty
: Box
::new(f
.fold_type(*node
.ty
)),
1704 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1707 #[cfg(feature = "full")]
1708 pub fn fold_foreign_item_type
<F
>(f
: &mut F
, node
: ForeignItemType
) -> ForeignItemType
1713 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1714 vis
: f
.fold_visibility(node
.vis
),
1715 type_token
: Token
![type](tokens_helper(f
, &node
.type_token
.span
)),
1716 ident
: f
.fold_ident(node
.ident
),
1717 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1720 #[cfg(any(feature = "derive", feature = "full"))]
1721 pub fn fold_generic_argument
<F
>(f
: &mut F
, node
: GenericArgument
) -> GenericArgument
1726 GenericArgument
::Lifetime(_binding_0
) => {
1727 GenericArgument
::Lifetime(f
.fold_lifetime(_binding_0
))
1729 GenericArgument
::Type(_binding_0
) => GenericArgument
::Type(f
.fold_type(_binding_0
)),
1730 GenericArgument
::Binding(_binding_0
) => {
1731 GenericArgument
::Binding(f
.fold_binding(_binding_0
))
1733 GenericArgument
::Constraint(_binding_0
) => {
1734 GenericArgument
::Constraint(f
.fold_constraint(_binding_0
))
1736 GenericArgument
::Const(_binding_0
) => GenericArgument
::Const(f
.fold_expr(_binding_0
)),
1739 #[cfg(feature = "full")]
1740 pub fn fold_generic_method_argument
<F
>(
1742 node
: GenericMethodArgument
,
1743 ) -> GenericMethodArgument
1748 GenericMethodArgument
::Type(_binding_0
) => {
1749 GenericMethodArgument
::Type(f
.fold_type(_binding_0
))
1751 GenericMethodArgument
::Const(_binding_0
) => {
1752 GenericMethodArgument
::Const(f
.fold_expr(_binding_0
))
1756 #[cfg(any(feature = "derive", feature = "full"))]
1757 pub fn fold_generic_param
<F
>(f
: &mut F
, node
: GenericParam
) -> GenericParam
1762 GenericParam
::Type(_binding_0
) => GenericParam
::Type(f
.fold_type_param(_binding_0
)),
1763 GenericParam
::Lifetime(_binding_0
) => {
1764 GenericParam
::Lifetime(f
.fold_lifetime_def(_binding_0
))
1766 GenericParam
::Const(_binding_0
) => GenericParam
::Const(f
.fold_const_param(_binding_0
)),
1769 #[cfg(any(feature = "derive", feature = "full"))]
1770 pub fn fold_generics
<F
>(f
: &mut F
, node
: Generics
) -> Generics
1775 lt_token
: (node
.lt_token
).map(|it
| Token
! [ < ](tokens_helper(f
, &it
.spans
))),
1776 params
: FoldHelper
::lift(node
.params
, |it
| f
.fold_generic_param(it
)),
1777 gt_token
: (node
.gt_token
).map(|it
| Token
! [ > ](tokens_helper(f
, &it
.spans
))),
1778 where_clause
: (node
.where_clause
).map(|it
| f
.fold_where_clause(it
)),
1781 pub fn fold_ident
<F
>(f
: &mut F
, node
: Ident
) -> Ident
1785 let mut node
= node
;
1786 let span
= f
.fold_span(node
.span());
1787 node
.set_span(span
);
1790 #[cfg(feature = "full")]
1791 pub fn fold_impl_item
<F
>(f
: &mut F
, node
: ImplItem
) -> ImplItem
1796 ImplItem
::Const(_binding_0
) => ImplItem
::Const(f
.fold_impl_item_const(_binding_0
)),
1797 ImplItem
::Method(_binding_0
) => ImplItem
::Method(f
.fold_impl_item_method(_binding_0
)),
1798 ImplItem
::Type(_binding_0
) => ImplItem
::Type(f
.fold_impl_item_type(_binding_0
)),
1799 ImplItem
::Macro(_binding_0
) => ImplItem
::Macro(f
.fold_impl_item_macro(_binding_0
)),
1800 ImplItem
::Verbatim(_binding_0
) => ImplItem
::Verbatim(_binding_0
),
1801 _
=> unreachable
!(),
1804 #[cfg(feature = "full")]
1805 pub fn fold_impl_item_const
<F
>(f
: &mut F
, node
: ImplItemConst
) -> ImplItemConst
1810 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1811 vis
: f
.fold_visibility(node
.vis
),
1812 defaultness
: (node
.defaultness
).map(|it
| Token
![default](tokens_helper(f
, &it
.span
))),
1813 const_token
: Token
![const](tokens_helper(f
, &node
.const_token
.span
)),
1814 ident
: f
.fold_ident(node
.ident
),
1815 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
1816 ty
: f
.fold_type(node
.ty
),
1817 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
1818 expr
: f
.fold_expr(node
.expr
),
1819 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1822 #[cfg(feature = "full")]
1823 pub fn fold_impl_item_macro
<F
>(f
: &mut F
, node
: ImplItemMacro
) -> ImplItemMacro
1828 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1829 mac
: f
.fold_macro(node
.mac
),
1830 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
1833 #[cfg(feature = "full")]
1834 pub fn fold_impl_item_method
<F
>(f
: &mut F
, node
: ImplItemMethod
) -> ImplItemMethod
1839 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1840 vis
: f
.fold_visibility(node
.vis
),
1841 defaultness
: (node
.defaultness
).map(|it
| Token
![default](tokens_helper(f
, &it
.span
))),
1842 sig
: f
.fold_signature(node
.sig
),
1843 block
: f
.fold_block(node
.block
),
1846 #[cfg(feature = "full")]
1847 pub fn fold_impl_item_type
<F
>(f
: &mut F
, node
: ImplItemType
) -> ImplItemType
1852 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1853 vis
: f
.fold_visibility(node
.vis
),
1854 defaultness
: (node
.defaultness
).map(|it
| Token
![default](tokens_helper(f
, &it
.span
))),
1855 type_token
: Token
![type](tokens_helper(f
, &node
.type_token
.span
)),
1856 ident
: f
.fold_ident(node
.ident
),
1857 generics
: f
.fold_generics(node
.generics
),
1858 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
1859 ty
: f
.fold_type(node
.ty
),
1860 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1863 #[cfg(any(feature = "derive", feature = "full"))]
1864 pub fn fold_index
<F
>(f
: &mut F
, node
: Index
) -> Index
1870 span
: f
.fold_span(node
.span
),
1873 #[cfg(feature = "full")]
1874 pub fn fold_item
<F
>(f
: &mut F
, node
: Item
) -> Item
1879 Item
::Const(_binding_0
) => Item
::Const(f
.fold_item_const(_binding_0
)),
1880 Item
::Enum(_binding_0
) => Item
::Enum(f
.fold_item_enum(_binding_0
)),
1881 Item
::ExternCrate(_binding_0
) => Item
::ExternCrate(f
.fold_item_extern_crate(_binding_0
)),
1882 Item
::Fn(_binding_0
) => Item
::Fn(f
.fold_item_fn(_binding_0
)),
1883 Item
::ForeignMod(_binding_0
) => Item
::ForeignMod(f
.fold_item_foreign_mod(_binding_0
)),
1884 Item
::Impl(_binding_0
) => Item
::Impl(f
.fold_item_impl(_binding_0
)),
1885 Item
::Macro(_binding_0
) => Item
::Macro(f
.fold_item_macro(_binding_0
)),
1886 Item
::Macro2(_binding_0
) => Item
::Macro2(f
.fold_item_macro2(_binding_0
)),
1887 Item
::Mod(_binding_0
) => Item
::Mod(f
.fold_item_mod(_binding_0
)),
1888 Item
::Static(_binding_0
) => Item
::Static(f
.fold_item_static(_binding_0
)),
1889 Item
::Struct(_binding_0
) => Item
::Struct(f
.fold_item_struct(_binding_0
)),
1890 Item
::Trait(_binding_0
) => Item
::Trait(f
.fold_item_trait(_binding_0
)),
1891 Item
::TraitAlias(_binding_0
) => Item
::TraitAlias(f
.fold_item_trait_alias(_binding_0
)),
1892 Item
::Type(_binding_0
) => Item
::Type(f
.fold_item_type(_binding_0
)),
1893 Item
::Union(_binding_0
) => Item
::Union(f
.fold_item_union(_binding_0
)),
1894 Item
::Use(_binding_0
) => Item
::Use(f
.fold_item_use(_binding_0
)),
1895 Item
::Verbatim(_binding_0
) => Item
::Verbatim(_binding_0
),
1896 _
=> unreachable
!(),
1899 #[cfg(feature = "full")]
1900 pub fn fold_item_const
<F
>(f
: &mut F
, node
: ItemConst
) -> ItemConst
1905 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1906 vis
: f
.fold_visibility(node
.vis
),
1907 const_token
: Token
![const](tokens_helper(f
, &node
.const_token
.span
)),
1908 ident
: f
.fold_ident(node
.ident
),
1909 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
1910 ty
: Box
::new(f
.fold_type(*node
.ty
)),
1911 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
1912 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
1913 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1916 #[cfg(feature = "full")]
1917 pub fn fold_item_enum
<F
>(f
: &mut F
, node
: ItemEnum
) -> ItemEnum
1922 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1923 vis
: f
.fold_visibility(node
.vis
),
1924 enum_token
: Token
![enum](tokens_helper(f
, &node
.enum_token
.span
)),
1925 ident
: f
.fold_ident(node
.ident
),
1926 generics
: f
.fold_generics(node
.generics
),
1927 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1928 variants
: FoldHelper
::lift(node
.variants
, |it
| f
.fold_variant(it
)),
1931 #[cfg(feature = "full")]
1932 pub fn fold_item_extern_crate
<F
>(f
: &mut F
, node
: ItemExternCrate
) -> ItemExternCrate
1937 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1938 vis
: f
.fold_visibility(node
.vis
),
1939 extern_token
: Token
![extern](tokens_helper(f
, &node
.extern_token
.span
)),
1940 crate_token
: Token
![crate](tokens_helper(f
, &node
.crate_token
.span
)),
1941 ident
: f
.fold_ident(node
.ident
),
1942 rename
: (node
.rename
).map(|it
| {
1944 Token
![as](tokens_helper(f
, &(it
).0.span
)),
1945 f
.fold_ident((it
).1),
1948 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
1951 #[cfg(feature = "full")]
1952 pub fn fold_item_fn
<F
>(f
: &mut F
, node
: ItemFn
) -> ItemFn
1957 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1958 vis
: f
.fold_visibility(node
.vis
),
1959 sig
: f
.fold_signature(node
.sig
),
1960 block
: Box
::new(f
.fold_block(*node
.block
)),
1963 #[cfg(feature = "full")]
1964 pub fn fold_item_foreign_mod
<F
>(f
: &mut F
, node
: ItemForeignMod
) -> ItemForeignMod
1969 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1970 abi
: f
.fold_abi(node
.abi
),
1971 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1972 items
: FoldHelper
::lift(node
.items
, |it
| f
.fold_foreign_item(it
)),
1975 #[cfg(feature = "full")]
1976 pub fn fold_item_impl
<F
>(f
: &mut F
, node
: ItemImpl
) -> ItemImpl
1981 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
1982 defaultness
: (node
.defaultness
).map(|it
| Token
![default](tokens_helper(f
, &it
.span
))),
1983 unsafety
: (node
.unsafety
).map(|it
| Token
![unsafe](tokens_helper(f
, &it
.span
))),
1984 impl_token
: Token
![impl](tokens_helper(f
, &node
.impl_token
.span
)),
1985 generics
: f
.fold_generics(node
.generics
),
1986 trait_
: (node
.trait_
).map(|it
| {
1988 ((it
).0).map(|it
| Token
![!](tokens_helper(f
, &it
.spans
))),
1989 f
.fold_path((it
).1),
1990 Token
![for](tokens_helper(f
, &(it
).2.span
)),
1993 self_ty
: Box
::new(f
.fold_type(*node
.self_ty
)),
1994 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
1995 items
: FoldHelper
::lift(node
.items
, |it
| f
.fold_impl_item(it
)),
1998 #[cfg(feature = "full")]
1999 pub fn fold_item_macro
<F
>(f
: &mut F
, node
: ItemMacro
) -> ItemMacro
2004 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2005 ident
: (node
.ident
).map(|it
| f
.fold_ident(it
)),
2006 mac
: f
.fold_macro(node
.mac
),
2007 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
2010 #[cfg(feature = "full")]
2011 pub fn fold_item_macro2
<F
>(f
: &mut F
, node
: ItemMacro2
) -> ItemMacro2
2016 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2017 vis
: f
.fold_visibility(node
.vis
),
2018 macro_token
: Token
![macro](tokens_helper(f
, &node
.macro_token
.span
)),
2019 ident
: f
.fold_ident(node
.ident
),
2023 #[cfg(feature = "full")]
2024 pub fn fold_item_mod
<F
>(f
: &mut F
, node
: ItemMod
) -> ItemMod
2029 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2030 vis
: f
.fold_visibility(node
.vis
),
2031 mod_token
: Token
![mod](tokens_helper(f
, &node
.mod_token
.span
)),
2032 ident
: f
.fold_ident(node
.ident
),
2033 content
: (node
.content
).map(|it
| {
2035 Brace(tokens_helper(f
, &(it
).0.span
)),
2036 FoldHelper
::lift((it
).1, |it
| f
.fold_item(it
)),
2039 semi
: (node
.semi
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
2042 #[cfg(feature = "full")]
2043 pub fn fold_item_static
<F
>(f
: &mut F
, node
: ItemStatic
) -> ItemStatic
2048 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2049 vis
: f
.fold_visibility(node
.vis
),
2050 static_token
: Token
![static](tokens_helper(f
, &node
.static_token
.span
)),
2051 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
2052 ident
: f
.fold_ident(node
.ident
),
2053 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2054 ty
: Box
::new(f
.fold_type(*node
.ty
)),
2055 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
2056 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
2057 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2060 #[cfg(feature = "full")]
2061 pub fn fold_item_struct
<F
>(f
: &mut F
, node
: ItemStruct
) -> ItemStruct
2066 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2067 vis
: f
.fold_visibility(node
.vis
),
2068 struct_token
: Token
![struct](tokens_helper(f
, &node
.struct_token
.span
)),
2069 ident
: f
.fold_ident(node
.ident
),
2070 generics
: f
.fold_generics(node
.generics
),
2071 fields
: f
.fold_fields(node
.fields
),
2072 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
2075 #[cfg(feature = "full")]
2076 pub fn fold_item_trait
<F
>(f
: &mut F
, node
: ItemTrait
) -> ItemTrait
2081 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2082 vis
: f
.fold_visibility(node
.vis
),
2083 unsafety
: (node
.unsafety
).map(|it
| Token
![unsafe](tokens_helper(f
, &it
.span
))),
2084 auto_token
: (node
.auto_token
).map(|it
| Token
![auto](tokens_helper(f
, &it
.span
))),
2085 trait_token
: Token
![trait](tokens_helper(f
, &node
.trait_token
.span
)),
2086 ident
: f
.fold_ident(node
.ident
),
2087 generics
: f
.fold_generics(node
.generics
),
2088 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
2089 supertraits
: FoldHelper
::lift(node
.supertraits
, |it
| f
.fold_type_param_bound(it
)),
2090 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
2091 items
: FoldHelper
::lift(node
.items
, |it
| f
.fold_trait_item(it
)),
2094 #[cfg(feature = "full")]
2095 pub fn fold_item_trait_alias
<F
>(f
: &mut F
, node
: ItemTraitAlias
) -> ItemTraitAlias
2100 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2101 vis
: f
.fold_visibility(node
.vis
),
2102 trait_token
: Token
![trait](tokens_helper(f
, &node
.trait_token
.span
)),
2103 ident
: f
.fold_ident(node
.ident
),
2104 generics
: f
.fold_generics(node
.generics
),
2105 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
2106 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
2107 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2110 #[cfg(feature = "full")]
2111 pub fn fold_item_type
<F
>(f
: &mut F
, node
: ItemType
) -> ItemType
2116 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2117 vis
: f
.fold_visibility(node
.vis
),
2118 type_token
: Token
![type](tokens_helper(f
, &node
.type_token
.span
)),
2119 ident
: f
.fold_ident(node
.ident
),
2120 generics
: f
.fold_generics(node
.generics
),
2121 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
2122 ty
: Box
::new(f
.fold_type(*node
.ty
)),
2123 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2126 #[cfg(feature = "full")]
2127 pub fn fold_item_union
<F
>(f
: &mut F
, node
: ItemUnion
) -> ItemUnion
2132 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2133 vis
: f
.fold_visibility(node
.vis
),
2134 union_token
: Token
![union](tokens_helper(f
, &node
.union_token
.span
)),
2135 ident
: f
.fold_ident(node
.ident
),
2136 generics
: f
.fold_generics(node
.generics
),
2137 fields
: f
.fold_fields_named(node
.fields
),
2140 #[cfg(feature = "full")]
2141 pub fn fold_item_use
<F
>(f
: &mut F
, node
: ItemUse
) -> ItemUse
2146 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2147 vis
: f
.fold_visibility(node
.vis
),
2148 use_token
: Token
![use](tokens_helper(f
, &node
.use_token
.span
)),
2149 leading_colon
: (node
.leading_colon
).map(|it
| Token
! [ :: ](tokens_helper(f
, &it
.spans
))),
2150 tree
: f
.fold_use_tree(node
.tree
),
2151 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2154 #[cfg(feature = "full")]
2155 pub fn fold_label
<F
>(f
: &mut F
, node
: Label
) -> Label
2160 name
: f
.fold_lifetime(node
.name
),
2161 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2164 pub fn fold_lifetime
<F
>(f
: &mut F
, node
: Lifetime
) -> Lifetime
2169 apostrophe
: f
.fold_span(node
.apostrophe
),
2170 ident
: f
.fold_ident(node
.ident
),
2173 #[cfg(any(feature = "derive", feature = "full"))]
2174 pub fn fold_lifetime_def
<F
>(f
: &mut F
, node
: LifetimeDef
) -> LifetimeDef
2179 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2180 lifetime
: f
.fold_lifetime(node
.lifetime
),
2181 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
2182 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_lifetime(it
)),
2185 pub fn fold_lit
<F
>(f
: &mut F
, node
: Lit
) -> Lit
2190 Lit
::Str(_binding_0
) => Lit
::Str(f
.fold_lit_str(_binding_0
)),
2191 Lit
::ByteStr(_binding_0
) => Lit
::ByteStr(f
.fold_lit_byte_str(_binding_0
)),
2192 Lit
::Byte(_binding_0
) => Lit
::Byte(f
.fold_lit_byte(_binding_0
)),
2193 Lit
::Char(_binding_0
) => Lit
::Char(f
.fold_lit_char(_binding_0
)),
2194 Lit
::Int(_binding_0
) => Lit
::Int(f
.fold_lit_int(_binding_0
)),
2195 Lit
::Float(_binding_0
) => Lit
::Float(f
.fold_lit_float(_binding_0
)),
2196 Lit
::Bool(_binding_0
) => Lit
::Bool(f
.fold_lit_bool(_binding_0
)),
2197 Lit
::Verbatim(_binding_0
) => Lit
::Verbatim(_binding_0
),
2200 pub fn fold_lit_bool
<F
>(f
: &mut F
, node
: LitBool
) -> LitBool
2206 span
: f
.fold_span(node
.span
),
2209 pub fn fold_lit_byte
<F
>(f
: &mut F
, node
: LitByte
) -> LitByte
2213 let span
= f
.fold_span(node
.span());
2214 let mut node
= node
;
2215 node
.set_span(span
);
2218 pub fn fold_lit_byte_str
<F
>(f
: &mut F
, node
: LitByteStr
) -> LitByteStr
2222 let span
= f
.fold_span(node
.span());
2223 let mut node
= node
;
2224 node
.set_span(span
);
2227 pub fn fold_lit_char
<F
>(f
: &mut F
, node
: LitChar
) -> LitChar
2231 let span
= f
.fold_span(node
.span());
2232 let mut node
= node
;
2233 node
.set_span(span
);
2236 pub fn fold_lit_float
<F
>(f
: &mut F
, node
: LitFloat
) -> LitFloat
2240 let span
= f
.fold_span(node
.span());
2241 let mut node
= node
;
2242 node
.set_span(span
);
2245 pub fn fold_lit_int
<F
>(f
: &mut F
, node
: LitInt
) -> LitInt
2249 let span
= f
.fold_span(node
.span());
2250 let mut node
= node
;
2251 node
.set_span(span
);
2254 pub fn fold_lit_str
<F
>(f
: &mut F
, node
: LitStr
) -> LitStr
2258 let span
= f
.fold_span(node
.span());
2259 let mut node
= node
;
2260 node
.set_span(span
);
2263 #[cfg(feature = "full")]
2264 pub fn fold_local
<F
>(f
: &mut F
, node
: Local
) -> Local
2269 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2270 let_token
: Token
![let](tokens_helper(f
, &node
.let_token
.span
)),
2271 pat
: f
.fold_pat(node
.pat
),
2272 init
: (node
.init
).map(|it
| {
2274 Token
! [ = ](tokens_helper(f
, &(it
).0.spans
)),
2275 Box
::new(f
.fold_expr(*(it
).1)),
2278 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2281 #[cfg(any(feature = "derive", feature = "full"))]
2282 pub fn fold_macro
<F
>(f
: &mut F
, node
: Macro
) -> Macro
2287 path
: f
.fold_path(node
.path
),
2288 bang_token
: Token
![!](tokens_helper(f
, &node
.bang_token
.spans
)),
2289 delimiter
: f
.fold_macro_delimiter(node
.delimiter
),
2290 tokens
: node
.tokens
,
2293 #[cfg(any(feature = "derive", feature = "full"))]
2294 pub fn fold_macro_delimiter
<F
>(f
: &mut F
, node
: MacroDelimiter
) -> MacroDelimiter
2299 MacroDelimiter
::Paren(_binding_0
) => {
2300 MacroDelimiter
::Paren(Paren(tokens_helper(f
, &_binding_0
.span
)))
2302 MacroDelimiter
::Brace(_binding_0
) => {
2303 MacroDelimiter
::Brace(Brace(tokens_helper(f
, &_binding_0
.span
)))
2305 MacroDelimiter
::Bracket(_binding_0
) => {
2306 MacroDelimiter
::Bracket(Bracket(tokens_helper(f
, &_binding_0
.span
)))
2310 #[cfg(any(feature = "derive", feature = "full"))]
2311 pub fn fold_member
<F
>(f
: &mut F
, node
: Member
) -> Member
2316 Member
::Named(_binding_0
) => Member
::Named(f
.fold_ident(_binding_0
)),
2317 Member
::Unnamed(_binding_0
) => Member
::Unnamed(f
.fold_index(_binding_0
)),
2320 #[cfg(any(feature = "derive", feature = "full"))]
2321 pub fn fold_meta
<F
>(f
: &mut F
, node
: Meta
) -> Meta
2326 Meta
::Path(_binding_0
) => Meta
::Path(f
.fold_path(_binding_0
)),
2327 Meta
::List(_binding_0
) => Meta
::List(f
.fold_meta_list(_binding_0
)),
2328 Meta
::NameValue(_binding_0
) => Meta
::NameValue(f
.fold_meta_name_value(_binding_0
)),
2331 #[cfg(any(feature = "derive", feature = "full"))]
2332 pub fn fold_meta_list
<F
>(f
: &mut F
, node
: MetaList
) -> MetaList
2337 path
: f
.fold_path(node
.path
),
2338 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2339 nested
: FoldHelper
::lift(node
.nested
, |it
| f
.fold_nested_meta(it
)),
2342 #[cfg(any(feature = "derive", feature = "full"))]
2343 pub fn fold_meta_name_value
<F
>(f
: &mut F
, node
: MetaNameValue
) -> MetaNameValue
2348 path
: f
.fold_path(node
.path
),
2349 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
2350 lit
: f
.fold_lit(node
.lit
),
2353 #[cfg(feature = "full")]
2354 pub fn fold_method_turbofish
<F
>(f
: &mut F
, node
: MethodTurbofish
) -> MethodTurbofish
2359 colon2_token
: Token
! [ :: ](tokens_helper(f
, &node
.colon2_token
.spans
)),
2360 lt_token
: Token
! [ < ](tokens_helper(f
, &node
.lt_token
.spans
)),
2361 args
: FoldHelper
::lift(node
.args
, |it
| f
.fold_generic_method_argument(it
)),
2362 gt_token
: Token
! [ > ](tokens_helper(f
, &node
.gt_token
.spans
)),
2365 #[cfg(any(feature = "derive", feature = "full"))]
2366 pub fn fold_nested_meta
<F
>(f
: &mut F
, node
: NestedMeta
) -> NestedMeta
2371 NestedMeta
::Meta(_binding_0
) => NestedMeta
::Meta(f
.fold_meta(_binding_0
)),
2372 NestedMeta
::Lit(_binding_0
) => NestedMeta
::Lit(f
.fold_lit(_binding_0
)),
2375 #[cfg(any(feature = "derive", feature = "full"))]
2376 pub fn fold_parenthesized_generic_arguments
<F
>(
2378 node
: ParenthesizedGenericArguments
,
2379 ) -> ParenthesizedGenericArguments
2383 ParenthesizedGenericArguments
{
2384 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2385 inputs
: FoldHelper
::lift(node
.inputs
, |it
| f
.fold_type(it
)),
2386 output
: f
.fold_return_type(node
.output
),
2389 #[cfg(feature = "full")]
2390 pub fn fold_pat
<F
>(f
: &mut F
, node
: Pat
) -> Pat
2395 Pat
::Box(_binding_0
) => Pat
::Box(f
.fold_pat_box(_binding_0
)),
2396 Pat
::Ident(_binding_0
) => Pat
::Ident(f
.fold_pat_ident(_binding_0
)),
2397 Pat
::Lit(_binding_0
) => Pat
::Lit(f
.fold_pat_lit(_binding_0
)),
2398 Pat
::Macro(_binding_0
) => Pat
::Macro(f
.fold_pat_macro(_binding_0
)),
2399 Pat
::Or(_binding_0
) => Pat
::Or(f
.fold_pat_or(_binding_0
)),
2400 Pat
::Path(_binding_0
) => Pat
::Path(f
.fold_pat_path(_binding_0
)),
2401 Pat
::Range(_binding_0
) => Pat
::Range(f
.fold_pat_range(_binding_0
)),
2402 Pat
::Reference(_binding_0
) => Pat
::Reference(f
.fold_pat_reference(_binding_0
)),
2403 Pat
::Rest(_binding_0
) => Pat
::Rest(f
.fold_pat_rest(_binding_0
)),
2404 Pat
::Slice(_binding_0
) => Pat
::Slice(f
.fold_pat_slice(_binding_0
)),
2405 Pat
::Struct(_binding_0
) => Pat
::Struct(f
.fold_pat_struct(_binding_0
)),
2406 Pat
::Tuple(_binding_0
) => Pat
::Tuple(f
.fold_pat_tuple(_binding_0
)),
2407 Pat
::TupleStruct(_binding_0
) => Pat
::TupleStruct(f
.fold_pat_tuple_struct(_binding_0
)),
2408 Pat
::Type(_binding_0
) => Pat
::Type(f
.fold_pat_type(_binding_0
)),
2409 Pat
::Verbatim(_binding_0
) => Pat
::Verbatim(_binding_0
),
2410 Pat
::Wild(_binding_0
) => Pat
::Wild(f
.fold_pat_wild(_binding_0
)),
2411 _
=> unreachable
!(),
2414 #[cfg(feature = "full")]
2415 pub fn fold_pat_box
<F
>(f
: &mut F
, node
: PatBox
) -> PatBox
2420 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2421 box_token
: Token
![box](tokens_helper(f
, &node
.box_token
.span
)),
2422 pat
: Box
::new(f
.fold_pat(*node
.pat
)),
2425 #[cfg(feature = "full")]
2426 pub fn fold_pat_ident
<F
>(f
: &mut F
, node
: PatIdent
) -> PatIdent
2431 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2432 by_ref
: (node
.by_ref
).map(|it
| Token
![ref](tokens_helper(f
, &it
.span
))),
2433 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
2434 ident
: f
.fold_ident(node
.ident
),
2435 subpat
: (node
.subpat
).map(|it
| {
2437 Token
! [ @
](tokens_helper(f
, &(it
).0.spans
)),
2438 Box
::new(f
.fold_pat(*(it
).1)),
2443 #[cfg(feature = "full")]
2444 pub fn fold_pat_lit
<F
>(f
: &mut F
, node
: PatLit
) -> PatLit
2449 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2450 expr
: Box
::new(f
.fold_expr(*node
.expr
)),
2453 #[cfg(feature = "full")]
2454 pub fn fold_pat_macro
<F
>(f
: &mut F
, node
: PatMacro
) -> PatMacro
2459 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2460 mac
: f
.fold_macro(node
.mac
),
2463 #[cfg(feature = "full")]
2464 pub fn fold_pat_or
<F
>(f
: &mut F
, node
: PatOr
) -> PatOr
2469 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2470 leading_vert
: (node
.leading_vert
).map(|it
| Token
! [ | ](tokens_helper(f
, &it
.spans
))),
2471 cases
: FoldHelper
::lift(node
.cases
, |it
| f
.fold_pat(it
)),
2474 #[cfg(feature = "full")]
2475 pub fn fold_pat_path
<F
>(f
: &mut F
, node
: PatPath
) -> PatPath
2480 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2481 qself
: (node
.qself
).map(|it
| f
.fold_qself(it
)),
2482 path
: f
.fold_path(node
.path
),
2485 #[cfg(feature = "full")]
2486 pub fn fold_pat_range
<F
>(f
: &mut F
, node
: PatRange
) -> PatRange
2491 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2492 lo
: Box
::new(f
.fold_expr(*node
.lo
)),
2493 limits
: f
.fold_range_limits(node
.limits
),
2494 hi
: Box
::new(f
.fold_expr(*node
.hi
)),
2497 #[cfg(feature = "full")]
2498 pub fn fold_pat_reference
<F
>(f
: &mut F
, node
: PatReference
) -> PatReference
2503 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2504 and_token
: Token
! [ & ](tokens_helper(f
, &node
.and_token
.spans
)),
2505 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
2506 pat
: Box
::new(f
.fold_pat(*node
.pat
)),
2509 #[cfg(feature = "full")]
2510 pub fn fold_pat_rest
<F
>(f
: &mut F
, node
: PatRest
) -> PatRest
2515 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2516 dot2_token
: Token
![..](tokens_helper(f
, &node
.dot2_token
.spans
)),
2519 #[cfg(feature = "full")]
2520 pub fn fold_pat_slice
<F
>(f
: &mut F
, node
: PatSlice
) -> PatSlice
2525 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2526 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
2527 elems
: FoldHelper
::lift(node
.elems
, |it
| f
.fold_pat(it
)),
2530 #[cfg(feature = "full")]
2531 pub fn fold_pat_struct
<F
>(f
: &mut F
, node
: PatStruct
) -> PatStruct
2536 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2537 path
: f
.fold_path(node
.path
),
2538 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
2539 fields
: FoldHelper
::lift(node
.fields
, |it
| f
.fold_field_pat(it
)),
2540 dot2_token
: (node
.dot2_token
).map(|it
| Token
![..](tokens_helper(f
, &it
.spans
))),
2543 #[cfg(feature = "full")]
2544 pub fn fold_pat_tuple
<F
>(f
: &mut F
, node
: PatTuple
) -> PatTuple
2549 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2550 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2551 elems
: FoldHelper
::lift(node
.elems
, |it
| f
.fold_pat(it
)),
2554 #[cfg(feature = "full")]
2555 pub fn fold_pat_tuple_struct
<F
>(f
: &mut F
, node
: PatTupleStruct
) -> PatTupleStruct
2560 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2561 path
: f
.fold_path(node
.path
),
2562 pat
: f
.fold_pat_tuple(node
.pat
),
2565 #[cfg(feature = "full")]
2566 pub fn fold_pat_type
<F
>(f
: &mut F
, node
: PatType
) -> PatType
2571 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2572 pat
: Box
::new(f
.fold_pat(*node
.pat
)),
2573 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2574 ty
: Box
::new(f
.fold_type(*node
.ty
)),
2577 #[cfg(feature = "full")]
2578 pub fn fold_pat_wild
<F
>(f
: &mut F
, node
: PatWild
) -> PatWild
2583 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2584 underscore_token
: Token
![_
](tokens_helper(f
, &node
.underscore_token
.spans
)),
2587 #[cfg(any(feature = "derive", feature = "full"))]
2588 pub fn fold_path
<F
>(f
: &mut F
, node
: Path
) -> Path
2593 leading_colon
: (node
.leading_colon
).map(|it
| Token
! [ :: ](tokens_helper(f
, &it
.spans
))),
2594 segments
: FoldHelper
::lift(node
.segments
, |it
| f
.fold_path_segment(it
)),
2597 #[cfg(any(feature = "derive", feature = "full"))]
2598 pub fn fold_path_arguments
<F
>(f
: &mut F
, node
: PathArguments
) -> PathArguments
2603 PathArguments
::None
=> PathArguments
::None
,
2604 PathArguments
::AngleBracketed(_binding_0
) => {
2605 PathArguments
::AngleBracketed(f
.fold_angle_bracketed_generic_arguments(_binding_0
))
2607 PathArguments
::Parenthesized(_binding_0
) => {
2608 PathArguments
::Parenthesized(f
.fold_parenthesized_generic_arguments(_binding_0
))
2612 #[cfg(any(feature = "derive", feature = "full"))]
2613 pub fn fold_path_segment
<F
>(f
: &mut F
, node
: PathSegment
) -> PathSegment
2618 ident
: f
.fold_ident(node
.ident
),
2619 arguments
: f
.fold_path_arguments(node
.arguments
),
2622 #[cfg(any(feature = "derive", feature = "full"))]
2623 pub fn fold_predicate_eq
<F
>(f
: &mut F
, node
: PredicateEq
) -> PredicateEq
2628 lhs_ty
: f
.fold_type(node
.lhs_ty
),
2629 eq_token
: Token
! [ = ](tokens_helper(f
, &node
.eq_token
.spans
)),
2630 rhs_ty
: f
.fold_type(node
.rhs_ty
),
2633 #[cfg(any(feature = "derive", feature = "full"))]
2634 pub fn fold_predicate_lifetime
<F
>(f
: &mut F
, node
: PredicateLifetime
) -> PredicateLifetime
2639 lifetime
: f
.fold_lifetime(node
.lifetime
),
2640 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2641 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_lifetime(it
)),
2644 #[cfg(any(feature = "derive", feature = "full"))]
2645 pub fn fold_predicate_type
<F
>(f
: &mut F
, node
: PredicateType
) -> PredicateType
2650 lifetimes
: (node
.lifetimes
).map(|it
| f
.fold_bound_lifetimes(it
)),
2651 bounded_ty
: f
.fold_type(node
.bounded_ty
),
2652 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2653 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
2656 #[cfg(any(feature = "derive", feature = "full"))]
2657 pub fn fold_qself
<F
>(f
: &mut F
, node
: QSelf
) -> QSelf
2662 lt_token
: Token
! [ < ](tokens_helper(f
, &node
.lt_token
.spans
)),
2663 ty
: Box
::new(f
.fold_type(*node
.ty
)),
2664 position
: node
.position
,
2665 as_token
: (node
.as_token
).map(|it
| Token
![as](tokens_helper(f
, &it
.span
))),
2666 gt_token
: Token
! [ > ](tokens_helper(f
, &node
.gt_token
.spans
)),
2669 #[cfg(feature = "full")]
2670 pub fn fold_range_limits
<F
>(f
: &mut F
, node
: RangeLimits
) -> RangeLimits
2675 RangeLimits
::HalfOpen(_binding_0
) => {
2676 RangeLimits
::HalfOpen(Token
![..](tokens_helper(f
, &_binding_0
.spans
)))
2678 RangeLimits
::Closed(_binding_0
) => {
2679 RangeLimits
::Closed(Token
! [ ..= ](tokens_helper(f
, &_binding_0
.spans
)))
2683 #[cfg(feature = "full")]
2684 pub fn fold_receiver
<F
>(f
: &mut F
, node
: Receiver
) -> Receiver
2689 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2690 reference
: (node
.reference
).map(|it
| {
2692 Token
! [ & ](tokens_helper(f
, &(it
).0.spans
)),
2693 ((it
).1).map(|it
| f
.fold_lifetime(it
)),
2696 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
2697 self_token
: Token
![self](tokens_helper(f
, &node
.self_token
.span
)),
2700 #[cfg(any(feature = "derive", feature = "full"))]
2701 pub fn fold_return_type
<F
>(f
: &mut F
, node
: ReturnType
) -> ReturnType
2706 ReturnType
::Default
=> ReturnType
::Default
,
2707 ReturnType
::Type(_binding_0
, _binding_1
) => ReturnType
::Type(
2708 Token
! [ -> ](tokens_helper(f
, &_binding_0
.spans
)),
2709 Box
::new(f
.fold_type(*_binding_1
)),
2713 #[cfg(feature = "full")]
2714 pub fn fold_signature
<F
>(f
: &mut F
, node
: Signature
) -> Signature
2719 constness
: (node
.constness
).map(|it
| Token
![const](tokens_helper(f
, &it
.span
))),
2720 asyncness
: (node
.asyncness
).map(|it
| Token
![async
](tokens_helper(f
, &it
.span
))),
2721 unsafety
: (node
.unsafety
).map(|it
| Token
![unsafe](tokens_helper(f
, &it
.span
))),
2722 abi
: (node
.abi
).map(|it
| f
.fold_abi(it
)),
2723 fn_token
: Token
![fn](tokens_helper(f
, &node
.fn_token
.span
)),
2724 ident
: f
.fold_ident(node
.ident
),
2725 generics
: f
.fold_generics(node
.generics
),
2726 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2727 inputs
: FoldHelper
::lift(node
.inputs
, |it
| f
.fold_fn_arg(it
)),
2728 variadic
: (node
.variadic
).map(|it
| f
.fold_variadic(it
)),
2729 output
: f
.fold_return_type(node
.output
),
2732 pub fn fold_span
<F
>(f
: &mut F
, node
: Span
) -> Span
2738 #[cfg(feature = "full")]
2739 pub fn fold_stmt
<F
>(f
: &mut F
, node
: Stmt
) -> Stmt
2744 Stmt
::Local(_binding_0
) => Stmt
::Local(f
.fold_local(_binding_0
)),
2745 Stmt
::Item(_binding_0
) => Stmt
::Item(f
.fold_item(_binding_0
)),
2746 Stmt
::Expr(_binding_0
) => Stmt
::Expr(f
.fold_expr(_binding_0
)),
2747 Stmt
::Semi(_binding_0
, _binding_1
) => Stmt
::Semi(
2748 f
.fold_expr(_binding_0
),
2749 Token
! [ ; ](tokens_helper(f
, &_binding_1
.spans
)),
2753 #[cfg(any(feature = "derive", feature = "full"))]
2754 pub fn fold_trait_bound
<F
>(f
: &mut F
, node
: TraitBound
) -> TraitBound
2759 paren_token
: (node
.paren_token
).map(|it
| Paren(tokens_helper(f
, &it
.span
))),
2760 modifier
: f
.fold_trait_bound_modifier(node
.modifier
),
2761 lifetimes
: (node
.lifetimes
).map(|it
| f
.fold_bound_lifetimes(it
)),
2762 path
: f
.fold_path(node
.path
),
2765 #[cfg(any(feature = "derive", feature = "full"))]
2766 pub fn fold_trait_bound_modifier
<F
>(f
: &mut F
, node
: TraitBoundModifier
) -> TraitBoundModifier
2771 TraitBoundModifier
::None
=> TraitBoundModifier
::None
,
2772 TraitBoundModifier
::Maybe(_binding_0
) => {
2773 TraitBoundModifier
::Maybe(Token
! [ ?
](tokens_helper(f
, &_binding_0
.spans
)))
2777 #[cfg(feature = "full")]
2778 pub fn fold_trait_item
<F
>(f
: &mut F
, node
: TraitItem
) -> TraitItem
2783 TraitItem
::Const(_binding_0
) => TraitItem
::Const(f
.fold_trait_item_const(_binding_0
)),
2784 TraitItem
::Method(_binding_0
) => TraitItem
::Method(f
.fold_trait_item_method(_binding_0
)),
2785 TraitItem
::Type(_binding_0
) => TraitItem
::Type(f
.fold_trait_item_type(_binding_0
)),
2786 TraitItem
::Macro(_binding_0
) => TraitItem
::Macro(f
.fold_trait_item_macro(_binding_0
)),
2787 TraitItem
::Verbatim(_binding_0
) => TraitItem
::Verbatim(_binding_0
),
2788 _
=> unreachable
!(),
2791 #[cfg(feature = "full")]
2792 pub fn fold_trait_item_const
<F
>(f
: &mut F
, node
: TraitItemConst
) -> TraitItemConst
2797 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2798 const_token
: Token
![const](tokens_helper(f
, &node
.const_token
.span
)),
2799 ident
: f
.fold_ident(node
.ident
),
2800 colon_token
: Token
! [ : ](tokens_helper(f
, &node
.colon_token
.spans
)),
2801 ty
: f
.fold_type(node
.ty
),
2802 default: (node
.default).map(|it
| {
2804 Token
! [ = ](tokens_helper(f
, &(it
).0.spans
)),
2805 f
.fold_expr((it
).1),
2808 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2811 #[cfg(feature = "full")]
2812 pub fn fold_trait_item_macro
<F
>(f
: &mut F
, node
: TraitItemMacro
) -> TraitItemMacro
2817 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2818 mac
: f
.fold_macro(node
.mac
),
2819 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
2822 #[cfg(feature = "full")]
2823 pub fn fold_trait_item_method
<F
>(f
: &mut F
, node
: TraitItemMethod
) -> TraitItemMethod
2828 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2829 sig
: f
.fold_signature(node
.sig
),
2830 default: (node
.default).map(|it
| f
.fold_block(it
)),
2831 semi_token
: (node
.semi_token
).map(|it
| Token
! [ ; ](tokens_helper(f
, &it
.spans
))),
2834 #[cfg(feature = "full")]
2835 pub fn fold_trait_item_type
<F
>(f
: &mut F
, node
: TraitItemType
) -> TraitItemType
2840 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2841 type_token
: Token
![type](tokens_helper(f
, &node
.type_token
.span
)),
2842 ident
: f
.fold_ident(node
.ident
),
2843 generics
: f
.fold_generics(node
.generics
),
2844 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
2845 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
2846 default: (node
.default).map(|it
| {
2848 Token
! [ = ](tokens_helper(f
, &(it
).0.spans
)),
2849 f
.fold_type((it
).1),
2852 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2855 #[cfg(any(feature = "derive", feature = "full"))]
2856 pub fn fold_type
<F
>(f
: &mut F
, node
: Type
) -> Type
2861 Type
::Array(_binding_0
) => Type
::Array(f
.fold_type_array(_binding_0
)),
2862 Type
::BareFn(_binding_0
) => Type
::BareFn(f
.fold_type_bare_fn(_binding_0
)),
2863 Type
::Group(_binding_0
) => Type
::Group(f
.fold_type_group(_binding_0
)),
2864 Type
::ImplTrait(_binding_0
) => Type
::ImplTrait(f
.fold_type_impl_trait(_binding_0
)),
2865 Type
::Infer(_binding_0
) => Type
::Infer(f
.fold_type_infer(_binding_0
)),
2866 Type
::Macro(_binding_0
) => Type
::Macro(f
.fold_type_macro(_binding_0
)),
2867 Type
::Never(_binding_0
) => Type
::Never(f
.fold_type_never(_binding_0
)),
2868 Type
::Paren(_binding_0
) => Type
::Paren(f
.fold_type_paren(_binding_0
)),
2869 Type
::Path(_binding_0
) => Type
::Path(f
.fold_type_path(_binding_0
)),
2870 Type
::Ptr(_binding_0
) => Type
::Ptr(f
.fold_type_ptr(_binding_0
)),
2871 Type
::Reference(_binding_0
) => Type
::Reference(f
.fold_type_reference(_binding_0
)),
2872 Type
::Slice(_binding_0
) => Type
::Slice(f
.fold_type_slice(_binding_0
)),
2873 Type
::TraitObject(_binding_0
) => Type
::TraitObject(f
.fold_type_trait_object(_binding_0
)),
2874 Type
::Tuple(_binding_0
) => Type
::Tuple(f
.fold_type_tuple(_binding_0
)),
2875 Type
::Verbatim(_binding_0
) => Type
::Verbatim(_binding_0
),
2876 _
=> unreachable
!(),
2879 #[cfg(any(feature = "derive", feature = "full"))]
2880 pub fn fold_type_array
<F
>(f
: &mut F
, node
: TypeArray
) -> TypeArray
2885 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
2886 elem
: Box
::new(f
.fold_type(*node
.elem
)),
2887 semi_token
: Token
! [ ; ](tokens_helper(f
, &node
.semi_token
.spans
)),
2888 len
: f
.fold_expr(node
.len
),
2891 #[cfg(any(feature = "derive", feature = "full"))]
2892 pub fn fold_type_bare_fn
<F
>(f
: &mut F
, node
: TypeBareFn
) -> TypeBareFn
2897 lifetimes
: (node
.lifetimes
).map(|it
| f
.fold_bound_lifetimes(it
)),
2898 unsafety
: (node
.unsafety
).map(|it
| Token
![unsafe](tokens_helper(f
, &it
.span
))),
2899 abi
: (node
.abi
).map(|it
| f
.fold_abi(it
)),
2900 fn_token
: Token
![fn](tokens_helper(f
, &node
.fn_token
.span
)),
2901 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2902 inputs
: FoldHelper
::lift(node
.inputs
, |it
| f
.fold_bare_fn_arg(it
)),
2903 variadic
: (node
.variadic
).map(|it
| f
.fold_variadic(it
)),
2904 output
: f
.fold_return_type(node
.output
),
2907 #[cfg(any(feature = "derive", feature = "full"))]
2908 pub fn fold_type_group
<F
>(f
: &mut F
, node
: TypeGroup
) -> TypeGroup
2913 group_token
: Group(tokens_helper(f
, &node
.group_token
.span
)),
2914 elem
: Box
::new(f
.fold_type(*node
.elem
)),
2917 #[cfg(any(feature = "derive", feature = "full"))]
2918 pub fn fold_type_impl_trait
<F
>(f
: &mut F
, node
: TypeImplTrait
) -> TypeImplTrait
2923 impl_token
: Token
![impl](tokens_helper(f
, &node
.impl_token
.span
)),
2924 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
2927 #[cfg(any(feature = "derive", feature = "full"))]
2928 pub fn fold_type_infer
<F
>(f
: &mut F
, node
: TypeInfer
) -> TypeInfer
2933 underscore_token
: Token
![_
](tokens_helper(f
, &node
.underscore_token
.spans
)),
2936 #[cfg(any(feature = "derive", feature = "full"))]
2937 pub fn fold_type_macro
<F
>(f
: &mut F
, node
: TypeMacro
) -> TypeMacro
2942 mac
: f
.fold_macro(node
.mac
),
2945 #[cfg(any(feature = "derive", feature = "full"))]
2946 pub fn fold_type_never
<F
>(f
: &mut F
, node
: TypeNever
) -> TypeNever
2951 bang_token
: Token
![!](tokens_helper(f
, &node
.bang_token
.spans
)),
2954 #[cfg(any(feature = "derive", feature = "full"))]
2955 pub fn fold_type_param
<F
>(f
: &mut F
, node
: TypeParam
) -> TypeParam
2960 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
2961 ident
: f
.fold_ident(node
.ident
),
2962 colon_token
: (node
.colon_token
).map(|it
| Token
! [ : ](tokens_helper(f
, &it
.spans
))),
2963 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
2964 eq_token
: (node
.eq_token
).map(|it
| Token
! [ = ](tokens_helper(f
, &it
.spans
))),
2965 default: (node
.default).map(|it
| f
.fold_type(it
)),
2968 #[cfg(any(feature = "derive", feature = "full"))]
2969 pub fn fold_type_param_bound
<F
>(f
: &mut F
, node
: TypeParamBound
) -> TypeParamBound
2974 TypeParamBound
::Trait(_binding_0
) => TypeParamBound
::Trait(f
.fold_trait_bound(_binding_0
)),
2975 TypeParamBound
::Lifetime(_binding_0
) => {
2976 TypeParamBound
::Lifetime(f
.fold_lifetime(_binding_0
))
2980 #[cfg(any(feature = "derive", feature = "full"))]
2981 pub fn fold_type_paren
<F
>(f
: &mut F
, node
: TypeParen
) -> TypeParen
2986 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
2987 elem
: Box
::new(f
.fold_type(*node
.elem
)),
2990 #[cfg(any(feature = "derive", feature = "full"))]
2991 pub fn fold_type_path
<F
>(f
: &mut F
, node
: TypePath
) -> TypePath
2996 qself
: (node
.qself
).map(|it
| f
.fold_qself(it
)),
2997 path
: f
.fold_path(node
.path
),
3000 #[cfg(any(feature = "derive", feature = "full"))]
3001 pub fn fold_type_ptr
<F
>(f
: &mut F
, node
: TypePtr
) -> TypePtr
3006 star_token
: Token
! [ * ](tokens_helper(f
, &node
.star_token
.spans
)),
3007 const_token
: (node
.const_token
).map(|it
| Token
![const](tokens_helper(f
, &it
.span
))),
3008 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
3009 elem
: Box
::new(f
.fold_type(*node
.elem
)),
3012 #[cfg(any(feature = "derive", feature = "full"))]
3013 pub fn fold_type_reference
<F
>(f
: &mut F
, node
: TypeReference
) -> TypeReference
3018 and_token
: Token
! [ & ](tokens_helper(f
, &node
.and_token
.spans
)),
3019 lifetime
: (node
.lifetime
).map(|it
| f
.fold_lifetime(it
)),
3020 mutability
: (node
.mutability
).map(|it
| Token
![mut](tokens_helper(f
, &it
.span
))),
3021 elem
: Box
::new(f
.fold_type(*node
.elem
)),
3024 #[cfg(any(feature = "derive", feature = "full"))]
3025 pub fn fold_type_slice
<F
>(f
: &mut F
, node
: TypeSlice
) -> TypeSlice
3030 bracket_token
: Bracket(tokens_helper(f
, &node
.bracket_token
.span
)),
3031 elem
: Box
::new(f
.fold_type(*node
.elem
)),
3034 #[cfg(any(feature = "derive", feature = "full"))]
3035 pub fn fold_type_trait_object
<F
>(f
: &mut F
, node
: TypeTraitObject
) -> TypeTraitObject
3040 dyn_token
: (node
.dyn_token
).map(|it
| Token
![dyn](tokens_helper(f
, &it
.span
))),
3041 bounds
: FoldHelper
::lift(node
.bounds
, |it
| f
.fold_type_param_bound(it
)),
3044 #[cfg(any(feature = "derive", feature = "full"))]
3045 pub fn fold_type_tuple
<F
>(f
: &mut F
, node
: TypeTuple
) -> TypeTuple
3050 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
3051 elems
: FoldHelper
::lift(node
.elems
, |it
| f
.fold_type(it
)),
3054 #[cfg(any(feature = "derive", feature = "full"))]
3055 pub fn fold_un_op
<F
>(f
: &mut F
, node
: UnOp
) -> UnOp
3060 UnOp
::Deref(_binding_0
) => UnOp
::Deref(Token
! [ * ](tokens_helper(f
, &_binding_0
.spans
))),
3061 UnOp
::Not(_binding_0
) => UnOp
::Not(Token
![!](tokens_helper(f
, &_binding_0
.spans
))),
3062 UnOp
::Neg(_binding_0
) => UnOp
::Neg(Token
! [ - ](tokens_helper(f
, &_binding_0
.spans
))),
3065 #[cfg(feature = "full")]
3066 pub fn fold_use_glob
<F
>(f
: &mut F
, node
: UseGlob
) -> UseGlob
3071 star_token
: Token
! [ * ](tokens_helper(f
, &node
.star_token
.spans
)),
3074 #[cfg(feature = "full")]
3075 pub fn fold_use_group
<F
>(f
: &mut F
, node
: UseGroup
) -> UseGroup
3080 brace_token
: Brace(tokens_helper(f
, &node
.brace_token
.span
)),
3081 items
: FoldHelper
::lift(node
.items
, |it
| f
.fold_use_tree(it
)),
3084 #[cfg(feature = "full")]
3085 pub fn fold_use_name
<F
>(f
: &mut F
, node
: UseName
) -> UseName
3090 ident
: f
.fold_ident(node
.ident
),
3093 #[cfg(feature = "full")]
3094 pub fn fold_use_path
<F
>(f
: &mut F
, node
: UsePath
) -> UsePath
3099 ident
: f
.fold_ident(node
.ident
),
3100 colon2_token
: Token
! [ :: ](tokens_helper(f
, &node
.colon2_token
.spans
)),
3101 tree
: Box
::new(f
.fold_use_tree(*node
.tree
)),
3104 #[cfg(feature = "full")]
3105 pub fn fold_use_rename
<F
>(f
: &mut F
, node
: UseRename
) -> UseRename
3110 ident
: f
.fold_ident(node
.ident
),
3111 as_token
: Token
![as](tokens_helper(f
, &node
.as_token
.span
)),
3112 rename
: f
.fold_ident(node
.rename
),
3115 #[cfg(feature = "full")]
3116 pub fn fold_use_tree
<F
>(f
: &mut F
, node
: UseTree
) -> UseTree
3121 UseTree
::Path(_binding_0
) => UseTree
::Path(f
.fold_use_path(_binding_0
)),
3122 UseTree
::Name(_binding_0
) => UseTree
::Name(f
.fold_use_name(_binding_0
)),
3123 UseTree
::Rename(_binding_0
) => UseTree
::Rename(f
.fold_use_rename(_binding_0
)),
3124 UseTree
::Glob(_binding_0
) => UseTree
::Glob(f
.fold_use_glob(_binding_0
)),
3125 UseTree
::Group(_binding_0
) => UseTree
::Group(f
.fold_use_group(_binding_0
)),
3128 #[cfg(any(feature = "derive", feature = "full"))]
3129 pub fn fold_variadic
<F
>(f
: &mut F
, node
: Variadic
) -> Variadic
3134 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
3135 dots
: Token
! [ ... ](tokens_helper(f
, &node
.dots
.spans
)),
3138 #[cfg(any(feature = "derive", feature = "full"))]
3139 pub fn fold_variant
<F
>(f
: &mut F
, node
: Variant
) -> Variant
3144 attrs
: FoldHelper
::lift(node
.attrs
, |it
| f
.fold_attribute(it
)),
3145 ident
: f
.fold_ident(node
.ident
),
3146 fields
: f
.fold_fields(node
.fields
),
3147 discriminant
: (node
.discriminant
).map(|it
| {
3149 Token
! [ = ](tokens_helper(f
, &(it
).0.spans
)),
3150 f
.fold_expr((it
).1),
3155 #[cfg(any(feature = "derive", feature = "full"))]
3156 pub fn fold_vis_crate
<F
>(f
: &mut F
, node
: VisCrate
) -> VisCrate
3161 crate_token
: Token
![crate](tokens_helper(f
, &node
.crate_token
.span
)),
3164 #[cfg(any(feature = "derive", feature = "full"))]
3165 pub fn fold_vis_public
<F
>(f
: &mut F
, node
: VisPublic
) -> VisPublic
3170 pub_token
: Token
![pub](tokens_helper(f
, &node
.pub_token
.span
)),
3173 #[cfg(any(feature = "derive", feature = "full"))]
3174 pub fn fold_vis_restricted
<F
>(f
: &mut F
, node
: VisRestricted
) -> VisRestricted
3179 pub_token
: Token
![pub](tokens_helper(f
, &node
.pub_token
.span
)),
3180 paren_token
: Paren(tokens_helper(f
, &node
.paren_token
.span
)),
3181 in_token
: (node
.in_token
).map(|it
| Token
![in](tokens_helper(f
, &it
.span
))),
3182 path
: Box
::new(f
.fold_path(*node
.path
)),
3185 #[cfg(any(feature = "derive", feature = "full"))]
3186 pub fn fold_visibility
<F
>(f
: &mut F
, node
: Visibility
) -> Visibility
3191 Visibility
::Public(_binding_0
) => Visibility
::Public(f
.fold_vis_public(_binding_0
)),
3192 Visibility
::Crate(_binding_0
) => Visibility
::Crate(f
.fold_vis_crate(_binding_0
)),
3193 Visibility
::Restricted(_binding_0
) => {
3194 Visibility
::Restricted(f
.fold_vis_restricted(_binding_0
))
3196 Visibility
::Inherited
=> Visibility
::Inherited
,
3199 #[cfg(any(feature = "derive", feature = "full"))]
3200 pub fn fold_where_clause
<F
>(f
: &mut F
, node
: WhereClause
) -> WhereClause
3205 where_token
: Token
![where](tokens_helper(f
, &node
.where_token
.span
)),
3206 predicates
: FoldHelper
::lift(node
.predicates
, |it
| f
.fold_where_predicate(it
)),
3209 #[cfg(any(feature = "derive", feature = "full"))]
3210 pub fn fold_where_predicate
<F
>(f
: &mut F
, node
: WherePredicate
) -> WherePredicate
3215 WherePredicate
::Type(_binding_0
) => WherePredicate
::Type(f
.fold_predicate_type(_binding_0
)),
3216 WherePredicate
::Lifetime(_binding_0
) => {
3217 WherePredicate
::Lifetime(f
.fold_predicate_lifetime(_binding_0
))
3219 WherePredicate
::Eq(_binding_0
) => WherePredicate
::Eq(f
.fold_predicate_eq(_binding_0
)),