blob: 25c337bccd94484f7f379034fd714c514d5894f7 [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) }
Nika Layzell27726662017-10-24 23:16:35 -040064# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040065fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050074
75fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120
David Tolnay8c91b882017-12-28 23:04:32 -0500121fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500139fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500145fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500151fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500152
153fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
Nika Layzell640832a2017-12-04 13:37:09 -0500154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800178# [ cfg ( feature = "full" ) ]
179fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500180# [ cfg ( feature = "full" ) ]
181fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182
Nika Layzellc08227a2017-12-04 16:30:17 -0500183fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500184# [ cfg ( feature = "full" ) ]
185fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500186
David Tolnayc2f1aba2017-11-12 20:29:22 -0800187fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
188
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500190
191fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800197fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500202# [ cfg ( feature = "full" ) ]
203fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500204
David Tolnay85b69a42017-12-27 20:43:10 -0500205fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800223fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800225fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800235fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500240# [ cfg ( feature = "full" ) ]
241fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242
David Tolnay4ba63a02017-12-28 15:53:05 -0500243fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
244
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500246
247fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250
David Tolnaydecf28d2017-11-11 11:56:45 -0800251fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500252
David Tolnay85b69a42017-12-27 20:43:10 -0500253fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500262# [ cfg ( feature = "full" ) ]
263fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
Nika Layzellc08227a2017-12-04 16:30:17 -0500267fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500291fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500296
297fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800306
307fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500308
309fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800319fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500324# [ cfg ( feature = "full" ) ]
325fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800327fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
336
337fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
338
339fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
340
341fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
342
343fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
344
345fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
346
347fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
348
349fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
350
351fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
352
David Tolnay0a89b4d2017-11-13 00:55:45 -0800353fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800354
355fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
356
357fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
358
David Tolnay05362582017-12-26 01:33:57 -0500359fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360
David Tolnay2ae520a2017-12-29 11:19:50 -0500361fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500364# [ cfg ( feature = "full" ) ]
365fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
366# [ cfg ( feature = "full" ) ]
367fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
368# [ cfg ( feature = "full" ) ]
369fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
395}
396
David Tolnayd0adf522017-12-29 01:30:07 -0500397pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
398 _i.span = _visitor.fold_span(_i.span);
399 _i
400}
401
402pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
403 _i.span = _visitor.fold_span(_i.span);
404 _i
405}
406
Nika Layzell27726662017-10-24 23:16:35 -0400407
Nika Layzella6f46c42017-10-26 15:26:16 -0400408pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400409 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500410 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500411 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400412 }
413}
414
Nika Layzellc08227a2017-12-04 16:30:17 -0500415pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
416 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500417 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500418 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500419 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500420 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400421 }
422}
423# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400424pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400425 ArgCaptured {
426 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500427 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800428 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400429 }
430}
431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400432pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400433 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500434 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500435 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400436 }
437}
438# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400439pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400440 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500442 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500443 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500444 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400445 }
446}
447# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400448pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400449 Arm {
450 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
451 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500452 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400453 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500454 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400455 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400457 }
458}
459
Nika Layzella6f46c42017-10-26 15:26:16 -0400460pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400461 use ::AttrStyle::*;
462 match _i {
463 Outer => { Outer }
464 Inner(_binding_0, ) => {
465 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500466 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400467 )
468 }
469 }
470}
471
Nika Layzella6f46c42017-10-26 15:26:16 -0400472pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400473 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500475 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500476 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400477 path: _visitor.fold_path(_i . path),
478 tts: _i . tts,
479 is_sugared_doc: _i . is_sugared_doc,
480 }
481}
482
Nika Layzella6f46c42017-10-26 15:26:16 -0400483pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400484 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500485 name: (_i . name).map(|it| { (
486 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500487 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500488 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800489 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400490 }
491}
492
Nika Layzella6f46c42017-10-26 15:26:16 -0400493pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400494 use ::BareFnArgName::*;
495 match _i {
496 Named(_binding_0, ) => {
497 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500498 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400499 )
500 }
501 Wild(_binding_0, ) => {
502 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500503 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400504 )
505 }
506 }
507}
508
Nika Layzella6f46c42017-10-26 15:26:16 -0400509pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400510 use ::BinOp::*;
511 match _i {
512 Add(_binding_0, ) => {
513 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500514 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400515 )
516 }
517 Sub(_binding_0, ) => {
518 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 )
521 }
522 Mul(_binding_0, ) => {
523 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500524 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400525 )
526 }
527 Div(_binding_0, ) => {
528 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400530 )
531 }
532 Rem(_binding_0, ) => {
533 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500534 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400535 )
536 }
537 And(_binding_0, ) => {
538 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500539 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
542 Or(_binding_0, ) => {
543 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
547 BitXor(_binding_0, ) => {
548 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500549 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400550 )
551 }
552 BitAnd(_binding_0, ) => {
553 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
557 BitOr(_binding_0, ) => {
558 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
562 Shl(_binding_0, ) => {
563 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
567 Shr(_binding_0, ) => {
568 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
572 Eq(_binding_0, ) => {
573 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
577 Lt(_binding_0, ) => {
578 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
582 Le(_binding_0, ) => {
583 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
587 Ne(_binding_0, ) => {
588 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
592 Ge(_binding_0, ) => {
593 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
597 Gt(_binding_0, ) => {
598 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
602 AddEq(_binding_0, ) => {
603 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
607 SubEq(_binding_0, ) => {
608 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
612 MulEq(_binding_0, ) => {
613 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
617 DivEq(_binding_0, ) => {
618 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
622 RemEq(_binding_0, ) => {
623 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
627 BitXorEq(_binding_0, ) => {
628 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
632 BitAndEq(_binding_0, ) => {
633 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
637 BitOrEq(_binding_0, ) => {
638 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
642 ShlEq(_binding_0, ) => {
643 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
647 ShrEq(_binding_0, ) => {
648 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
652 }
653}
654# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400655pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400656 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500657 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400658 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
659 }
660}
661
Nika Layzella6f46c42017-10-26 15:26:16 -0400662pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400663 use ::Body::*;
664 match _i {
665 Enum(_binding_0, ) => {
666 Enum (
667 _visitor.fold_body_enum(_binding_0),
668 )
669 }
670 Struct(_binding_0, ) => {
671 Struct (
672 _visitor.fold_body_struct(_binding_0),
673 )
674 }
675 }
676}
677
Nika Layzella6f46c42017-10-26 15:26:16 -0400678pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400679 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500680 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500681 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400682 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
683 }
684}
685
Nika Layzella6f46c42017-10-26 15:26:16 -0400686pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400687 BodyStruct {
688 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500689 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
690 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400691 }
692}
693
Nika Layzella6f46c42017-10-26 15:26:16 -0400694pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400695 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500696 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
697 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400698 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500699 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400700 }
701}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500702
703pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
704 ConstParam {
705 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500706 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500707 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500708 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500709 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500710 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500711 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
712 }
713}
Nika Layzell27726662017-10-24 23:16:35 -0400714
Nika Layzella6f46c42017-10-26 15:26:16 -0400715pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400716 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500718 vis: _visitor.fold_visibility(_i . vis),
719 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400720 generics: _visitor.fold_generics(_i . generics),
721 body: _visitor.fold_body(_i . body),
722 }
723}
724
Nika Layzella6f46c42017-10-26 15:26:16 -0400725pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500726 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400727 match _i {
728 Box(_binding_0, ) => {
729 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400730 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400731 )
732 }
733 InPlace(_binding_0, ) => {
734 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400735 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400736 )
737 }
738 Array(_binding_0, ) => {
739 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400740 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400741 )
742 }
743 Call(_binding_0, ) => {
744 Call (
745 _visitor.fold_expr_call(_binding_0),
746 )
747 }
748 MethodCall(_binding_0, ) => {
749 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400750 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400751 )
752 }
David Tolnay05362582017-12-26 01:33:57 -0500753 Tuple(_binding_0, ) => {
754 Tuple (
755 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400756 )
757 }
758 Binary(_binding_0, ) => {
759 Binary (
760 _visitor.fold_expr_binary(_binding_0),
761 )
762 }
763 Unary(_binding_0, ) => {
764 Unary (
765 _visitor.fold_expr_unary(_binding_0),
766 )
767 }
768 Lit(_binding_0, ) => {
769 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500770 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400771 )
772 }
773 Cast(_binding_0, ) => {
774 Cast (
775 _visitor.fold_expr_cast(_binding_0),
776 )
777 }
778 Type(_binding_0, ) => {
779 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500780 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 If(_binding_0, ) => {
784 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400785 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400786 )
787 }
788 IfLet(_binding_0, ) => {
789 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400790 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400791 )
792 }
793 While(_binding_0, ) => {
794 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400795 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400796 )
797 }
798 WhileLet(_binding_0, ) => {
799 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400800 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400801 )
802 }
803 ForLoop(_binding_0, ) => {
804 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
808 Loop(_binding_0, ) => {
809 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400810 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
813 Match(_binding_0, ) => {
814 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400815 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400816 )
817 }
818 Closure(_binding_0, ) => {
819 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400820 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400821 )
822 }
Nika Layzell640832a2017-12-04 13:37:09 -0500823 Unsafe(_binding_0, ) => {
824 Unsafe (
825 full!(_visitor.fold_expr_unsafe(_binding_0)),
826 )
827 }
Nika Layzell27726662017-10-24 23:16:35 -0400828 Block(_binding_0, ) => {
829 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400830 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400831 )
832 }
833 Assign(_binding_0, ) => {
834 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400835 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400836 )
837 }
838 AssignOp(_binding_0, ) => {
839 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400840 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400841 )
842 }
843 Field(_binding_0, ) => {
844 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400845 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400846 )
847 }
Nika Layzell27726662017-10-24 23:16:35 -0400848 Index(_binding_0, ) => {
849 Index (
850 _visitor.fold_expr_index(_binding_0),
851 )
852 }
853 Range(_binding_0, ) => {
854 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
858 Path(_binding_0, ) => {
859 Path (
860 _visitor.fold_expr_path(_binding_0),
861 )
862 }
863 AddrOf(_binding_0, ) => {
864 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400865 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400866 )
867 }
868 Break(_binding_0, ) => {
869 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400870 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400871 )
872 }
873 Continue(_binding_0, ) => {
874 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400875 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400876 )
877 }
David Tolnayc246cd32017-12-28 23:14:32 -0500878 Return(_binding_0, ) => {
879 Return (
880 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400881 )
882 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800883 Macro(_binding_0, ) => {
884 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500885 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
888 Struct(_binding_0, ) => {
889 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400890 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
893 Repeat(_binding_0, ) => {
894 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400895 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 )
897 }
898 Paren(_binding_0, ) => {
899 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500900 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
903 Group(_binding_0, ) => {
904 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500905 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400906 )
907 }
908 Try(_binding_0, ) => {
909 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400910 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
913 Catch(_binding_0, ) => {
914 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400915 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400916 )
917 }
918 Yield(_binding_0, ) => {
919 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400920 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 )
922 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500923 Verbatim(_binding_0, ) => {
924 Verbatim (
925 _visitor.fold_expr_verbatim(_binding_0),
926 )
927 }
Nika Layzell27726662017-10-24 23:16:35 -0400928 }
929}
930# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500931pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
932 ExprAddrOf {
933 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
934 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500935 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500936 expr: Box::new(_visitor.fold_expr(* _i . expr)),
937 }
938}
939# [ cfg ( feature = "full" ) ]
940pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
941 ExprArray {
942 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
943 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500944 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500945 }
946}
947# [ cfg ( feature = "full" ) ]
948pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
949 ExprAssign {
950 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
951 left: Box::new(_visitor.fold_expr(* _i . left)),
952 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
953 right: Box::new(_visitor.fold_expr(* _i . right)),
954 }
955}
956# [ cfg ( feature = "full" ) ]
957pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
958 ExprAssignOp {
959 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
960 left: Box::new(_visitor.fold_expr(* _i . left)),
961 op: _visitor.fold_bin_op(_i . op),
962 right: Box::new(_visitor.fold_expr(* _i . right)),
963 }
964}
965
966pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
967 ExprBinary {
968 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
969 left: Box::new(_visitor.fold_expr(* _i . left)),
970 op: _visitor.fold_bin_op(_i . op),
971 right: Box::new(_visitor.fold_expr(* _i . right)),
972 }
973}
974# [ cfg ( feature = "full" ) ]
975pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
976 ExprBlock {
977 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
978 block: _visitor.fold_block(_i . block),
979 }
980}
981# [ cfg ( feature = "full" ) ]
982pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
983 ExprBox {
984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
985 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
986 expr: Box::new(_visitor.fold_expr(* _i . expr)),
987 }
988}
989# [ cfg ( feature = "full" ) ]
990pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
991 ExprBreak {
992 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
993 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
994 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
995 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
996 }
997}
998
999pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1000 ExprCall {
1001 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1002 func: Box::new(_visitor.fold_expr(* _i . func)),
1003 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1004 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1005 }
1006}
1007
1008pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1009 ExprCast {
1010 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1011 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1012 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1013 ty: Box::new(_visitor.fold_type(* _i . ty)),
1014 }
1015}
1016# [ cfg ( feature = "full" ) ]
1017pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1018 ExprCatch {
1019 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1020 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1021 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1022 block: _visitor.fold_block(_i . block),
1023 }
1024}
1025# [ cfg ( feature = "full" ) ]
1026pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1027 ExprClosure {
1028 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001029 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001030 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1031 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1032 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1033 output: _visitor.fold_return_type(_i . output),
1034 body: Box::new(_visitor.fold_expr(* _i . body)),
1035 }
1036}
1037# [ cfg ( feature = "full" ) ]
1038pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1039 ExprContinue {
1040 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1041 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1042 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1043 }
1044}
1045# [ cfg ( feature = "full" ) ]
1046pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1047 ExprField {
1048 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1049 base: Box::new(_visitor.fold_expr(* _i . base)),
1050 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1051 member: _visitor.fold_member(_i . member),
1052 }
1053}
1054# [ cfg ( feature = "full" ) ]
1055pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1056 ExprForLoop {
1057 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1058 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1059 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1060 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1061 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1062 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1063 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1064 body: _visitor.fold_block(_i . body),
1065 }
1066}
David Tolnaye98775f2017-12-28 23:17:00 -05001067# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001068pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1069 ExprGroup {
1070 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1071 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1072 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1073 }
1074}
1075# [ cfg ( feature = "full" ) ]
1076pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1077 ExprIf {
1078 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1079 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1080 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001081 then_branch: _visitor.fold_block(_i . then_branch),
1082 else_branch: (_i . else_branch).map(|it| { (
1083 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1084 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1085 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001086 }
1087}
1088# [ cfg ( feature = "full" ) ]
1089pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1090 ExprIfLet {
1091 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1092 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1093 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1094 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1095 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1096 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001097 then_branch: _visitor.fold_block(_i . then_branch),
1098 else_branch: (_i . else_branch).map(|it| { (
1099 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1100 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1101 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001102 }
1103}
1104# [ cfg ( feature = "full" ) ]
1105pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1106 ExprInPlace {
1107 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1108 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001109 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001110 value: Box::new(_visitor.fold_expr(* _i . value)),
1111 }
1112}
1113
1114pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1115 ExprIndex {
1116 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1117 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1118 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1119 index: Box::new(_visitor.fold_expr(* _i . index)),
1120 }
1121}
1122
1123pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1124 ExprLit {
1125 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1126 lit: _visitor.fold_lit(_i . lit),
1127 }
1128}
1129# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001130pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001131 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001132 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001133 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001134 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001135 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1136 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001137 }
1138}
1139# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001140pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1141 ExprMacro {
1142 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1143 mac: _visitor.fold_macro(_i . mac),
1144 }
1145}
1146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001147pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001148 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001149 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001150 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001151 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001152 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001153 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1154 }
1155}
1156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001157pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001158 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001159 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001160 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001161 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001162 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001163 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001164 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1165 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001166 }
1167}
David Tolnaye98775f2017-12-28 23:17:00 -05001168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001169pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001170 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001171 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001172 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001173 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001174 }
1175}
1176
Nika Layzella6f46c42017-10-26 15:26:16 -04001177pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001178 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001179 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001180 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001181 path: _visitor.fold_path(_i . path),
1182 }
1183}
1184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001185pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001186 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001187 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001188 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001189 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001190 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001191 }
1192}
1193# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001194pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001195 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001196 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001197 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001198 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001199 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001200 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1201 }
1202}
1203# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001204pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1205 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001207 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001208 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
1210}
1211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001212pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001213 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001214 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001215 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001216 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1218 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1219 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001220 }
1221}
1222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001223pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001224 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001225 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001226 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001227 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001228 }
1229}
1230# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001231pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1232 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001233 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001234 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001235 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001236 }
1237}
David Tolnay0cf94f22017-12-28 23:46:26 -05001238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001239pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001240 ExprType {
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 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001243 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001244 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
1246}
1247
Nika Layzella6f46c42017-10-26 15:26:16 -04001248pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001249 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001251 op: _visitor.fold_un_op(_i . op),
1252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1253 }
1254}
1255# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001256pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1257 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001258 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001259 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001260 block: _visitor.fold_block(_i . block),
1261 }
1262}
David Tolnay2ae520a2017-12-29 11:19:50 -05001263
1264pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1265 ExprVerbatim {
1266 tts: _i . tts,
1267 }
1268}
Nika Layzell640832a2017-12-04 13:37:09 -05001269# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001270pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001271 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001273 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001274 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1275 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001276 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1277 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001278 }
1279}
1280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001281pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001282 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001283 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001284 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001285 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1286 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1287 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001288 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001289 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001290 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1291 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001292 }
1293}
1294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001295pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001296 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001297 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001298 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001299 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001300 }
1301}
1302
Nika Layzella6f46c42017-10-26 15:26:16 -04001303pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001304 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001305 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001306 vis: _visitor.fold_visibility(_i . vis),
1307 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001308 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001309 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001310 }
1311}
1312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001313pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001314 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001315 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001316 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001317 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001318 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001319 }
1320}
1321# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001322pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001323 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001324 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1325 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001326 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001327 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001328 }
1329}
1330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001331pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001332 File {
1333 shebang: _i . shebang,
1334 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1335 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1336 }
1337}
1338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001340 use ::FnArg::*;
1341 match _i {
1342 SelfRef(_binding_0, ) => {
1343 SelfRef (
1344 _visitor.fold_arg_self_ref(_binding_0),
1345 )
1346 }
1347 SelfValue(_binding_0, ) => {
1348 SelfValue (
1349 _visitor.fold_arg_self(_binding_0),
1350 )
1351 }
1352 Captured(_binding_0, ) => {
1353 Captured (
1354 _visitor.fold_arg_captured(_binding_0),
1355 )
1356 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001357 Inferred(_binding_0, ) => {
1358 Inferred (
1359 _visitor.fold_pat(_binding_0),
1360 )
1361 }
Nika Layzell27726662017-10-24 23:16:35 -04001362 Ignored(_binding_0, ) => {
1363 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001364 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001365 )
1366 }
1367 }
1368}
1369# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001370pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001371 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001372 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001373 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001374 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001375 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001376 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001377 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001378 }
1379}
1380# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001381pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001382 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001383 match _i {
1384 Fn(_binding_0, ) => {
1385 Fn (
1386 _visitor.fold_foreign_item_fn(_binding_0),
1387 )
1388 }
1389 Static(_binding_0, ) => {
1390 Static (
1391 _visitor.fold_foreign_item_static(_binding_0),
1392 )
1393 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001394 Type(_binding_0, ) => {
1395 Type (
1396 _visitor.fold_foreign_item_type(_binding_0),
1397 )
1398 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001399 Verbatim(_binding_0, ) => {
1400 Verbatim (
1401 _visitor.fold_foreign_item_verbatim(_binding_0),
1402 )
1403 }
Nika Layzell27726662017-10-24 23:16:35 -04001404 }
1405}
1406# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001407pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1408 ForeignItemFn {
1409 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1410 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001411 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001412 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001413 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001414 }
1415}
1416# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001417pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001418 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001419 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1420 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001421 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001422 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001423 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001424 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001425 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001426 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001427 }
1428}
David Tolnay199bcbb2017-11-12 10:33:52 -08001429# [ cfg ( feature = "full" ) ]
1430pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1431 ForeignItemType {
1432 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1433 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001434 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001435 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001436 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001437 }
1438}
David Tolnay2ae520a2017-12-29 11:19:50 -05001439# [ cfg ( feature = "full" ) ]
1440pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1441 ForeignItemVerbatim {
1442 tts: _i . tts,
1443 }
1444}
Nika Layzell27726662017-10-24 23:16:35 -04001445
Nika Layzellc08227a2017-12-04 16:30:17 -05001446pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1447 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001448 match _i {
1449 Lifetime(_binding_0, ) => {
1450 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001451 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001452 )
1453 }
1454 Type(_binding_0, ) => {
1455 Type (
1456 _visitor.fold_type(_binding_0),
1457 )
1458 }
1459 TypeBinding(_binding_0, ) => {
1460 TypeBinding (
1461 _visitor.fold_type_binding(_binding_0),
1462 )
1463 }
Nika Layzellc680e612017-12-04 19:07:20 -05001464 Const(_binding_0, ) => {
1465 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001466 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001467 )
1468 }
Nika Layzell357885a2017-12-04 15:47:07 -05001469 }
1470}
David Tolnayd60cfec2017-12-29 00:21:38 -05001471# [ cfg ( feature = "full" ) ]
1472pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1473 use ::GenericMethodArgument::*;
1474 match _i {
1475 Type(_binding_0, ) => {
1476 Type (
1477 _visitor.fold_type(_binding_0),
1478 )
1479 }
1480 Const(_binding_0, ) => {
1481 Const (
1482 _visitor.fold_expr(_binding_0),
1483 )
1484 }
1485 }
1486}
Nika Layzell357885a2017-12-04 15:47:07 -05001487
David Tolnayc2f1aba2017-11-12 20:29:22 -08001488pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1489 use ::GenericParam::*;
1490 match _i {
1491 Lifetime(_binding_0, ) => {
1492 Lifetime (
1493 _visitor.fold_lifetime_def(_binding_0),
1494 )
1495 }
1496 Type(_binding_0, ) => {
1497 Type (
1498 _visitor.fold_type_param(_binding_0),
1499 )
1500 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001501 Const(_binding_0, ) => {
1502 Const (
1503 _visitor.fold_const_param(_binding_0),
1504 )
1505 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001506 }
1507}
1508
Nika Layzella6f46c42017-10-26 15:26:16 -04001509pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001510 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001511 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001512 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001513 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001514 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001515 }
1516}
1517# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001518pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001519 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001520 match _i {
1521 Const(_binding_0, ) => {
1522 Const (
1523 _visitor.fold_impl_item_const(_binding_0),
1524 )
1525 }
1526 Method(_binding_0, ) => {
1527 Method (
1528 _visitor.fold_impl_item_method(_binding_0),
1529 )
1530 }
1531 Type(_binding_0, ) => {
1532 Type (
1533 _visitor.fold_impl_item_type(_binding_0),
1534 )
1535 }
1536 Macro(_binding_0, ) => {
1537 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001538 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001539 )
1540 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001541 Verbatim(_binding_0, ) => {
1542 Verbatim (
1543 _visitor.fold_impl_item_verbatim(_binding_0),
1544 )
1545 }
Nika Layzell27726662017-10-24 23:16:35 -04001546 }
1547}
1548# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001549pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1550 ImplItemConst {
1551 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1552 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001553 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001554 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001555 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001556 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001557 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001558 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001559 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001560 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001561 }
1562}
1563# [ cfg ( feature = "full" ) ]
1564pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1565 ImplItemMacro {
1566 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1567 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001568 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001569 }
1570}
1571# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001572pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001573 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001574 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001575 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001576 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001577 sig: _visitor.fold_method_sig(_i . sig),
1578 block: _visitor.fold_block(_i . block),
1579 }
1580}
1581# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001582pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001583 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001584 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001585 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001586 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001587 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001588 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001589 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001590 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001591 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001592 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001593 }
1594}
David Tolnay2ae520a2017-12-29 11:19:50 -05001595# [ cfg ( feature = "full" ) ]
1596pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1597 ImplItemVerbatim {
1598 tts: _i . tts,
1599 }
1600}
David Tolnay14982012017-12-29 00:49:51 -05001601
David Tolnay85b69a42017-12-27 20:43:10 -05001602pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1603 Index {
1604 index: _i . index,
1605 span: _visitor.fold_span(_i . span),
1606 }
1607}
1608# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001609pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001610 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001611 match _i {
1612 ExternCrate(_binding_0, ) => {
1613 ExternCrate (
1614 _visitor.fold_item_extern_crate(_binding_0),
1615 )
1616 }
1617 Use(_binding_0, ) => {
1618 Use (
1619 _visitor.fold_item_use(_binding_0),
1620 )
1621 }
1622 Static(_binding_0, ) => {
1623 Static (
1624 _visitor.fold_item_static(_binding_0),
1625 )
1626 }
1627 Const(_binding_0, ) => {
1628 Const (
1629 _visitor.fold_item_const(_binding_0),
1630 )
1631 }
1632 Fn(_binding_0, ) => {
1633 Fn (
1634 _visitor.fold_item_fn(_binding_0),
1635 )
1636 }
1637 Mod(_binding_0, ) => {
1638 Mod (
1639 _visitor.fold_item_mod(_binding_0),
1640 )
1641 }
1642 ForeignMod(_binding_0, ) => {
1643 ForeignMod (
1644 _visitor.fold_item_foreign_mod(_binding_0),
1645 )
1646 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001647 Type(_binding_0, ) => {
1648 Type (
1649 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001650 )
1651 }
1652 Enum(_binding_0, ) => {
1653 Enum (
1654 _visitor.fold_item_enum(_binding_0),
1655 )
1656 }
1657 Struct(_binding_0, ) => {
1658 Struct (
1659 _visitor.fold_item_struct(_binding_0),
1660 )
1661 }
1662 Union(_binding_0, ) => {
1663 Union (
1664 _visitor.fold_item_union(_binding_0),
1665 )
1666 }
1667 Trait(_binding_0, ) => {
1668 Trait (
1669 _visitor.fold_item_trait(_binding_0),
1670 )
1671 }
1672 DefaultImpl(_binding_0, ) => {
1673 DefaultImpl (
1674 _visitor.fold_item_default_impl(_binding_0),
1675 )
1676 }
1677 Impl(_binding_0, ) => {
1678 Impl (
1679 _visitor.fold_item_impl(_binding_0),
1680 )
1681 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001682 Macro(_binding_0, ) => {
1683 Macro (
1684 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001685 )
1686 }
David Tolnay500d8322017-12-18 00:32:51 -08001687 Macro2(_binding_0, ) => {
1688 Macro2 (
1689 _visitor.fold_item_macro2(_binding_0),
1690 )
1691 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001692 Verbatim(_binding_0, ) => {
1693 Verbatim (
1694 _visitor.fold_item_verbatim(_binding_0),
1695 )
1696 }
Nika Layzell27726662017-10-24 23:16:35 -04001697 }
1698}
1699# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001700pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1701 ItemConst {
1702 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1703 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001704 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001705 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001706 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001707 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001708 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001709 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001710 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001711 }
1712}
1713# [ cfg ( feature = "full" ) ]
1714pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1715 ItemDefaultImpl {
1716 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001717 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001718 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001719 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001720 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1721 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001722 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001723 }
1724}
1725# [ cfg ( feature = "full" ) ]
1726pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1727 ItemEnum {
1728 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1729 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001730 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001731 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001732 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001733 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001734 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1735 }
1736}
1737# [ cfg ( feature = "full" ) ]
1738pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1739 ItemExternCrate {
1740 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1741 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001742 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1743 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001744 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001745 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001746 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001747 _visitor.fold_ident(( it ) . 1),
1748 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001749 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001750 }
1751}
1752# [ cfg ( feature = "full" ) ]
1753pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1754 ItemFn {
1755 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1756 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001757 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001758 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001759 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001760 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001761 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001762 block: Box::new(_visitor.fold_block(* _i . block)),
1763 }
1764}
1765# [ cfg ( feature = "full" ) ]
1766pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1767 ItemForeignMod {
1768 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1769 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001770 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001771 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1772 }
1773}
1774# [ cfg ( feature = "full" ) ]
1775pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1776 ItemImpl {
1777 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001778 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001779 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001782 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001783 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001784 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001785 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001786 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001787 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001788 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1790 }
1791}
1792# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001793pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1794 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001795 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001796 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001797 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001798 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001799 }
1800}
1801# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001802pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1803 ItemMacro2 {
1804 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1805 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001807 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001808 args: _i . args,
1809 body: _i . body,
1810 }
1811}
1812# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001813pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001814 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001815 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001816 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001817 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001818 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001819 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001820 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001821 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1822 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001823 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001824 }
1825}
1826# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001827pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001828 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001829 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001830 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001832 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001833 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001834 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001835 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001836 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001837 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001839 }
1840}
1841# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001842pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001843 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001844 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001845 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001847 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001848 generics: _visitor.fold_generics(_i . generics),
1849 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001851 }
1852}
1853# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001854pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001855 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001856 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001857 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001858 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1860 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001861 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001862 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001864 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001865 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001866 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1867 }
1868}
1869# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001870pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1871 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001872 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001873 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001874 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001875 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001876 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001877 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001878 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001879 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001880 }
1881}
1882# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001883pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001884 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001885 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001886 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001888 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001889 generics: _visitor.fold_generics(_i . generics),
1890 data: _visitor.fold_variant_data(_i . data),
1891 }
1892}
1893# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001894pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001895 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001896 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001897 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001898 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1899 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001900 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1901 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001903 }
1904}
David Tolnay2ae520a2017-12-29 11:19:50 -05001905# [ cfg ( feature = "full" ) ]
1906pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1907 ItemVerbatim {
1908 tts: _i . tts,
1909 }
1910}
Nika Layzell27726662017-10-24 23:16:35 -04001911
Nika Layzella6f46c42017-10-26 15:26:16 -04001912pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001913 LifetimeDef {
1914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001915 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001917 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1918 }
1919}
1920
1921pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1922 Lit {
1923 value: _i . value,
1924 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001925 }
1926}
1927# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001928pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001929 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001930 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001931 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1932 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1933 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1934 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1935 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1936 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1937 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001938 }
1939}
Nika Layzell27726662017-10-24 23:16:35 -04001940
David Tolnaydecf28d2017-11-11 11:56:45 -08001941pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1942 Macro {
1943 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001944 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001945 tokens: _i . tokens,
1946 }
1947}
David Tolnay14982012017-12-29 00:49:51 -05001948
David Tolnay85b69a42017-12-27 20:43:10 -05001949pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1950 use ::Member::*;
1951 match _i {
1952 Named(_binding_0, ) => {
1953 Named (
1954 _visitor.fold_ident(_binding_0),
1955 )
1956 }
1957 Unnamed(_binding_0, ) => {
1958 Unnamed (
1959 _visitor.fold_index(_binding_0),
1960 )
1961 }
1962 }
1963}
David Tolnaydecf28d2017-11-11 11:56:45 -08001964
Nika Layzella6f46c42017-10-26 15:26:16 -04001965pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001966 use ::MetaItem::*;
1967 match _i {
1968 Term(_binding_0, ) => {
1969 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001970 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001971 )
1972 }
1973 List(_binding_0, ) => {
1974 List (
1975 _visitor.fold_meta_item_list(_binding_0),
1976 )
1977 }
1978 NameValue(_binding_0, ) => {
1979 NameValue (
1980 _visitor.fold_meta_name_value(_binding_0),
1981 )
1982 }
1983 }
1984}
1985
Nika Layzella6f46c42017-10-26 15:26:16 -04001986pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001987 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001988 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001989 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001990 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1991 }
1992}
1993
Nika Layzella6f46c42017-10-26 15:26:16 -04001994pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001995 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001996 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001997 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001998 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001999 }
2000}
2001# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002002pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002003 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002004 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002005 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002006 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002007 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002008 decl: _visitor.fold_fn_decl(_i . decl),
2009 }
2010}
David Tolnayd60cfec2017-12-29 00:21:38 -05002011# [ cfg ( feature = "full" ) ]
2012pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2013 MethodTurbofish {
2014 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2015 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2016 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2017 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2018 }
2019}
Nika Layzell27726662017-10-24 23:16:35 -04002020
Nika Layzella6f46c42017-10-26 15:26:16 -04002021pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002022 use ::NestedMetaItem::*;
2023 match _i {
2024 MetaItem(_binding_0, ) => {
2025 MetaItem (
2026 _visitor.fold_meta_item(_binding_0),
2027 )
2028 }
2029 Literal(_binding_0, ) => {
2030 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002031 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002032 )
2033 }
2034 }
2035}
2036
Nika Layzellc08227a2017-12-04 16:30:17 -05002037pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2038 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002039 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002040 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002041 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002042 }
2043}
2044# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002045pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002046 use ::Pat::*;
2047 match _i {
2048 Wild(_binding_0, ) => {
2049 Wild (
2050 _visitor.fold_pat_wild(_binding_0),
2051 )
2052 }
2053 Ident(_binding_0, ) => {
2054 Ident (
2055 _visitor.fold_pat_ident(_binding_0),
2056 )
2057 }
2058 Struct(_binding_0, ) => {
2059 Struct (
2060 _visitor.fold_pat_struct(_binding_0),
2061 )
2062 }
2063 TupleStruct(_binding_0, ) => {
2064 TupleStruct (
2065 _visitor.fold_pat_tuple_struct(_binding_0),
2066 )
2067 }
2068 Path(_binding_0, ) => {
2069 Path (
2070 _visitor.fold_pat_path(_binding_0),
2071 )
2072 }
2073 Tuple(_binding_0, ) => {
2074 Tuple (
2075 _visitor.fold_pat_tuple(_binding_0),
2076 )
2077 }
2078 Box(_binding_0, ) => {
2079 Box (
2080 _visitor.fold_pat_box(_binding_0),
2081 )
2082 }
2083 Ref(_binding_0, ) => {
2084 Ref (
2085 _visitor.fold_pat_ref(_binding_0),
2086 )
2087 }
2088 Lit(_binding_0, ) => {
2089 Lit (
2090 _visitor.fold_pat_lit(_binding_0),
2091 )
2092 }
2093 Range(_binding_0, ) => {
2094 Range (
2095 _visitor.fold_pat_range(_binding_0),
2096 )
2097 }
2098 Slice(_binding_0, ) => {
2099 Slice (
2100 _visitor.fold_pat_slice(_binding_0),
2101 )
2102 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002103 Macro(_binding_0, ) => {
2104 Macro (
2105 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002106 )
2107 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002108 Verbatim(_binding_0, ) => {
2109 Verbatim (
2110 _visitor.fold_pat_verbatim(_binding_0),
2111 )
2112 }
Nika Layzell27726662017-10-24 23:16:35 -04002113 }
2114}
2115# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002116pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002117 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002118 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002119 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002125 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2126 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002127 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002128 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002129 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002130 }
2131}
2132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002133pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002134 PatLit {
2135 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2136 }
2137}
2138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002140 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002141 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002142 path: _visitor.fold_path(_i . path),
2143 }
2144}
2145# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002146pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002147 PatRange {
2148 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002149 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002150 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002151 }
2152}
2153# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002154pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002155 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002156 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002157 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002158 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002159 }
2160}
2161# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002162pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002163 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002164 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002165 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002166 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002167 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002168 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002169 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002170 }
2171}
2172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002173pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002174 PatStruct {
2175 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002176 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002177 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002178 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002179 }
2180}
2181# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002182pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002183 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002184 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002185 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002186 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002187 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2188 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
2190}
2191# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002192pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002193 PatTupleStruct {
2194 path: _visitor.fold_path(_i . path),
2195 pat: _visitor.fold_pat_tuple(_i . pat),
2196 }
2197}
2198# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002199pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2200 PatVerbatim {
2201 tts: _i . tts,
2202 }
2203}
2204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002205pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002206 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002207 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
2209}
2210
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002212 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002213 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002214 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2215 }
2216}
Nika Layzellc08227a2017-12-04 16:30:17 -05002217
2218pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2219 use ::PathArguments::*;
2220 match _i {
2221 None => { None }
2222 AngleBracketed(_binding_0, ) => {
2223 AngleBracketed (
2224 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2225 )
2226 }
2227 Parenthesized(_binding_0, ) => {
2228 Parenthesized (
2229 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2230 )
2231 }
2232 }
2233}
Nika Layzell27726662017-10-24 23:16:35 -04002234
Nika Layzella6f46c42017-10-26 15:26:16 -04002235pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002236 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002237 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002238 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002239 }
2240}
Nika Layzell27726662017-10-24 23:16:35 -04002241
Nika Layzella6f46c42017-10-26 15:26:16 -04002242pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002243 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002244 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002245 trait_ref: _visitor.fold_path(_i . trait_ref),
2246 }
2247}
2248
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002250 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002251 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002252 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002253 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002254 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2255 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002256 }
2257}
2258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002259pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002260 use ::RangeLimits::*;
2261 match _i {
2262 HalfOpen(_binding_0, ) => {
2263 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002264 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002265 )
2266 }
2267 Closed(_binding_0, ) => {
2268 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002269 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002270 )
2271 }
2272 }
2273}
David Tolnayf93b90d2017-11-11 19:21:26 -08002274
2275pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2276 use ::ReturnType::*;
2277 match _i {
2278 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002279 Type(_binding_0, _binding_1, ) => {
2280 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002281 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2282 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002283 )
2284 }
2285 }
2286}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002287
2288pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2289 _i
2290}
Nika Layzell27726662017-10-24 23:16:35 -04002291# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002292pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002293 use ::Stmt::*;
2294 match _i {
2295 Local(_binding_0, ) => {
2296 Local (
2297 Box::new(_visitor.fold_local(* _binding_0)),
2298 )
2299 }
2300 Item(_binding_0, ) => {
2301 Item (
2302 Box::new(_visitor.fold_item(* _binding_0)),
2303 )
2304 }
2305 Expr(_binding_0, ) => {
2306 Expr (
2307 Box::new(_visitor.fold_expr(* _binding_0)),
2308 )
2309 }
2310 Semi(_binding_0, _binding_1, ) => {
2311 Semi (
2312 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002313 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002314 )
2315 }
Nika Layzell27726662017-10-24 23:16:35 -04002316 }
2317}
2318
Nika Layzella6f46c42017-10-26 15:26:16 -04002319pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002320 use ::TraitBoundModifier::*;
2321 match _i {
2322 None => { None }
2323 Maybe(_binding_0, ) => {
2324 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002326 )
2327 }
2328 }
2329}
2330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002331pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002332 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002333 match _i {
2334 Const(_binding_0, ) => {
2335 Const (
2336 _visitor.fold_trait_item_const(_binding_0),
2337 )
2338 }
2339 Method(_binding_0, ) => {
2340 Method (
2341 _visitor.fold_trait_item_method(_binding_0),
2342 )
2343 }
2344 Type(_binding_0, ) => {
2345 Type (
2346 _visitor.fold_trait_item_type(_binding_0),
2347 )
2348 }
2349 Macro(_binding_0, ) => {
2350 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002351 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002352 )
2353 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002354 Verbatim(_binding_0, ) => {
2355 Verbatim (
2356 _visitor.fold_trait_item_verbatim(_binding_0),
2357 )
2358 }
Nika Layzell27726662017-10-24 23:16:35 -04002359 }
2360}
2361# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002362pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2363 TraitItemConst {
2364 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002365 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002366 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002367 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002368 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002369 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002370 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002371 _visitor.fold_expr(( it ) . 1),
2372 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002373 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002374 }
2375}
2376# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002377pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2378 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002379 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002380 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002381 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002382 }
2383}
2384# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002385pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002386 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002387 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002388 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002389 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002390 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002391 }
2392}
2393# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002394pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002395 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002396 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002397 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002398 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002399 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002400 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002401 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002402 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002403 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002404 _visitor.fold_type(( it ) . 1),
2405 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002406 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002407 }
2408}
David Tolnay2ae520a2017-12-29 11:19:50 -05002409# [ cfg ( feature = "full" ) ]
2410pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2411 TraitItemVerbatim {
2412 tts: _i . tts,
2413 }
2414}
Nika Layzell27726662017-10-24 23:16:35 -04002415
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002416pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2417 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002418 match _i {
2419 Slice(_binding_0, ) => {
2420 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002421 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002422 )
2423 }
2424 Array(_binding_0, ) => {
2425 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002426 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002427 )
2428 }
2429 Ptr(_binding_0, ) => {
2430 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002431 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002432 )
2433 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002434 Reference(_binding_0, ) => {
2435 Reference (
2436 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002437 )
2438 }
2439 BareFn(_binding_0, ) => {
2440 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002441 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002442 )
2443 }
2444 Never(_binding_0, ) => {
2445 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002446 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002447 )
2448 }
David Tolnay05362582017-12-26 01:33:57 -05002449 Tuple(_binding_0, ) => {
2450 Tuple (
2451 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002452 )
2453 }
2454 Path(_binding_0, ) => {
2455 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002456 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002457 )
2458 }
2459 TraitObject(_binding_0, ) => {
2460 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002461 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002462 )
2463 }
2464 ImplTrait(_binding_0, ) => {
2465 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002467 )
2468 }
2469 Paren(_binding_0, ) => {
2470 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
2474 Group(_binding_0, ) => {
2475 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002476 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002477 )
2478 }
2479 Infer(_binding_0, ) => {
2480 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002481 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002482 )
2483 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002484 Macro(_binding_0, ) => {
2485 Macro (
2486 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002487 )
2488 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002489 Verbatim(_binding_0, ) => {
2490 Verbatim (
2491 _visitor.fold_type_verbatim(_binding_0),
2492 )
2493 }
Nika Layzell27726662017-10-24 23:16:35 -04002494 }
2495}
2496
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002497pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2498 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002499 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002500 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002501 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002502 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002503 }
2504}
2505
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002506pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2507 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002508 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2509 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2510 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2511 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2512 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2513 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2514 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2515 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002516 }
2517}
2518
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2520 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002521 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002522 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523 ty: _visitor.fold_type(_i . ty),
2524 }
2525}
2526
2527pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2528 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002529 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002530 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002531 }
2532}
2533
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002534pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2535 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002536 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002537 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002538 }
2539}
2540
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002541pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2542 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002543 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002544 }
2545}
2546
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002547pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2548 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002549 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002550 }
2551}
2552
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002553pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2554 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002555 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002556 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002557 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002558 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002559 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002560 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002561 }
2562}
2563
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002564pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2565 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002566 match _i {
2567 Trait(_binding_0, _binding_1, ) => {
2568 Trait (
2569 _visitor.fold_poly_trait_ref(_binding_0),
2570 _visitor.fold_trait_bound_modifier(_binding_1),
2571 )
2572 }
2573 Region(_binding_0, ) => {
2574 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002575 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002576 )
2577 }
2578 }
2579}
2580
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002581pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2582 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002583 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002584 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002585 }
2586}
2587
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002588pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2589 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002590 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002591 path: _visitor.fold_path(_i . path),
2592 }
2593}
2594
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002595pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2596 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002597 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2598 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002599 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2600 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002601 }
2602}
2603
David Tolnay0a89b4d2017-11-13 00:55:45 -08002604pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2605 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002606 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002607 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002608 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2609 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_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2614 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002615 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002616 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002617 }
2618}
2619
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002620pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2621 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002622 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002623 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002624 }
2625}
2626
David Tolnay05362582017-12-26 01:33:57 -05002627pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2628 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002629 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002630 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002631 }
2632}
2633
David Tolnay2ae520a2017-12-29 11:19:50 -05002634pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2635 TypeVerbatim {
2636 tts: _i . tts,
2637 }
2638}
2639
Nika Layzella6f46c42017-10-26 15:26:16 -04002640pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002641 use ::UnOp::*;
2642 match _i {
2643 Deref(_binding_0, ) => {
2644 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002645 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002646 )
2647 }
2648 Not(_binding_0, ) => {
2649 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002650 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002651 )
2652 }
2653 Neg(_binding_0, ) => {
2654 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002655 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002656 )
2657 }
2658 }
2659}
David Tolnay5f332a92017-12-26 00:42:45 -05002660# [ cfg ( feature = "full" ) ]
2661pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2662 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002663 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002664 }
2665}
2666# [ cfg ( feature = "full" ) ]
2667pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2668 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002669 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002670 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2671 }
2672}
2673# [ cfg ( feature = "full" ) ]
2674pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2675 UsePath {
2676 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002677 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002678 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002679 _visitor.fold_ident(( it ) . 1),
2680 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002681 }
2682}
2683# [ cfg ( feature = "full" ) ]
2684pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2685 use ::UseTree::*;
2686 match _i {
2687 Path(_binding_0, ) => {
2688 Path (
2689 _visitor.fold_use_path(_binding_0),
2690 )
2691 }
2692 Glob(_binding_0, ) => {
2693 Glob (
2694 _visitor.fold_use_glob(_binding_0),
2695 )
2696 }
2697 List(_binding_0, ) => {
2698 List (
2699 _visitor.fold_use_list(_binding_0),
2700 )
2701 }
2702 }
2703}
Nika Layzell27726662017-10-24 23:16:35 -04002704
Nika Layzella6f46c42017-10-26 15:26:16 -04002705pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002706 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002707 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002708 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002709 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002710 discriminant: (_i . discriminant).map(|it| { (
2711 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2712 _visitor.fold_expr(( it ) . 1),
2713 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002714 }
2715}
2716
Nika Layzella6f46c42017-10-26 15:26:16 -04002717pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002718 use ::VariantData::*;
2719 match _i {
2720 Struct(_binding_0, _binding_1, ) => {
2721 Struct (
2722 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002723 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002724 )
2725 }
2726 Tuple(_binding_0, _binding_1, ) => {
2727 Tuple (
2728 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002729 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002730 )
2731 }
2732 Unit => { Unit }
2733 }
2734}
Nika Layzell27726662017-10-24 23:16:35 -04002735
Nika Layzella6f46c42017-10-26 15:26:16 -04002736pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002737 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002738 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002739 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002740 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002741 }
2742}
2743
Nika Layzella6f46c42017-10-26 15:26:16 -04002744pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002745 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002746 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002747 }
2748}
2749
Nika Layzella6f46c42017-10-26 15:26:16 -04002750pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002751 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002752 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002753 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002755 path: Box::new(_visitor.fold_path(* _i . path)),
2756 }
2757}
2758
Nika Layzella6f46c42017-10-26 15:26:16 -04002759pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002760 use ::Visibility::*;
2761 match _i {
2762 Public(_binding_0, ) => {
2763 Public (
2764 _visitor.fold_vis_public(_binding_0),
2765 )
2766 }
2767 Crate(_binding_0, ) => {
2768 Crate (
2769 _visitor.fold_vis_crate(_binding_0),
2770 )
2771 }
2772 Restricted(_binding_0, ) => {
2773 Restricted (
2774 _visitor.fold_vis_restricted(_binding_0),
2775 )
2776 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002777 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002778 }
2779}
2780
Nika Layzella6f46c42017-10-26 15:26:16 -04002781pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002782 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002783 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002784 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002785 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002786 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002787 }
2788}
2789
Nika Layzella6f46c42017-10-26 15:26:16 -04002790pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002791 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002792 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002793 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2794 }
2795}
2796
Nika Layzella6f46c42017-10-26 15:26:16 -04002797pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002798 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002799 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002800 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002801 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002802 }
2803}
2804
Nika Layzella6f46c42017-10-26 15:26:16 -04002805pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002806 use ::WherePredicate::*;
2807 match _i {
2808 BoundPredicate(_binding_0, ) => {
2809 BoundPredicate (
2810 _visitor.fold_where_bound_predicate(_binding_0),
2811 )
2812 }
2813 RegionPredicate(_binding_0, ) => {
2814 RegionPredicate (
2815 _visitor.fold_where_region_predicate(_binding_0),
2816 )
2817 }
2818 EqPredicate(_binding_0, ) => {
2819 EqPredicate (
2820 _visitor.fold_where_eq_predicate(_binding_0),
2821 )
2822 }
2823 }
2824}
2825
Nika Layzella6f46c42017-10-26 15:26:16 -04002826pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002827 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002828 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002829 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002830 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002831 }
2832}
2833