blob: e5aed1e76867324d95529a48dc46c1c6f1b38fb2 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzellc08227a2017-12-04 16:30:17 -050045fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay506e43a2017-12-29 11:34:36 -050064
65fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050070
71fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
David Tolnaye3d41b72017-12-31 15:24:00 -050073fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
74
75fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
76
77fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
78
79fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
80
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500129fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500143fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500149fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500155fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500156
157fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
Nika Layzell640832a2017-12-04 13:37:09 -0500158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
David Tolnaye3d41b72017-12-31 15:24:00 -0500170
171fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) }
172
173fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
174
175fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800188# [ cfg ( feature = "full" ) ]
189fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500190# [ cfg ( feature = "full" ) ]
191fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192
Nika Layzellc08227a2017-12-04 16:30:17 -0500193fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500194# [ cfg ( feature = "full" ) ]
195fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500196
David Tolnayc2f1aba2017-11-12 20:29:22 -0800197fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
198
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500200
201fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800207fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500212# [ cfg ( feature = "full" ) ]
213fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500214
David Tolnay85b69a42017-12-27 20:43:10 -0500215fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800231fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800233fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800243fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500248# [ cfg ( feature = "full" ) ]
249fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnaybcd498f2017-12-29 12:02:33 -0500250# [ cfg ( feature = "full" ) ]
251fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
David Tolnay4ba63a02017-12-28 15:53:05 -0500253fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500256
257fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
David Tolnaydecf28d2017-11-11 11:56:45 -0800261fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500262
David Tolnayab919512017-12-30 23:31:51 -0500263fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
264
David Tolnay85b69a42017-12-27 20:43:10 -0500265fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800266
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500274# [ cfg ( feature = "full" ) ]
275fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278
Nika Layzellc08227a2017-12-04 16:30:17 -0500279fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500289fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500305fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500310
311fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
David Tolnayd4add852018-01-01 20:13:24 -0800317fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(self, i) }
318
319fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
320
321fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
322
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800326
327fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500328
329fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800339fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400341fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500344# [ cfg ( feature = "full" ) ]
345fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800349fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800351fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400352
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800353fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
354
355fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
356
357fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
358
David Tolnay323279a2017-12-29 11:26:32 -0500359fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
360
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800361fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
362
363fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
364
365fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
366
367fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
368
369fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
370
371fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
372
David Tolnay0a89b4d2017-11-13 00:55:45 -0800373fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800374
375fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
376
377fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
378
David Tolnay05362582017-12-26 01:33:57 -0500379fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800380
David Tolnay2ae520a2017-12-29 11:19:50 -0500381fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500384# [ cfg ( feature = "full" ) ]
385fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
386# [ cfg ( feature = "full" ) ]
387fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
388# [ cfg ( feature = "full" ) ]
389fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
390# [ cfg ( feature = "full" ) ]
391fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400402
Nika Layzella6f46c42017-10-26 15:26:16 -0400403fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400404
Nika Layzella6f46c42017-10-26 15:26:16 -0400405fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400406
Nika Layzell27726662017-10-24 23:16:35 -0400407}
408
David Tolnayd0adf522017-12-29 01:30:07 -0500409pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
410 _i.span = _visitor.fold_span(_i.span);
411 _i
412}
413
414pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
415 _i.span = _visitor.fold_span(_i.span);
416 _i
417}
418
Nika Layzell27726662017-10-24 23:16:35 -0400419
Nika Layzella6f46c42017-10-26 15:26:16 -0400420pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400421 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500423 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400424 }
425}
426
Nika Layzellc08227a2017-12-04 16:30:17 -0500427pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
428 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500429 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500430 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500431 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500432 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgCaptured {
438 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800440 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400441 }
442}
443# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400444pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400445 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500446 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500447 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400448 }
449}
450# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400451pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400452 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500453 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500454 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500455 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500456 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400457 }
458}
459# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400460pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400461 Arm {
462 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
463 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500464 guard: (_i . guard).map(|it| { (
465 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
466 Box::new(_visitor.fold_expr(* ( it ) . 1)),
467 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400469 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400471 }
472}
473
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400475 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500476 AttrStyle::Outer => { AttrStyle::Outer }
477 AttrStyle::Inner(_binding_0, ) => {
478 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500479 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400480 )
481 }
482 }
483}
484
Nika Layzella6f46c42017-10-26 15:26:16 -0400485pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400486 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500487 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500488 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500489 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400490 path: _visitor.fold_path(_i . path),
491 tts: _i . tts,
492 is_sugared_doc: _i . is_sugared_doc,
493 }
494}
495
Nika Layzella6f46c42017-10-26 15:26:16 -0400496pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400497 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500498 name: (_i . name).map(|it| { (
499 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500500 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500501 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800502 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400503 }
504}
505
Nika Layzella6f46c42017-10-26 15:26:16 -0400506pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400507 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500508 BareFnArgName::Named(_binding_0, ) => {
509 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500510 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400511 )
512 }
David Tolnay6702ade2017-12-30 23:38:15 -0500513 BareFnArgName::Wild(_binding_0, ) => {
514 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500515 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400516 )
517 }
518 }
519}
520
Nika Layzella6f46c42017-10-26 15:26:16 -0400521pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400522 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500523 BinOp::Add(_binding_0, ) => {
524 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500525 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400526 )
527 }
David Tolnay6702ade2017-12-30 23:38:15 -0500528 BinOp::Sub(_binding_0, ) => {
529 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500530 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400531 )
532 }
David Tolnay6702ade2017-12-30 23:38:15 -0500533 BinOp::Mul(_binding_0, ) => {
534 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500535 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400536 )
537 }
David Tolnay6702ade2017-12-30 23:38:15 -0500538 BinOp::Div(_binding_0, ) => {
539 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500540 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
David Tolnay6702ade2017-12-30 23:38:15 -0500543 BinOp::Rem(_binding_0, ) => {
544 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
David Tolnay6702ade2017-12-30 23:38:15 -0500548 BinOp::And(_binding_0, ) => {
549 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500550 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400551 )
552 }
David Tolnay6702ade2017-12-30 23:38:15 -0500553 BinOp::Or(_binding_0, ) => {
554 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
David Tolnay6702ade2017-12-30 23:38:15 -0500558 BinOp::BitXor(_binding_0, ) => {
559 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
David Tolnay6702ade2017-12-30 23:38:15 -0500563 BinOp::BitAnd(_binding_0, ) => {
564 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
David Tolnay6702ade2017-12-30 23:38:15 -0500568 BinOp::BitOr(_binding_0, ) => {
569 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
David Tolnay6702ade2017-12-30 23:38:15 -0500573 BinOp::Shl(_binding_0, ) => {
574 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
David Tolnay6702ade2017-12-30 23:38:15 -0500578 BinOp::Shr(_binding_0, ) => {
579 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
David Tolnay6702ade2017-12-30 23:38:15 -0500583 BinOp::Eq(_binding_0, ) => {
584 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
David Tolnay6702ade2017-12-30 23:38:15 -0500588 BinOp::Lt(_binding_0, ) => {
589 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
David Tolnay6702ade2017-12-30 23:38:15 -0500593 BinOp::Le(_binding_0, ) => {
594 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
David Tolnay6702ade2017-12-30 23:38:15 -0500598 BinOp::Ne(_binding_0, ) => {
599 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
David Tolnay6702ade2017-12-30 23:38:15 -0500603 BinOp::Ge(_binding_0, ) => {
604 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
David Tolnay6702ade2017-12-30 23:38:15 -0500608 BinOp::Gt(_binding_0, ) => {
609 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
David Tolnay6702ade2017-12-30 23:38:15 -0500613 BinOp::AddEq(_binding_0, ) => {
614 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
David Tolnay6702ade2017-12-30 23:38:15 -0500618 BinOp::SubEq(_binding_0, ) => {
619 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
David Tolnay6702ade2017-12-30 23:38:15 -0500623 BinOp::MulEq(_binding_0, ) => {
624 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
David Tolnay6702ade2017-12-30 23:38:15 -0500628 BinOp::DivEq(_binding_0, ) => {
629 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
David Tolnay6702ade2017-12-30 23:38:15 -0500633 BinOp::RemEq(_binding_0, ) => {
634 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
David Tolnay6702ade2017-12-30 23:38:15 -0500638 BinOp::BitXorEq(_binding_0, ) => {
639 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
David Tolnay6702ade2017-12-30 23:38:15 -0500643 BinOp::BitAndEq(_binding_0, ) => {
644 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
David Tolnay6702ade2017-12-30 23:38:15 -0500648 BinOp::BitOrEq(_binding_0, ) => {
649 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
David Tolnay6702ade2017-12-30 23:38:15 -0500653 BinOp::ShlEq(_binding_0, ) => {
654 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
David Tolnay6702ade2017-12-30 23:38:15 -0500658 BinOp::ShrEq(_binding_0, ) => {
659 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500660 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400661 )
662 }
663 }
664}
David Tolnay506e43a2017-12-29 11:34:36 -0500665
666pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
667 Binding {
668 ident: _visitor.fold_ident(_i . ident),
669 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
670 ty: _visitor.fold_type(_i . ty),
671 }
672}
Nika Layzell27726662017-10-24 23:16:35 -0400673# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400674pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400675 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500676 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400677 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
678 }
679}
680
Nika Layzella6f46c42017-10-26 15:26:16 -0400681pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400682 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500683 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
684 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400685 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500686 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400687 }
688}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500689
690pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
691 ConstParam {
692 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500693 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500694 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500695 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500696 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500697 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500698 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
699 }
700}
Nika Layzell27726662017-10-24 23:16:35 -0400701
David Tolnaye3d41b72017-12-31 15:24:00 -0500702pub fn fold_data<V: Folder + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
703 match _i {
704 Data::Struct(_binding_0, ) => {
705 Data::Struct (
706 _visitor.fold_data_struct(_binding_0),
707 )
708 }
709 Data::Enum(_binding_0, ) => {
710 Data::Enum (
711 _visitor.fold_data_enum(_binding_0),
712 )
713 }
714 Data::Union(_binding_0, ) => {
715 Data::Union (
716 _visitor.fold_data_union(_binding_0),
717 )
718 }
719 }
720}
721
722pub fn fold_data_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
723 DataEnum {
724 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
725 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
726 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
727 }
728}
729
730pub fn fold_data_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
731 DataStruct {
732 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
733 fields: _visitor.fold_fields(_i . fields),
734 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
735 }
736}
737
738pub fn fold_data_union<V: Folder + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
739 DataUnion {
740 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
741 fields: _visitor.fold_fields_named(_i . fields),
742 }
743}
744
Nika Layzella6f46c42017-10-26 15:26:16 -0400745pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400746 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400747 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500748 vis: _visitor.fold_visibility(_i . vis),
749 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400750 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500751 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400752 }
753}
754
Nika Layzella6f46c42017-10-26 15:26:16 -0400755pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400756 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500757 Expr::Box(_binding_0, ) => {
758 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400759 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400760 )
761 }
David Tolnay6702ade2017-12-30 23:38:15 -0500762 Expr::InPlace(_binding_0, ) => {
763 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400764 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400765 )
766 }
David Tolnay6702ade2017-12-30 23:38:15 -0500767 Expr::Array(_binding_0, ) => {
768 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400769 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400770 )
771 }
David Tolnay6702ade2017-12-30 23:38:15 -0500772 Expr::Call(_binding_0, ) => {
773 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400774 _visitor.fold_expr_call(_binding_0),
775 )
776 }
David Tolnay6702ade2017-12-30 23:38:15 -0500777 Expr::MethodCall(_binding_0, ) => {
778 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400779 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400780 )
781 }
David Tolnay6702ade2017-12-30 23:38:15 -0500782 Expr::Tuple(_binding_0, ) => {
783 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500784 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400785 )
786 }
David Tolnay6702ade2017-12-30 23:38:15 -0500787 Expr::Binary(_binding_0, ) => {
788 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400789 _visitor.fold_expr_binary(_binding_0),
790 )
791 }
David Tolnay6702ade2017-12-30 23:38:15 -0500792 Expr::Unary(_binding_0, ) => {
793 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400794 _visitor.fold_expr_unary(_binding_0),
795 )
796 }
David Tolnay6702ade2017-12-30 23:38:15 -0500797 Expr::Lit(_binding_0, ) => {
798 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500799 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
David Tolnay6702ade2017-12-30 23:38:15 -0500802 Expr::Cast(_binding_0, ) => {
803 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400804 _visitor.fold_expr_cast(_binding_0),
805 )
806 }
David Tolnay6702ade2017-12-30 23:38:15 -0500807 Expr::Type(_binding_0, ) => {
808 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500809 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
David Tolnay6702ade2017-12-30 23:38:15 -0500812 Expr::If(_binding_0, ) => {
813 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
David Tolnay6702ade2017-12-30 23:38:15 -0500817 Expr::IfLet(_binding_0, ) => {
818 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400819 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
David Tolnay6702ade2017-12-30 23:38:15 -0500822 Expr::While(_binding_0, ) => {
823 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
David Tolnay6702ade2017-12-30 23:38:15 -0500827 Expr::WhileLet(_binding_0, ) => {
828 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400829 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
David Tolnay6702ade2017-12-30 23:38:15 -0500832 Expr::ForLoop(_binding_0, ) => {
833 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
David Tolnay6702ade2017-12-30 23:38:15 -0500837 Expr::Loop(_binding_0, ) => {
838 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400839 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
David Tolnay6702ade2017-12-30 23:38:15 -0500842 Expr::Match(_binding_0, ) => {
843 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
David Tolnay6702ade2017-12-30 23:38:15 -0500847 Expr::Closure(_binding_0, ) => {
848 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
David Tolnay6702ade2017-12-30 23:38:15 -0500852 Expr::Unsafe(_binding_0, ) => {
853 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500854 full!(_visitor.fold_expr_unsafe(_binding_0)),
855 )
856 }
David Tolnay6702ade2017-12-30 23:38:15 -0500857 Expr::Block(_binding_0, ) => {
858 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
David Tolnay6702ade2017-12-30 23:38:15 -0500862 Expr::Assign(_binding_0, ) => {
863 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
David Tolnay6702ade2017-12-30 23:38:15 -0500867 Expr::AssignOp(_binding_0, ) => {
868 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
David Tolnay6702ade2017-12-30 23:38:15 -0500872 Expr::Field(_binding_0, ) => {
873 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
David Tolnay6702ade2017-12-30 23:38:15 -0500877 Expr::Index(_binding_0, ) => {
878 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400879 _visitor.fold_expr_index(_binding_0),
880 )
881 }
David Tolnay6702ade2017-12-30 23:38:15 -0500882 Expr::Range(_binding_0, ) => {
883 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
David Tolnay6702ade2017-12-30 23:38:15 -0500887 Expr::Path(_binding_0, ) => {
888 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400889 _visitor.fold_expr_path(_binding_0),
890 )
891 }
David Tolnay6702ade2017-12-30 23:38:15 -0500892 Expr::AddrOf(_binding_0, ) => {
893 Expr::AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
David Tolnay6702ade2017-12-30 23:38:15 -0500897 Expr::Break(_binding_0, ) => {
898 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400899 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
David Tolnay6702ade2017-12-30 23:38:15 -0500902 Expr::Continue(_binding_0, ) => {
903 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
David Tolnay6702ade2017-12-30 23:38:15 -0500907 Expr::Return(_binding_0, ) => {
908 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500909 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400910 )
911 }
David Tolnay6702ade2017-12-30 23:38:15 -0500912 Expr::Macro(_binding_0, ) => {
913 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500914 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
David Tolnay6702ade2017-12-30 23:38:15 -0500917 Expr::Struct(_binding_0, ) => {
918 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400919 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
David Tolnay6702ade2017-12-30 23:38:15 -0500922 Expr::Repeat(_binding_0, ) => {
923 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
David Tolnay6702ade2017-12-30 23:38:15 -0500927 Expr::Paren(_binding_0, ) => {
928 Expr::Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500929 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
David Tolnay6702ade2017-12-30 23:38:15 -0500932 Expr::Group(_binding_0, ) => {
933 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500934 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
David Tolnay6702ade2017-12-30 23:38:15 -0500937 Expr::Try(_binding_0, ) => {
938 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
David Tolnay6702ade2017-12-30 23:38:15 -0500942 Expr::Catch(_binding_0, ) => {
943 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400944 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400945 )
946 }
David Tolnay6702ade2017-12-30 23:38:15 -0500947 Expr::Yield(_binding_0, ) => {
948 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400949 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
David Tolnay6702ade2017-12-30 23:38:15 -0500952 Expr::Verbatim(_binding_0, ) => {
953 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500954 _visitor.fold_expr_verbatim(_binding_0),
955 )
956 }
Nika Layzell27726662017-10-24 23:16:35 -0400957 }
958}
959# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500960pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
961 ExprAddrOf {
962 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
963 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500964 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500965 expr: Box::new(_visitor.fold_expr(* _i . expr)),
966 }
967}
968# [ cfg ( feature = "full" ) ]
969pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
970 ExprArray {
971 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
972 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500973 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500974 }
975}
976# [ cfg ( feature = "full" ) ]
977pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
978 ExprAssign {
979 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
980 left: Box::new(_visitor.fold_expr(* _i . left)),
981 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
982 right: Box::new(_visitor.fold_expr(* _i . right)),
983 }
984}
985# [ cfg ( feature = "full" ) ]
986pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
987 ExprAssignOp {
988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
989 left: Box::new(_visitor.fold_expr(* _i . left)),
990 op: _visitor.fold_bin_op(_i . op),
991 right: Box::new(_visitor.fold_expr(* _i . right)),
992 }
993}
994
995pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
996 ExprBinary {
997 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
998 left: Box::new(_visitor.fold_expr(* _i . left)),
999 op: _visitor.fold_bin_op(_i . op),
1000 right: Box::new(_visitor.fold_expr(* _i . right)),
1001 }
1002}
1003# [ cfg ( feature = "full" ) ]
1004pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1005 ExprBlock {
1006 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1007 block: _visitor.fold_block(_i . block),
1008 }
1009}
1010# [ cfg ( feature = "full" ) ]
1011pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1012 ExprBox {
1013 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1014 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1015 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1016 }
1017}
1018# [ cfg ( feature = "full" ) ]
1019pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1020 ExprBreak {
1021 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1022 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1023 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1024 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1025 }
1026}
1027
1028pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1029 ExprCall {
1030 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1031 func: Box::new(_visitor.fold_expr(* _i . func)),
1032 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1033 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1034 }
1035}
1036
1037pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1038 ExprCast {
1039 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1040 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1041 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1042 ty: Box::new(_visitor.fold_type(* _i . ty)),
1043 }
1044}
1045# [ cfg ( feature = "full" ) ]
1046pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1047 ExprCatch {
1048 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1049 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1050 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1051 block: _visitor.fold_block(_i . block),
1052 }
1053}
1054# [ cfg ( feature = "full" ) ]
1055pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1056 ExprClosure {
1057 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001058 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001059 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1060 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1061 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1062 output: _visitor.fold_return_type(_i . output),
1063 body: Box::new(_visitor.fold_expr(* _i . body)),
1064 }
1065}
1066# [ cfg ( feature = "full" ) ]
1067pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1068 ExprContinue {
1069 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1070 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1071 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1072 }
1073}
1074# [ cfg ( feature = "full" ) ]
1075pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1076 ExprField {
1077 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1078 base: Box::new(_visitor.fold_expr(* _i . base)),
1079 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1080 member: _visitor.fold_member(_i . member),
1081 }
1082}
1083# [ cfg ( feature = "full" ) ]
1084pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1085 ExprForLoop {
1086 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001087 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001088 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1089 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1090 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1091 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1092 body: _visitor.fold_block(_i . body),
1093 }
1094}
David Tolnaye98775f2017-12-28 23:17:00 -05001095# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001096pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1097 ExprGroup {
1098 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1099 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1100 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1101 }
1102}
1103# [ cfg ( feature = "full" ) ]
1104pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1105 ExprIf {
1106 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1107 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1108 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001109 then_branch: _visitor.fold_block(_i . then_branch),
1110 else_branch: (_i . else_branch).map(|it| { (
1111 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1112 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1113 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001114 }
1115}
1116# [ cfg ( feature = "full" ) ]
1117pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1118 ExprIfLet {
1119 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1120 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1121 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1122 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1123 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1124 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001125 then_branch: _visitor.fold_block(_i . then_branch),
1126 else_branch: (_i . else_branch).map(|it| { (
1127 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1128 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1129 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001130 }
1131}
1132# [ cfg ( feature = "full" ) ]
1133pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1134 ExprInPlace {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001137 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001138 value: Box::new(_visitor.fold_expr(* _i . value)),
1139 }
1140}
1141
1142pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1143 ExprIndex {
1144 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1145 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1146 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1147 index: Box::new(_visitor.fold_expr(* _i . index)),
1148 }
1149}
1150
1151pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1152 ExprLit {
1153 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1154 lit: _visitor.fold_lit(_i . lit),
1155 }
1156}
1157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001158pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001159 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001160 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001161 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001162 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1163 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001164 }
1165}
1166# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001167pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1168 ExprMacro {
1169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1170 mac: _visitor.fold_macro(_i . mac),
1171 }
1172}
1173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001174pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001175 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001176 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001177 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001178 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001179 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001180 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1181 }
1182}
1183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001184pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001185 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001186 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001187 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001188 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001189 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001190 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001191 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1192 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001193 }
1194}
David Tolnaye98775f2017-12-28 23:17:00 -05001195# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001196pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001197 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001198 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001199 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
1202}
1203
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001207 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001208 path: _visitor.fold_path(_i . path),
1209 }
1210}
1211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001212pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001213 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001214 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001215 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001216 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
1219}
1220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001221pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001222 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001223 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001224 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001225 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001226 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001227 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1228 }
1229}
1230# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001231pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1232 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001233 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001234 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001235 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
1237}
1238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001239pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001240 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001241 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001242 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001243 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001244 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1245 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1246 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001247 }
1248}
1249# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001250pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001251 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001252 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001253 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001254 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001258pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1259 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001261 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001262 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001263 }
1264}
David Tolnay0cf94f22017-12-28 23:46:26 -05001265# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001266pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001267 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001268 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001269 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001270 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001271 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
1273}
1274
Nika Layzella6f46c42017-10-26 15:26:16 -04001275pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001276 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001277 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001278 op: _visitor.fold_un_op(_i . op),
1279 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1280 }
1281}
1282# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001283pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1284 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001285 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001286 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001287 block: _visitor.fold_block(_i . block),
1288 }
1289}
David Tolnay2ae520a2017-12-29 11:19:50 -05001290
1291pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1292 ExprVerbatim {
1293 tts: _i . tts,
1294 }
1295}
Nika Layzell640832a2017-12-04 13:37:09 -05001296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001297pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001298 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001299 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001300 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001301 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001302 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1303 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001304 }
1305}
1306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001307pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001308 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001310 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001311 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1312 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001313 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001314 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001315 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1316 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001317 }
1318}
1319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001320pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001321 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001322 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001323 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001324 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001325 }
1326}
1327
Nika Layzella6f46c42017-10-26 15:26:16 -04001328pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001329 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001330 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001331 vis: _visitor.fold_visibility(_i . vis),
1332 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001333 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001334 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001335 }
1336}
1337# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001338pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001339 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001340 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001341 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001342 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001343 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001344 }
1345}
1346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001347pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001348 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001349 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1350 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001351 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001352 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001353 }
1354}
David Tolnaye3d41b72017-12-31 15:24:00 -05001355
1356pub fn fold_fields<V: Folder + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
1357 match _i {
1358 Fields::Named(_binding_0, ) => {
1359 Fields::Named (
1360 _visitor.fold_fields_named(_binding_0),
1361 )
1362 }
1363 Fields::Unnamed(_binding_0, ) => {
1364 Fields::Unnamed (
1365 _visitor.fold_fields_unnamed(_binding_0),
1366 )
1367 }
1368 Fields::Unit => { Fields::Unit }
1369 }
1370}
1371
1372pub fn fold_fields_named<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
1373 FieldsNamed {
1374 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001375 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001376 }
1377}
1378
1379pub fn fold_fields_unnamed<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
1380 FieldsUnnamed {
1381 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001382 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001383 }
1384}
Nika Layzell27726662017-10-24 23:16:35 -04001385# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001386pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001387 File {
1388 shebang: _i . shebang,
1389 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1390 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1391 }
1392}
1393# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001394pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001395 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001396 FnArg::SelfRef(_binding_0, ) => {
1397 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001398 _visitor.fold_arg_self_ref(_binding_0),
1399 )
1400 }
David Tolnay6702ade2017-12-30 23:38:15 -05001401 FnArg::SelfValue(_binding_0, ) => {
1402 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001403 _visitor.fold_arg_self(_binding_0),
1404 )
1405 }
David Tolnay6702ade2017-12-30 23:38:15 -05001406 FnArg::Captured(_binding_0, ) => {
1407 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001408 _visitor.fold_arg_captured(_binding_0),
1409 )
1410 }
David Tolnay6702ade2017-12-30 23:38:15 -05001411 FnArg::Inferred(_binding_0, ) => {
1412 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001413 _visitor.fold_pat(_binding_0),
1414 )
1415 }
David Tolnay6702ade2017-12-30 23:38:15 -05001416 FnArg::Ignored(_binding_0, ) => {
1417 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001418 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001419 )
1420 }
1421 }
1422}
1423# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001424pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001425 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001426 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001427 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001428 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001429 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001430 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001431 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001432 }
1433}
1434# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001435pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001436 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001437 ForeignItem::Fn(_binding_0, ) => {
1438 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001439 _visitor.fold_foreign_item_fn(_binding_0),
1440 )
1441 }
David Tolnay6702ade2017-12-30 23:38:15 -05001442 ForeignItem::Static(_binding_0, ) => {
1443 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001444 _visitor.fold_foreign_item_static(_binding_0),
1445 )
1446 }
David Tolnay6702ade2017-12-30 23:38:15 -05001447 ForeignItem::Type(_binding_0, ) => {
1448 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001449 _visitor.fold_foreign_item_type(_binding_0),
1450 )
1451 }
David Tolnay6702ade2017-12-30 23:38:15 -05001452 ForeignItem::Verbatim(_binding_0, ) => {
1453 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001454 _visitor.fold_foreign_item_verbatim(_binding_0),
1455 )
1456 }
Nika Layzell27726662017-10-24 23:16:35 -04001457 }
1458}
1459# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001460pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1461 ForeignItemFn {
1462 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1463 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001464 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001465 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001466 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001467 }
1468}
1469# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001470pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001471 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001472 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1473 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001474 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001475 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001476 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001477 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001478 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001479 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001480 }
1481}
David Tolnay199bcbb2017-11-12 10:33:52 -08001482# [ cfg ( feature = "full" ) ]
1483pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1484 ForeignItemType {
1485 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1486 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001487 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001488 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001489 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001490 }
1491}
David Tolnay2ae520a2017-12-29 11:19:50 -05001492# [ cfg ( feature = "full" ) ]
1493pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1494 ForeignItemVerbatim {
1495 tts: _i . tts,
1496 }
1497}
Nika Layzell27726662017-10-24 23:16:35 -04001498
Nika Layzellc08227a2017-12-04 16:30:17 -05001499pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001500 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001501 GenericArgument::Lifetime(_binding_0, ) => {
1502 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001503 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001504 )
1505 }
David Tolnay6702ade2017-12-30 23:38:15 -05001506 GenericArgument::Type(_binding_0, ) => {
1507 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001508 _visitor.fold_type(_binding_0),
1509 )
1510 }
David Tolnay6702ade2017-12-30 23:38:15 -05001511 GenericArgument::Binding(_binding_0, ) => {
1512 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001513 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001514 )
1515 }
David Tolnay6702ade2017-12-30 23:38:15 -05001516 GenericArgument::Const(_binding_0, ) => {
1517 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001518 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001519 )
1520 }
Nika Layzell357885a2017-12-04 15:47:07 -05001521 }
1522}
David Tolnayd60cfec2017-12-29 00:21:38 -05001523# [ cfg ( feature = "full" ) ]
1524pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001525 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001526 GenericMethodArgument::Type(_binding_0, ) => {
1527 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001528 _visitor.fold_type(_binding_0),
1529 )
1530 }
David Tolnay6702ade2017-12-30 23:38:15 -05001531 GenericMethodArgument::Const(_binding_0, ) => {
1532 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001533 _visitor.fold_expr(_binding_0),
1534 )
1535 }
1536 }
1537}
Nika Layzell357885a2017-12-04 15:47:07 -05001538
David Tolnayc2f1aba2017-11-12 20:29:22 -08001539pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001540 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001541 GenericParam::Lifetime(_binding_0, ) => {
1542 GenericParam::Lifetime (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001543 _visitor.fold_lifetime_def(_binding_0),
1544 )
1545 }
David Tolnay6702ade2017-12-30 23:38:15 -05001546 GenericParam::Type(_binding_0, ) => {
1547 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001548 _visitor.fold_type_param(_binding_0),
1549 )
1550 }
David Tolnay6702ade2017-12-30 23:38:15 -05001551 GenericParam::Const(_binding_0, ) => {
1552 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001553 _visitor.fold_const_param(_binding_0),
1554 )
1555 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001556 }
1557}
1558
Nika Layzella6f46c42017-10-26 15:26:16 -04001559pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001560 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001561 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001562 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001563 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001564 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001565 }
1566}
1567# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001568pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001569 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001570 ImplItem::Const(_binding_0, ) => {
1571 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001572 _visitor.fold_impl_item_const(_binding_0),
1573 )
1574 }
David Tolnay6702ade2017-12-30 23:38:15 -05001575 ImplItem::Method(_binding_0, ) => {
1576 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001577 _visitor.fold_impl_item_method(_binding_0),
1578 )
1579 }
David Tolnay6702ade2017-12-30 23:38:15 -05001580 ImplItem::Type(_binding_0, ) => {
1581 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001582 _visitor.fold_impl_item_type(_binding_0),
1583 )
1584 }
David Tolnay6702ade2017-12-30 23:38:15 -05001585 ImplItem::Macro(_binding_0, ) => {
1586 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001587 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001588 )
1589 }
David Tolnay6702ade2017-12-30 23:38:15 -05001590 ImplItem::Verbatim(_binding_0, ) => {
1591 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001592 _visitor.fold_impl_item_verbatim(_binding_0),
1593 )
1594 }
Nika Layzell27726662017-10-24 23:16:35 -04001595 }
1596}
1597# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001598pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1599 ImplItemConst {
1600 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1601 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001602 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001603 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001604 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001605 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001606 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001607 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001608 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001609 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001610 }
1611}
1612# [ cfg ( feature = "full" ) ]
1613pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1614 ImplItemMacro {
1615 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1616 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001617 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001618 }
1619}
1620# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001621pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001622 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001623 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001624 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001625 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001626 sig: _visitor.fold_method_sig(_i . sig),
1627 block: _visitor.fold_block(_i . block),
1628 }
1629}
1630# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001631pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001632 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001633 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001634 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001635 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001636 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001637 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001638 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001639 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001640 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001641 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001642 }
1643}
David Tolnay2ae520a2017-12-29 11:19:50 -05001644# [ cfg ( feature = "full" ) ]
1645pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1646 ImplItemVerbatim {
1647 tts: _i . tts,
1648 }
1649}
David Tolnay14982012017-12-29 00:49:51 -05001650
David Tolnay85b69a42017-12-27 20:43:10 -05001651pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1652 Index {
1653 index: _i . index,
1654 span: _visitor.fold_span(_i . span),
1655 }
1656}
1657# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001658pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001659 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001660 Item::ExternCrate(_binding_0, ) => {
1661 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001662 _visitor.fold_item_extern_crate(_binding_0),
1663 )
1664 }
David Tolnay6702ade2017-12-30 23:38:15 -05001665 Item::Use(_binding_0, ) => {
1666 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001667 _visitor.fold_item_use(_binding_0),
1668 )
1669 }
David Tolnay6702ade2017-12-30 23:38:15 -05001670 Item::Static(_binding_0, ) => {
1671 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001672 _visitor.fold_item_static(_binding_0),
1673 )
1674 }
David Tolnay6702ade2017-12-30 23:38:15 -05001675 Item::Const(_binding_0, ) => {
1676 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001677 _visitor.fold_item_const(_binding_0),
1678 )
1679 }
David Tolnay6702ade2017-12-30 23:38:15 -05001680 Item::Fn(_binding_0, ) => {
1681 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001682 _visitor.fold_item_fn(_binding_0),
1683 )
1684 }
David Tolnay6702ade2017-12-30 23:38:15 -05001685 Item::Mod(_binding_0, ) => {
1686 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001687 _visitor.fold_item_mod(_binding_0),
1688 )
1689 }
David Tolnay6702ade2017-12-30 23:38:15 -05001690 Item::ForeignMod(_binding_0, ) => {
1691 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001692 _visitor.fold_item_foreign_mod(_binding_0),
1693 )
1694 }
David Tolnay6702ade2017-12-30 23:38:15 -05001695 Item::Type(_binding_0, ) => {
1696 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001697 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001698 )
1699 }
David Tolnay6702ade2017-12-30 23:38:15 -05001700 Item::Struct(_binding_0, ) => {
1701 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001702 _visitor.fold_item_struct(_binding_0),
1703 )
1704 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001705 Item::Enum(_binding_0, ) => {
1706 Item::Enum (
1707 _visitor.fold_item_enum(_binding_0),
1708 )
1709 }
David Tolnay6702ade2017-12-30 23:38:15 -05001710 Item::Union(_binding_0, ) => {
1711 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001712 _visitor.fold_item_union(_binding_0),
1713 )
1714 }
David Tolnay6702ade2017-12-30 23:38:15 -05001715 Item::Trait(_binding_0, ) => {
1716 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001717 _visitor.fold_item_trait(_binding_0),
1718 )
1719 }
David Tolnay6702ade2017-12-30 23:38:15 -05001720 Item::Impl(_binding_0, ) => {
1721 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001722 _visitor.fold_item_impl(_binding_0),
1723 )
1724 }
David Tolnay6702ade2017-12-30 23:38:15 -05001725 Item::Macro(_binding_0, ) => {
1726 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001727 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001728 )
1729 }
David Tolnay6702ade2017-12-30 23:38:15 -05001730 Item::Macro2(_binding_0, ) => {
1731 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001732 _visitor.fold_item_macro2(_binding_0),
1733 )
1734 }
David Tolnay6702ade2017-12-30 23:38:15 -05001735 Item::Verbatim(_binding_0, ) => {
1736 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001737 _visitor.fold_item_verbatim(_binding_0),
1738 )
1739 }
Nika Layzell27726662017-10-24 23:16:35 -04001740 }
1741}
1742# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1744 ItemConst {
1745 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1746 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001747 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001748 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001749 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001750 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001751 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001752 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001753 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754 }
1755}
1756# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1758 ItemEnum {
1759 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1760 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001761 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001762 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001763 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001764 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001765 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1766 }
1767}
1768# [ cfg ( feature = "full" ) ]
1769pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1770 ItemExternCrate {
1771 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1772 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001773 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1774 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001775 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001776 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001777 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001778 _visitor.fold_ident(( it ) . 1),
1779 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 }
1782}
1783# [ cfg ( feature = "full" ) ]
1784pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1785 ItemFn {
1786 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1787 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001788 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001789 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001790 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001791 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001792 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 block: Box::new(_visitor.fold_block(* _i . block)),
1794 }
1795}
1796# [ cfg ( feature = "full" ) ]
1797pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1798 ItemForeignMod {
1799 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1800 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001801 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001802 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1803 }
1804}
1805# [ cfg ( feature = "full" ) ]
1806pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1807 ItemImpl {
1808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001809 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001810 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001811 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001813 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001814 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001815 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001816 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001817 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001818 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001819 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1821 }
1822}
1823# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001824pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1825 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001826 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001827 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001828 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001829 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001830 }
1831}
1832# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001833pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1834 ItemMacro2 {
1835 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1836 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001837 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001838 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001839 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001840 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001841 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001842 body: _i . body,
1843 }
1844}
1845# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001846pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001847 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001848 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001849 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001851 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001852 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001853 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001854 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1855 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001857 }
1858}
1859# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001860pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001861 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001862 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001863 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001865 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001866 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001868 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001869 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001870 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001872 }
1873}
1874# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001875pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001876 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001877 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001878 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001879 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001880 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001881 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001882 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
1885}
1886# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001888 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001891 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001892 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1893 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001894 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001895 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001896 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001897 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001898 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001899 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1900 }
1901}
1902# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001903pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1904 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001905 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001906 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001907 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001908 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001909 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001911 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001912 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001913 }
1914}
1915# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001916pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001917 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001918 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001919 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001920 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001921 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001922 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001923 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001924 }
1925}
1926# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001927pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001928 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001929 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001930 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001931 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1932 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001933 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1934 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001935 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001936 }
1937}
David Tolnay2ae520a2017-12-29 11:19:50 -05001938# [ cfg ( feature = "full" ) ]
1939pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1940 ItemVerbatim {
1941 tts: _i . tts,
1942 }
1943}
David Tolnaybcd498f2017-12-29 12:02:33 -05001944# [ cfg ( feature = "full" ) ]
1945pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1946 Label {
1947 name: _visitor.fold_lifetime(_i . name),
1948 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1949 }
1950}
Nika Layzell27726662017-10-24 23:16:35 -04001951
Nika Layzella6f46c42017-10-26 15:26:16 -04001952pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001953 LifetimeDef {
1954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001955 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001956 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001957 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1958 }
1959}
1960
1961pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1962 Lit {
1963 value: _i . value,
1964 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001965 }
1966}
1967# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001968pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001969 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001970 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001971 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1972 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05001973 ty: (_i . ty).map(|it| { (
1974 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
1975 Box::new(_visitor.fold_type(* ( it ) . 1)),
1976 ) }),
1977 init: (_i . init).map(|it| { (
1978 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
1979 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1980 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001981 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001982 }
1983}
Nika Layzell27726662017-10-24 23:16:35 -04001984
David Tolnaydecf28d2017-11-11 11:56:45 -08001985pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1986 Macro {
1987 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001988 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05001989 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
1990 tts: _i . tts,
1991 }
1992}
1993
1994pub fn fold_macro_delimiter<V: Folder + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05001995 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001996 MacroDelimiter::Paren(_binding_0, ) => {
1997 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05001998 Paren(tokens_helper(_visitor, &(_binding_0).0)),
1999 )
2000 }
David Tolnay6702ade2017-12-30 23:38:15 -05002001 MacroDelimiter::Brace(_binding_0, ) => {
2002 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002003 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2004 )
2005 }
David Tolnay6702ade2017-12-30 23:38:15 -05002006 MacroDelimiter::Bracket(_binding_0, ) => {
2007 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002008 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2009 )
2010 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002011 }
2012}
David Tolnay14982012017-12-29 00:49:51 -05002013
David Tolnay85b69a42017-12-27 20:43:10 -05002014pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002015 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002016 Member::Named(_binding_0, ) => {
2017 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05002018 _visitor.fold_ident(_binding_0),
2019 )
2020 }
David Tolnay6702ade2017-12-30 23:38:15 -05002021 Member::Unnamed(_binding_0, ) => {
2022 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002023 _visitor.fold_index(_binding_0),
2024 )
2025 }
2026 }
2027}
David Tolnaydecf28d2017-11-11 11:56:45 -08002028
Nika Layzella6f46c42017-10-26 15:26:16 -04002029pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002030 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002031 MetaItem::Term(_binding_0, ) => {
2032 MetaItem::Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002033 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002034 )
2035 }
David Tolnay6702ade2017-12-30 23:38:15 -05002036 MetaItem::List(_binding_0, ) => {
2037 MetaItem::List (
Nika Layzell27726662017-10-24 23:16:35 -04002038 _visitor.fold_meta_item_list(_binding_0),
2039 )
2040 }
David Tolnay6702ade2017-12-30 23:38:15 -05002041 MetaItem::NameValue(_binding_0, ) => {
2042 MetaItem::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002043 _visitor.fold_meta_name_value(_binding_0),
2044 )
2045 }
2046 }
2047}
2048
Nika Layzella6f46c42017-10-26 15:26:16 -04002049pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002050 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002051 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002052 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002053 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2054 }
2055}
2056
Nika Layzella6f46c42017-10-26 15:26:16 -04002057pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002058 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002059 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002060 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002061 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002062 }
2063}
2064# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002065pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002066 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002067 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002068 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002069 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002070 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002071 decl: _visitor.fold_fn_decl(_i . decl),
2072 }
2073}
David Tolnayd60cfec2017-12-29 00:21:38 -05002074# [ cfg ( feature = "full" ) ]
2075pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2076 MethodTurbofish {
2077 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2078 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2079 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2080 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2081 }
2082}
Nika Layzell27726662017-10-24 23:16:35 -04002083
Nika Layzella6f46c42017-10-26 15:26:16 -04002084pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002085 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002086 NestedMetaItem::MetaItem(_binding_0, ) => {
2087 NestedMetaItem::MetaItem (
Nika Layzell27726662017-10-24 23:16:35 -04002088 _visitor.fold_meta_item(_binding_0),
2089 )
2090 }
David Tolnay6702ade2017-12-30 23:38:15 -05002091 NestedMetaItem::Literal(_binding_0, ) => {
2092 NestedMetaItem::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002093 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002094 )
2095 }
2096 }
2097}
2098
Nika Layzellc08227a2017-12-04 16:30:17 -05002099pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2100 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002101 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002102 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002103 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002104 }
2105}
2106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002107pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002108 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002109 Pat::Wild(_binding_0, ) => {
2110 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002111 _visitor.fold_pat_wild(_binding_0),
2112 )
2113 }
David Tolnay6702ade2017-12-30 23:38:15 -05002114 Pat::Ident(_binding_0, ) => {
2115 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002116 _visitor.fold_pat_ident(_binding_0),
2117 )
2118 }
David Tolnay6702ade2017-12-30 23:38:15 -05002119 Pat::Struct(_binding_0, ) => {
2120 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002121 _visitor.fold_pat_struct(_binding_0),
2122 )
2123 }
David Tolnay6702ade2017-12-30 23:38:15 -05002124 Pat::TupleStruct(_binding_0, ) => {
2125 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002126 _visitor.fold_pat_tuple_struct(_binding_0),
2127 )
2128 }
David Tolnay6702ade2017-12-30 23:38:15 -05002129 Pat::Path(_binding_0, ) => {
2130 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002131 _visitor.fold_pat_path(_binding_0),
2132 )
2133 }
David Tolnay6702ade2017-12-30 23:38:15 -05002134 Pat::Tuple(_binding_0, ) => {
2135 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002136 _visitor.fold_pat_tuple(_binding_0),
2137 )
2138 }
David Tolnay6702ade2017-12-30 23:38:15 -05002139 Pat::Box(_binding_0, ) => {
2140 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002141 _visitor.fold_pat_box(_binding_0),
2142 )
2143 }
David Tolnay6702ade2017-12-30 23:38:15 -05002144 Pat::Ref(_binding_0, ) => {
2145 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002146 _visitor.fold_pat_ref(_binding_0),
2147 )
2148 }
David Tolnay6702ade2017-12-30 23:38:15 -05002149 Pat::Lit(_binding_0, ) => {
2150 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002151 _visitor.fold_pat_lit(_binding_0),
2152 )
2153 }
David Tolnay6702ade2017-12-30 23:38:15 -05002154 Pat::Range(_binding_0, ) => {
2155 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002156 _visitor.fold_pat_range(_binding_0),
2157 )
2158 }
David Tolnay6702ade2017-12-30 23:38:15 -05002159 Pat::Slice(_binding_0, ) => {
2160 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002161 _visitor.fold_pat_slice(_binding_0),
2162 )
2163 }
David Tolnay6702ade2017-12-30 23:38:15 -05002164 Pat::Macro(_binding_0, ) => {
2165 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002166 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002167 )
2168 }
David Tolnay6702ade2017-12-30 23:38:15 -05002169 Pat::Verbatim(_binding_0, ) => {
2170 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002171 _visitor.fold_pat_verbatim(_binding_0),
2172 )
2173 }
Nika Layzell27726662017-10-24 23:16:35 -04002174 }
2175}
2176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002177pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002178 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002179 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002180 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
2182}
2183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002184pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002185 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002186 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2187 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002188 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002189 subpat: (_i . subpat).map(|it| { (
2190 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2191 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2192 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002193 }
2194}
2195# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002196pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002197 PatLit {
2198 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2199 }
2200}
2201# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002202pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2203 PatMacro {
2204 mac: _visitor.fold_macro(_i . mac),
2205 }
2206}
2207# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002208pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002209 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002210 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002211 path: _visitor.fold_path(_i . path),
2212 }
2213}
2214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002215pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002216 PatRange {
2217 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002218 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002219 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002220 }
2221}
2222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002223pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002224 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002225 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002226 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002227 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002228 }
2229}
2230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002231pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002232 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002233 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002234 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002235 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002236 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002237 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002238 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002239 }
2240}
2241# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002242pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002243 PatStruct {
2244 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002245 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002246 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002247 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002248 }
2249}
2250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002251pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002252 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002253 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002254 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002255 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002256 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2257 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002258 }
2259}
2260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002261pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002262 PatTupleStruct {
2263 path: _visitor.fold_path(_i . path),
2264 pat: _visitor.fold_pat_tuple(_i . pat),
2265 }
2266}
2267# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002268pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2269 PatVerbatim {
2270 tts: _i . tts,
2271 }
2272}
2273# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002274pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002275 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002276 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002277 }
2278}
2279
Nika Layzella6f46c42017-10-26 15:26:16 -04002280pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002281 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002282 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002283 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2284 }
2285}
Nika Layzellc08227a2017-12-04 16:30:17 -05002286
2287pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002288 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002289 PathArguments::None => { PathArguments::None }
2290 PathArguments::AngleBracketed(_binding_0, ) => {
2291 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002292 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2293 )
2294 }
David Tolnay6702ade2017-12-30 23:38:15 -05002295 PathArguments::Parenthesized(_binding_0, ) => {
2296 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002297 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2298 )
2299 }
2300 }
2301}
Nika Layzell27726662017-10-24 23:16:35 -04002302
Nika Layzella6f46c42017-10-26 15:26:16 -04002303pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002304 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002305 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002306 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002307 }
2308}
Nika Layzell27726662017-10-24 23:16:35 -04002309
Nika Layzella6f46c42017-10-26 15:26:16 -04002310pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002311 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002312 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002313 trait_ref: _visitor.fold_path(_i . trait_ref),
2314 }
2315}
2316
David Tolnayd4add852018-01-01 20:13:24 -08002317pub fn fold_predicate_eq<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
2318 PredicateEq {
2319 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2320 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2321 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2322 }
2323}
2324
2325pub fn fold_predicate_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
2326 PredicateLifetime {
2327 lifetime: _visitor.fold_lifetime(_i . lifetime),
2328 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2329 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2330 }
2331}
2332
2333pub fn fold_predicate_type<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
2334 PredicateType {
2335 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2336 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2337 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2338 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2339 }
2340}
2341
Nika Layzella6f46c42017-10-26 15:26:16 -04002342pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002343 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002344 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002345 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002346 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002347 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2348 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002349 }
2350}
2351# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002352pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002353 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002354 RangeLimits::HalfOpen(_binding_0, ) => {
2355 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002356 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002357 )
2358 }
David Tolnay6702ade2017-12-30 23:38:15 -05002359 RangeLimits::Closed(_binding_0, ) => {
2360 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002361 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002362 )
2363 }
2364 }
2365}
David Tolnayf93b90d2017-11-11 19:21:26 -08002366
2367pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002368 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002369 ReturnType::Default => { ReturnType::Default }
2370 ReturnType::Type(_binding_0, _binding_1, ) => {
2371 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002372 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2373 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002374 )
2375 }
2376 }
2377}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002378
2379pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2380 _i
2381}
Nika Layzell27726662017-10-24 23:16:35 -04002382# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002383pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002384 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002385 Stmt::Local(_binding_0, ) => {
2386 Stmt::Local (
Nika Layzell27726662017-10-24 23:16:35 -04002387 Box::new(_visitor.fold_local(* _binding_0)),
2388 )
2389 }
David Tolnay6702ade2017-12-30 23:38:15 -05002390 Stmt::Item(_binding_0, ) => {
2391 Stmt::Item (
Nika Layzell27726662017-10-24 23:16:35 -04002392 Box::new(_visitor.fold_item(* _binding_0)),
2393 )
2394 }
David Tolnay6702ade2017-12-30 23:38:15 -05002395 Stmt::Expr(_binding_0, ) => {
2396 Stmt::Expr (
Nika Layzell27726662017-10-24 23:16:35 -04002397 Box::new(_visitor.fold_expr(* _binding_0)),
2398 )
2399 }
David Tolnay6702ade2017-12-30 23:38:15 -05002400 Stmt::Semi(_binding_0, _binding_1, ) => {
2401 Stmt::Semi (
Nika Layzell27726662017-10-24 23:16:35 -04002402 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002403 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002404 )
2405 }
Nika Layzell27726662017-10-24 23:16:35 -04002406 }
2407}
2408
Nika Layzella6f46c42017-10-26 15:26:16 -04002409pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002410 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002411 TraitBoundModifier::None => { TraitBoundModifier::None }
2412 TraitBoundModifier::Maybe(_binding_0, ) => {
2413 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002414 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002415 )
2416 }
2417 }
2418}
2419# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002420pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002421 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002422 TraitItem::Const(_binding_0, ) => {
2423 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002424 _visitor.fold_trait_item_const(_binding_0),
2425 )
2426 }
David Tolnay6702ade2017-12-30 23:38:15 -05002427 TraitItem::Method(_binding_0, ) => {
2428 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002429 _visitor.fold_trait_item_method(_binding_0),
2430 )
2431 }
David Tolnay6702ade2017-12-30 23:38:15 -05002432 TraitItem::Type(_binding_0, ) => {
2433 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002434 _visitor.fold_trait_item_type(_binding_0),
2435 )
2436 }
David Tolnay6702ade2017-12-30 23:38:15 -05002437 TraitItem::Macro(_binding_0, ) => {
2438 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002439 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
David Tolnay6702ade2017-12-30 23:38:15 -05002442 TraitItem::Verbatim(_binding_0, ) => {
2443 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002444 _visitor.fold_trait_item_verbatim(_binding_0),
2445 )
2446 }
Nika Layzell27726662017-10-24 23:16:35 -04002447 }
2448}
2449# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002450pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2451 TraitItemConst {
2452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002453 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002454 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002455 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002456 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002457 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002458 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002459 _visitor.fold_expr(( it ) . 1),
2460 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002461 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002462 }
2463}
2464# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002465pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2466 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002467 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002468 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002469 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002470 }
2471}
2472# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002473pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002474 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002475 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002476 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002477 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002478 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002479 }
2480}
2481# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002482pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002483 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002484 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002485 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002486 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002487 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002488 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002489 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002490 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002491 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002492 _visitor.fold_type(( it ) . 1),
2493 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002494 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002495 }
2496}
David Tolnay2ae520a2017-12-29 11:19:50 -05002497# [ cfg ( feature = "full" ) ]
2498pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2499 TraitItemVerbatim {
2500 tts: _i . tts,
2501 }
2502}
Nika Layzell27726662017-10-24 23:16:35 -04002503
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002504pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002505 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002506 Type::Slice(_binding_0, ) => {
2507 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002508 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002509 )
2510 }
David Tolnay6702ade2017-12-30 23:38:15 -05002511 Type::Array(_binding_0, ) => {
2512 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002513 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002514 )
2515 }
David Tolnay6702ade2017-12-30 23:38:15 -05002516 Type::Ptr(_binding_0, ) => {
2517 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002519 )
2520 }
David Tolnay6702ade2017-12-30 23:38:15 -05002521 Type::Reference(_binding_0, ) => {
2522 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002523 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002524 )
2525 }
David Tolnay6702ade2017-12-30 23:38:15 -05002526 Type::BareFn(_binding_0, ) => {
2527 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002528 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002529 )
2530 }
David Tolnay6702ade2017-12-30 23:38:15 -05002531 Type::Never(_binding_0, ) => {
2532 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002534 )
2535 }
David Tolnay6702ade2017-12-30 23:38:15 -05002536 Type::Tuple(_binding_0, ) => {
2537 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002538 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002539 )
2540 }
David Tolnay6702ade2017-12-30 23:38:15 -05002541 Type::Path(_binding_0, ) => {
2542 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002544 )
2545 }
David Tolnay6702ade2017-12-30 23:38:15 -05002546 Type::TraitObject(_binding_0, ) => {
2547 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002548 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002549 )
2550 }
David Tolnay6702ade2017-12-30 23:38:15 -05002551 Type::ImplTrait(_binding_0, ) => {
2552 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002553 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002554 )
2555 }
David Tolnay6702ade2017-12-30 23:38:15 -05002556 Type::Paren(_binding_0, ) => {
2557 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002558 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002559 )
2560 }
David Tolnay6702ade2017-12-30 23:38:15 -05002561 Type::Group(_binding_0, ) => {
2562 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002563 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002564 )
2565 }
David Tolnay6702ade2017-12-30 23:38:15 -05002566 Type::Infer(_binding_0, ) => {
2567 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002569 )
2570 }
David Tolnay6702ade2017-12-30 23:38:15 -05002571 Type::Macro(_binding_0, ) => {
2572 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002573 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002574 )
2575 }
David Tolnay6702ade2017-12-30 23:38:15 -05002576 Type::Verbatim(_binding_0, ) => {
2577 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002578 _visitor.fold_type_verbatim(_binding_0),
2579 )
2580 }
Nika Layzell27726662017-10-24 23:16:35 -04002581 }
2582}
2583
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002584pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2585 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002586 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002587 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002588 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002589 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002590 }
2591}
2592
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002593pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2594 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002595 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2596 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2597 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2598 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2599 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2600 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2601 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2602 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002603 }
2604}
2605
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002606pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2607 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002608 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002609 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002610 }
2611}
2612
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002613pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2614 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002615 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002616 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002617 }
2618}
2619
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002620pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2621 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002622 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002623 }
2624}
2625
David Tolnay323279a2017-12-29 11:26:32 -05002626pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2627 TypeMacro {
2628 mac: _visitor.fold_macro(_i . mac),
2629 }
2630}
2631
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002632pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2633 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002634 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002635 }
2636}
2637
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002638pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2639 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002640 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002641 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002642 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002643 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002644 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002645 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002646 }
2647}
2648
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002649pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002650 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002651 TypeParamBound::Trait(_binding_0, _binding_1, ) => {
2652 TypeParamBound::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04002653 _visitor.fold_poly_trait_ref(_binding_0),
2654 _visitor.fold_trait_bound_modifier(_binding_1),
2655 )
2656 }
David Tolnay6702ade2017-12-30 23:38:15 -05002657 TypeParamBound::Region(_binding_0, ) => {
2658 TypeParamBound::Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002659 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002660 )
2661 }
2662 }
2663}
2664
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002665pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2666 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002667 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002668 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002669 }
2670}
2671
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002672pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2673 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002674 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002675 path: _visitor.fold_path(_i . path),
2676 }
2677}
2678
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002679pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2680 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002681 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2682 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002683 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2684 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002685 }
2686}
2687
David Tolnay0a89b4d2017-11-13 00:55:45 -08002688pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2689 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002690 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002691 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002692 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2693 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002694 }
2695}
2696
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002697pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2698 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002699 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002700 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002701 }
2702}
2703
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002704pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2705 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002706 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002707 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002708 }
2709}
2710
David Tolnay05362582017-12-26 01:33:57 -05002711pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2712 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002713 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002714 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002715 }
2716}
2717
David Tolnay2ae520a2017-12-29 11:19:50 -05002718pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2719 TypeVerbatim {
2720 tts: _i . tts,
2721 }
2722}
2723
Nika Layzella6f46c42017-10-26 15:26:16 -04002724pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002725 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002726 UnOp::Deref(_binding_0, ) => {
2727 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002728 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002729 )
2730 }
David Tolnay6702ade2017-12-30 23:38:15 -05002731 UnOp::Not(_binding_0, ) => {
2732 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002733 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002734 )
2735 }
David Tolnay6702ade2017-12-30 23:38:15 -05002736 UnOp::Neg(_binding_0, ) => {
2737 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002738 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002739 )
2740 }
2741 }
2742}
David Tolnay5f332a92017-12-26 00:42:45 -05002743# [ cfg ( feature = "full" ) ]
2744pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2745 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002746 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002747 }
2748}
2749# [ cfg ( feature = "full" ) ]
2750pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2751 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002752 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002753 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2754 }
2755}
2756# [ cfg ( feature = "full" ) ]
2757pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2758 UsePath {
2759 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002760 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002761 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002762 _visitor.fold_ident(( it ) . 1),
2763 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002764 }
2765}
2766# [ cfg ( feature = "full" ) ]
2767pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002768 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002769 UseTree::Path(_binding_0, ) => {
2770 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002771 _visitor.fold_use_path(_binding_0),
2772 )
2773 }
David Tolnay6702ade2017-12-30 23:38:15 -05002774 UseTree::Glob(_binding_0, ) => {
2775 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002776 _visitor.fold_use_glob(_binding_0),
2777 )
2778 }
David Tolnay6702ade2017-12-30 23:38:15 -05002779 UseTree::List(_binding_0, ) => {
2780 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002781 _visitor.fold_use_list(_binding_0),
2782 )
2783 }
2784 }
2785}
Nika Layzell27726662017-10-24 23:16:35 -04002786
Nika Layzella6f46c42017-10-26 15:26:16 -04002787pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002788 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002789 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002790 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002791 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002792 discriminant: (_i . discriminant).map(|it| { (
2793 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2794 _visitor.fold_expr(( it ) . 1),
2795 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002796 }
2797}
2798
Nika Layzella6f46c42017-10-26 15:26:16 -04002799pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002800 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002801 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002802 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002803 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002804 }
2805}
2806
Nika Layzella6f46c42017-10-26 15:26:16 -04002807pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002808 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002809 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002810 }
2811}
2812
Nika Layzella6f46c42017-10-26 15:26:16 -04002813pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002814 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002815 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002816 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002817 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002818 path: Box::new(_visitor.fold_path(* _i . path)),
2819 }
2820}
2821
Nika Layzella6f46c42017-10-26 15:26:16 -04002822pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002823 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002824 Visibility::Public(_binding_0, ) => {
2825 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002826 _visitor.fold_vis_public(_binding_0),
2827 )
2828 }
David Tolnay6702ade2017-12-30 23:38:15 -05002829 Visibility::Crate(_binding_0, ) => {
2830 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002831 _visitor.fold_vis_crate(_binding_0),
2832 )
2833 }
David Tolnay6702ade2017-12-30 23:38:15 -05002834 Visibility::Restricted(_binding_0, ) => {
2835 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002836 _visitor.fold_vis_restricted(_binding_0),
2837 )
2838 }
David Tolnay6702ade2017-12-30 23:38:15 -05002839 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002840 }
2841}
2842
Nika Layzella6f46c42017-10-26 15:26:16 -04002843pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002844 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002845 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002846 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2847 }
2848}
2849
Nika Layzella6f46c42017-10-26 15:26:16 -04002850pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002851 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002852 WherePredicate::Type(_binding_0, ) => {
2853 WherePredicate::Type (
2854 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002855 )
2856 }
David Tolnayd4add852018-01-01 20:13:24 -08002857 WherePredicate::Lifetime(_binding_0, ) => {
2858 WherePredicate::Lifetime (
2859 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002860 )
2861 }
David Tolnayd4add852018-01-01 20:13:24 -08002862 WherePredicate::Eq(_binding_0, ) => {
2863 WherePredicate::Eq (
2864 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002865 )
2866 }
2867 }
2868}
2869