blob: 11e071f1a3473a8cd9917a569db60fbe0c490ca9 [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" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500277fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500293fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500298
299fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800308
309fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500310
311fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800321fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500326# [ cfg ( feature = "full" ) ]
327fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
338
339fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
340
341fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
342
David Tolnay323279a2017-12-29 11:26:32 -0500343fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
344
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800345fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
346
347fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
348
349fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
350
351fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
352
353fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
354
355fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
356
David Tolnay0a89b4d2017-11-13 00:55:45 -0800357fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800358
359fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
360
361fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
362
David Tolnay05362582017-12-26 01:33:57 -0500363fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800364
David Tolnay2ae520a2017-12-29 11:19:50 -0500365fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500368# [ cfg ( feature = "full" ) ]
369fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
399}
400
David Tolnayd0adf522017-12-29 01:30:07 -0500401pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
402 _i.span = _visitor.fold_span(_i.span);
403 _i
404}
405
406pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
407 _i.span = _visitor.fold_span(_i.span);
408 _i
409}
410
Nika Layzell27726662017-10-24 23:16:35 -0400411
Nika Layzella6f46c42017-10-26 15:26:16 -0400412pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400413 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500414 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500415 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400416 }
417}
418
Nika Layzellc08227a2017-12-04 16:30:17 -0500419pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
420 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500421 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500423 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400425 }
426}
427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400428pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400429 ArgCaptured {
430 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500431 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800432 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500438 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400440 }
441}
442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400443pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400444 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500446 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500447 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500448 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400449 }
450}
451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400452pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400453 Arm {
454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
455 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400457 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400465 use ::AttrStyle::*;
466 match _i {
467 Outer => { Outer }
468 Inner(_binding_0, ) => {
469 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 )
472 }
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400477 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500480 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 path: _visitor.fold_path(_i . path),
482 tts: _i . tts,
483 is_sugared_doc: _i . is_sugared_doc,
484 }
485}
486
Nika Layzella6f46c42017-10-26 15:26:16 -0400487pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400488 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500489 name: (_i . name).map(|it| { (
490 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800493 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400498 use ::BareFnArgName::*;
499 match _i {
500 Named(_binding_0, ) => {
501 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500502 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 Wild(_binding_0, ) => {
506 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
512
Nika Layzella6f46c42017-10-26 15:26:16 -0400513pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400514 use ::BinOp::*;
515 match _i {
516 Add(_binding_0, ) => {
517 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500518 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400519 )
520 }
521 Sub(_binding_0, ) => {
522 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500523 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400524 )
525 }
526 Mul(_binding_0, ) => {
527 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500528 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400529 )
530 }
531 Div(_binding_0, ) => {
532 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500533 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400534 )
535 }
536 Rem(_binding_0, ) => {
537 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500538 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400539 )
540 }
541 And(_binding_0, ) => {
542 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500543 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400544 )
545 }
546 Or(_binding_0, ) => {
547 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500548 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400549 )
550 }
551 BitXor(_binding_0, ) => {
552 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
556 BitAnd(_binding_0, ) => {
557 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
561 BitOr(_binding_0, ) => {
562 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
566 Shl(_binding_0, ) => {
567 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
571 Shr(_binding_0, ) => {
572 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
576 Eq(_binding_0, ) => {
577 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
581 Lt(_binding_0, ) => {
582 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
586 Le(_binding_0, ) => {
587 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
591 Ne(_binding_0, ) => {
592 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
596 Ge(_binding_0, ) => {
597 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
601 Gt(_binding_0, ) => {
602 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
606 AddEq(_binding_0, ) => {
607 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
611 SubEq(_binding_0, ) => {
612 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
616 MulEq(_binding_0, ) => {
617 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
621 DivEq(_binding_0, ) => {
622 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
626 RemEq(_binding_0, ) => {
627 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
631 BitXorEq(_binding_0, ) => {
632 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
636 BitAndEq(_binding_0, ) => {
637 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
641 BitOrEq(_binding_0, ) => {
642 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
646 ShlEq(_binding_0, ) => {
647 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
651 ShrEq(_binding_0, ) => {
652 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
656 }
657}
658# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400659pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400660 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500661 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
663 }
664}
665
Nika Layzella6f46c42017-10-26 15:26:16 -0400666pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400667 use ::Body::*;
668 match _i {
669 Enum(_binding_0, ) => {
670 Enum (
671 _visitor.fold_body_enum(_binding_0),
672 )
673 }
674 Struct(_binding_0, ) => {
675 Struct (
676 _visitor.fold_body_struct(_binding_0),
677 )
678 }
679 }
680}
681
Nika Layzella6f46c42017-10-26 15:26:16 -0400682pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400683 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500684 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500685 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400686 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
687 }
688}
689
Nika Layzella6f46c42017-10-26 15:26:16 -0400690pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400691 BodyStruct {
692 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500693 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
694 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400695 }
696}
697
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400699 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500700 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
701 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400702 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500703 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400704 }
705}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500706
707pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
708 ConstParam {
709 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500710 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500711 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500712 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500713 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500715 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
716 }
717}
Nika Layzell27726662017-10-24 23:16:35 -0400718
Nika Layzella6f46c42017-10-26 15:26:16 -0400719pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400720 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500722 vis: _visitor.fold_visibility(_i . vis),
723 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400724 generics: _visitor.fold_generics(_i . generics),
725 body: _visitor.fold_body(_i . body),
726 }
727}
728
Nika Layzella6f46c42017-10-26 15:26:16 -0400729pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500730 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400731 match _i {
732 Box(_binding_0, ) => {
733 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400734 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400735 )
736 }
737 InPlace(_binding_0, ) => {
738 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400739 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400740 )
741 }
742 Array(_binding_0, ) => {
743 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400744 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400745 )
746 }
747 Call(_binding_0, ) => {
748 Call (
749 _visitor.fold_expr_call(_binding_0),
750 )
751 }
752 MethodCall(_binding_0, ) => {
753 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400754 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400755 )
756 }
David Tolnay05362582017-12-26 01:33:57 -0500757 Tuple(_binding_0, ) => {
758 Tuple (
759 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400760 )
761 }
762 Binary(_binding_0, ) => {
763 Binary (
764 _visitor.fold_expr_binary(_binding_0),
765 )
766 }
767 Unary(_binding_0, ) => {
768 Unary (
769 _visitor.fold_expr_unary(_binding_0),
770 )
771 }
772 Lit(_binding_0, ) => {
773 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500774 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400775 )
776 }
777 Cast(_binding_0, ) => {
778 Cast (
779 _visitor.fold_expr_cast(_binding_0),
780 )
781 }
782 Type(_binding_0, ) => {
783 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500784 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400785 )
786 }
787 If(_binding_0, ) => {
788 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400789 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400790 )
791 }
792 IfLet(_binding_0, ) => {
793 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400794 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400795 )
796 }
797 While(_binding_0, ) => {
798 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400799 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
802 WhileLet(_binding_0, ) => {
803 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400804 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 )
806 }
807 ForLoop(_binding_0, ) => {
808 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
812 Loop(_binding_0, ) => {
813 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
817 Match(_binding_0, ) => {
818 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400819 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
822 Closure(_binding_0, ) => {
823 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
Nika Layzell640832a2017-12-04 13:37:09 -0500827 Unsafe(_binding_0, ) => {
828 Unsafe (
829 full!(_visitor.fold_expr_unsafe(_binding_0)),
830 )
831 }
Nika Layzell27726662017-10-24 23:16:35 -0400832 Block(_binding_0, ) => {
833 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
837 Assign(_binding_0, ) => {
838 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400839 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
842 AssignOp(_binding_0, ) => {
843 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
847 Field(_binding_0, ) => {
848 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
Nika Layzell27726662017-10-24 23:16:35 -0400852 Index(_binding_0, ) => {
853 Index (
854 _visitor.fold_expr_index(_binding_0),
855 )
856 }
857 Range(_binding_0, ) => {
858 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
862 Path(_binding_0, ) => {
863 Path (
864 _visitor.fold_expr_path(_binding_0),
865 )
866 }
867 AddrOf(_binding_0, ) => {
868 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
872 Break(_binding_0, ) => {
873 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
877 Continue(_binding_0, ) => {
878 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
David Tolnayc246cd32017-12-28 23:14:32 -0500882 Return(_binding_0, ) => {
883 Return (
884 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800887 Macro(_binding_0, ) => {
888 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500889 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
892 Struct(_binding_0, ) => {
893 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
897 Repeat(_binding_0, ) => {
898 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400899 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
902 Paren(_binding_0, ) => {
903 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500904 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
907 Group(_binding_0, ) => {
908 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500909 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400910 )
911 }
912 Try(_binding_0, ) => {
913 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Catch(_binding_0, ) => {
918 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400919 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
922 Yield(_binding_0, ) => {
923 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500927 Verbatim(_binding_0, ) => {
928 Verbatim (
929 _visitor.fold_expr_verbatim(_binding_0),
930 )
931 }
Nika Layzell27726662017-10-24 23:16:35 -0400932 }
933}
934# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500935pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
936 ExprAddrOf {
937 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
938 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500939 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500940 expr: Box::new(_visitor.fold_expr(* _i . expr)),
941 }
942}
943# [ cfg ( feature = "full" ) ]
944pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
945 ExprArray {
946 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
947 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500948 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500949 }
950}
951# [ cfg ( feature = "full" ) ]
952pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
953 ExprAssign {
954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
955 left: Box::new(_visitor.fold_expr(* _i . left)),
956 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
957 right: Box::new(_visitor.fold_expr(* _i . right)),
958 }
959}
960# [ cfg ( feature = "full" ) ]
961pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
962 ExprAssignOp {
963 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
964 left: Box::new(_visitor.fold_expr(* _i . left)),
965 op: _visitor.fold_bin_op(_i . op),
966 right: Box::new(_visitor.fold_expr(* _i . right)),
967 }
968}
969
970pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
971 ExprBinary {
972 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
973 left: Box::new(_visitor.fold_expr(* _i . left)),
974 op: _visitor.fold_bin_op(_i . op),
975 right: Box::new(_visitor.fold_expr(* _i . right)),
976 }
977}
978# [ cfg ( feature = "full" ) ]
979pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
980 ExprBlock {
981 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
982 block: _visitor.fold_block(_i . block),
983 }
984}
985# [ cfg ( feature = "full" ) ]
986pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
987 ExprBox {
988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
989 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
990 expr: Box::new(_visitor.fold_expr(* _i . expr)),
991 }
992}
993# [ cfg ( feature = "full" ) ]
994pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
995 ExprBreak {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
998 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
999 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1000 }
1001}
1002
1003pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1004 ExprCall {
1005 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1006 func: Box::new(_visitor.fold_expr(* _i . func)),
1007 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1008 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1009 }
1010}
1011
1012pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1013 ExprCast {
1014 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1015 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1016 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1017 ty: Box::new(_visitor.fold_type(* _i . ty)),
1018 }
1019}
1020# [ cfg ( feature = "full" ) ]
1021pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1022 ExprCatch {
1023 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1024 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1025 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1026 block: _visitor.fold_block(_i . block),
1027 }
1028}
1029# [ cfg ( feature = "full" ) ]
1030pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1031 ExprClosure {
1032 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001033 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001034 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1035 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1036 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1037 output: _visitor.fold_return_type(_i . output),
1038 body: Box::new(_visitor.fold_expr(* _i . body)),
1039 }
1040}
1041# [ cfg ( feature = "full" ) ]
1042pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1043 ExprContinue {
1044 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1045 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1046 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1047 }
1048}
1049# [ cfg ( feature = "full" ) ]
1050pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1051 ExprField {
1052 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1053 base: Box::new(_visitor.fold_expr(* _i . base)),
1054 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1055 member: _visitor.fold_member(_i . member),
1056 }
1057}
1058# [ cfg ( feature = "full" ) ]
1059pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1060 ExprForLoop {
1061 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1062 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1063 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1064 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1065 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1066 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1067 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1068 body: _visitor.fold_block(_i . body),
1069 }
1070}
David Tolnaye98775f2017-12-28 23:17:00 -05001071# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001072pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1073 ExprGroup {
1074 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1075 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1076 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1077 }
1078}
1079# [ cfg ( feature = "full" ) ]
1080pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1081 ExprIf {
1082 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1083 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1084 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001085 then_branch: _visitor.fold_block(_i . then_branch),
1086 else_branch: (_i . else_branch).map(|it| { (
1087 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1088 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1089 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001090 }
1091}
1092# [ cfg ( feature = "full" ) ]
1093pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1094 ExprIfLet {
1095 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1096 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1097 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1098 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1099 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1100 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001101 then_branch: _visitor.fold_block(_i . then_branch),
1102 else_branch: (_i . else_branch).map(|it| { (
1103 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1104 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1105 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001106 }
1107}
1108# [ cfg ( feature = "full" ) ]
1109pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1110 ExprInPlace {
1111 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1112 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001113 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001114 value: Box::new(_visitor.fold_expr(* _i . value)),
1115 }
1116}
1117
1118pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1119 ExprIndex {
1120 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1121 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1122 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1123 index: Box::new(_visitor.fold_expr(* _i . index)),
1124 }
1125}
1126
1127pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1128 ExprLit {
1129 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1130 lit: _visitor.fold_lit(_i . lit),
1131 }
1132}
1133# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001134pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001135 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001136 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001137 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001138 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001139 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1140 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001141 }
1142}
1143# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001144pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1145 ExprMacro {
1146 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1147 mac: _visitor.fold_macro(_i . mac),
1148 }
1149}
1150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001151pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001152 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001153 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001154 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001155 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001156 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001157 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1158 }
1159}
1160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001161pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001162 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001163 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001164 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001165 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001166 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001167 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001168 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1169 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001170 }
1171}
David Tolnaye98775f2017-12-28 23:17:00 -05001172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001173pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001174 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001175 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001176 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001177 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
1179}
1180
Nika Layzella6f46c42017-10-26 15:26:16 -04001181pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001182 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001183 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001184 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001185 path: _visitor.fold_path(_i . path),
1186 }
1187}
1188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001189pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001190 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001191 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001192 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001193 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001194 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001195 }
1196}
1197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001198pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001199 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001200 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001201 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001202 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001203 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001204 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1205 }
1206}
1207# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001208pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1209 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001210 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001211 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001212 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
1214}
1215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001216pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001218 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001219 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001220 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001221 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1222 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1223 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
1225}
1226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001227pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001228 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001229 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001231 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
1233}
1234# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001235pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1236 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001237 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001238 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001239 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001240 }
1241}
David Tolnay0cf94f22017-12-28 23:46:26 -05001242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001243pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001244 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001246 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001247 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001248 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001249 }
1250}
1251
Nika Layzella6f46c42017-10-26 15:26:16 -04001252pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001253 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001254 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001255 op: _visitor.fold_un_op(_i . op),
1256 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1257 }
1258}
1259# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001260pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1261 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001262 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001263 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001264 block: _visitor.fold_block(_i . block),
1265 }
1266}
David Tolnay2ae520a2017-12-29 11:19:50 -05001267
1268pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1269 ExprVerbatim {
1270 tts: _i . tts,
1271 }
1272}
Nika Layzell640832a2017-12-04 13:37:09 -05001273# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001274pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001275 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001276 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001277 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001278 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1279 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001280 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1281 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001282 }
1283}
1284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001285pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001286 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001287 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001288 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001289 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1290 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1291 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001292 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001294 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1295 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001296 }
1297}
1298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001299pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001300 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001301 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001302 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001303 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001304 }
1305}
1306
Nika Layzella6f46c42017-10-26 15:26:16 -04001307pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001308 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001310 vis: _visitor.fold_visibility(_i . vis),
1311 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001313 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001314 }
1315}
1316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001317pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001318 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001320 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001321 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001322 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001323 }
1324}
1325# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001326pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001327 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001328 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1329 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001330 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001331 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001332 }
1333}
1334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001335pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001336 File {
1337 shebang: _i . shebang,
1338 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1339 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1340 }
1341}
1342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001343pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001344 use ::FnArg::*;
1345 match _i {
1346 SelfRef(_binding_0, ) => {
1347 SelfRef (
1348 _visitor.fold_arg_self_ref(_binding_0),
1349 )
1350 }
1351 SelfValue(_binding_0, ) => {
1352 SelfValue (
1353 _visitor.fold_arg_self(_binding_0),
1354 )
1355 }
1356 Captured(_binding_0, ) => {
1357 Captured (
1358 _visitor.fold_arg_captured(_binding_0),
1359 )
1360 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001361 Inferred(_binding_0, ) => {
1362 Inferred (
1363 _visitor.fold_pat(_binding_0),
1364 )
1365 }
Nika Layzell27726662017-10-24 23:16:35 -04001366 Ignored(_binding_0, ) => {
1367 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001368 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001369 )
1370 }
1371 }
1372}
1373# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001374pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001375 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001376 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001377 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001378 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001379 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001380 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001381 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001382 }
1383}
1384# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001385pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001386 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001387 match _i {
1388 Fn(_binding_0, ) => {
1389 Fn (
1390 _visitor.fold_foreign_item_fn(_binding_0),
1391 )
1392 }
1393 Static(_binding_0, ) => {
1394 Static (
1395 _visitor.fold_foreign_item_static(_binding_0),
1396 )
1397 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001398 Type(_binding_0, ) => {
1399 Type (
1400 _visitor.fold_foreign_item_type(_binding_0),
1401 )
1402 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001403 Verbatim(_binding_0, ) => {
1404 Verbatim (
1405 _visitor.fold_foreign_item_verbatim(_binding_0),
1406 )
1407 }
Nika Layzell27726662017-10-24 23:16:35 -04001408 }
1409}
1410# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001411pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1412 ForeignItemFn {
1413 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1414 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001415 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001416 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001417 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001418 }
1419}
1420# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001421pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001422 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001423 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1424 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001425 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001426 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001427 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001428 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001429 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001430 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001431 }
1432}
David Tolnay199bcbb2017-11-12 10:33:52 -08001433# [ cfg ( feature = "full" ) ]
1434pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1435 ForeignItemType {
1436 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1437 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001438 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001439 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001440 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001441 }
1442}
David Tolnay2ae520a2017-12-29 11:19:50 -05001443# [ cfg ( feature = "full" ) ]
1444pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1445 ForeignItemVerbatim {
1446 tts: _i . tts,
1447 }
1448}
Nika Layzell27726662017-10-24 23:16:35 -04001449
Nika Layzellc08227a2017-12-04 16:30:17 -05001450pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1451 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001452 match _i {
1453 Lifetime(_binding_0, ) => {
1454 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001455 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001456 )
1457 }
1458 Type(_binding_0, ) => {
1459 Type (
1460 _visitor.fold_type(_binding_0),
1461 )
1462 }
1463 TypeBinding(_binding_0, ) => {
1464 TypeBinding (
1465 _visitor.fold_type_binding(_binding_0),
1466 )
1467 }
Nika Layzellc680e612017-12-04 19:07:20 -05001468 Const(_binding_0, ) => {
1469 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001470 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001471 )
1472 }
Nika Layzell357885a2017-12-04 15:47:07 -05001473 }
1474}
David Tolnayd60cfec2017-12-29 00:21:38 -05001475# [ cfg ( feature = "full" ) ]
1476pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1477 use ::GenericMethodArgument::*;
1478 match _i {
1479 Type(_binding_0, ) => {
1480 Type (
1481 _visitor.fold_type(_binding_0),
1482 )
1483 }
1484 Const(_binding_0, ) => {
1485 Const (
1486 _visitor.fold_expr(_binding_0),
1487 )
1488 }
1489 }
1490}
Nika Layzell357885a2017-12-04 15:47:07 -05001491
David Tolnayc2f1aba2017-11-12 20:29:22 -08001492pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1493 use ::GenericParam::*;
1494 match _i {
1495 Lifetime(_binding_0, ) => {
1496 Lifetime (
1497 _visitor.fold_lifetime_def(_binding_0),
1498 )
1499 }
1500 Type(_binding_0, ) => {
1501 Type (
1502 _visitor.fold_type_param(_binding_0),
1503 )
1504 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001505 Const(_binding_0, ) => {
1506 Const (
1507 _visitor.fold_const_param(_binding_0),
1508 )
1509 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001510 }
1511}
1512
Nika Layzella6f46c42017-10-26 15:26:16 -04001513pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001514 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001515 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001516 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001517 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001518 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001519 }
1520}
1521# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001522pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001523 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001524 match _i {
1525 Const(_binding_0, ) => {
1526 Const (
1527 _visitor.fold_impl_item_const(_binding_0),
1528 )
1529 }
1530 Method(_binding_0, ) => {
1531 Method (
1532 _visitor.fold_impl_item_method(_binding_0),
1533 )
1534 }
1535 Type(_binding_0, ) => {
1536 Type (
1537 _visitor.fold_impl_item_type(_binding_0),
1538 )
1539 }
1540 Macro(_binding_0, ) => {
1541 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001542 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001543 )
1544 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001545 Verbatim(_binding_0, ) => {
1546 Verbatim (
1547 _visitor.fold_impl_item_verbatim(_binding_0),
1548 )
1549 }
Nika Layzell27726662017-10-24 23:16:35 -04001550 }
1551}
1552# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001553pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1554 ImplItemConst {
1555 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1556 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001557 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001558 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001559 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001560 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001561 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001562 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001563 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001564 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001565 }
1566}
1567# [ cfg ( feature = "full" ) ]
1568pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1569 ImplItemMacro {
1570 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1571 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001572 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001573 }
1574}
1575# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001576pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001577 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001578 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001579 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001580 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001581 sig: _visitor.fold_method_sig(_i . sig),
1582 block: _visitor.fold_block(_i . block),
1583 }
1584}
1585# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001586pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001587 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001588 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001589 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001590 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001592 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001593 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001594 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001595 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001596 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001597 }
1598}
David Tolnay2ae520a2017-12-29 11:19:50 -05001599# [ cfg ( feature = "full" ) ]
1600pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1601 ImplItemVerbatim {
1602 tts: _i . tts,
1603 }
1604}
David Tolnay14982012017-12-29 00:49:51 -05001605
David Tolnay85b69a42017-12-27 20:43:10 -05001606pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1607 Index {
1608 index: _i . index,
1609 span: _visitor.fold_span(_i . span),
1610 }
1611}
1612# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001613pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001614 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001615 match _i {
1616 ExternCrate(_binding_0, ) => {
1617 ExternCrate (
1618 _visitor.fold_item_extern_crate(_binding_0),
1619 )
1620 }
1621 Use(_binding_0, ) => {
1622 Use (
1623 _visitor.fold_item_use(_binding_0),
1624 )
1625 }
1626 Static(_binding_0, ) => {
1627 Static (
1628 _visitor.fold_item_static(_binding_0),
1629 )
1630 }
1631 Const(_binding_0, ) => {
1632 Const (
1633 _visitor.fold_item_const(_binding_0),
1634 )
1635 }
1636 Fn(_binding_0, ) => {
1637 Fn (
1638 _visitor.fold_item_fn(_binding_0),
1639 )
1640 }
1641 Mod(_binding_0, ) => {
1642 Mod (
1643 _visitor.fold_item_mod(_binding_0),
1644 )
1645 }
1646 ForeignMod(_binding_0, ) => {
1647 ForeignMod (
1648 _visitor.fold_item_foreign_mod(_binding_0),
1649 )
1650 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001651 Type(_binding_0, ) => {
1652 Type (
1653 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001654 )
1655 }
1656 Enum(_binding_0, ) => {
1657 Enum (
1658 _visitor.fold_item_enum(_binding_0),
1659 )
1660 }
1661 Struct(_binding_0, ) => {
1662 Struct (
1663 _visitor.fold_item_struct(_binding_0),
1664 )
1665 }
1666 Union(_binding_0, ) => {
1667 Union (
1668 _visitor.fold_item_union(_binding_0),
1669 )
1670 }
1671 Trait(_binding_0, ) => {
1672 Trait (
1673 _visitor.fold_item_trait(_binding_0),
1674 )
1675 }
1676 DefaultImpl(_binding_0, ) => {
1677 DefaultImpl (
1678 _visitor.fold_item_default_impl(_binding_0),
1679 )
1680 }
1681 Impl(_binding_0, ) => {
1682 Impl (
1683 _visitor.fold_item_impl(_binding_0),
1684 )
1685 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001686 Macro(_binding_0, ) => {
1687 Macro (
1688 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001689 )
1690 }
David Tolnay500d8322017-12-18 00:32:51 -08001691 Macro2(_binding_0, ) => {
1692 Macro2 (
1693 _visitor.fold_item_macro2(_binding_0),
1694 )
1695 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001696 Verbatim(_binding_0, ) => {
1697 Verbatim (
1698 _visitor.fold_item_verbatim(_binding_0),
1699 )
1700 }
Nika Layzell27726662017-10-24 23:16:35 -04001701 }
1702}
1703# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001704pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1705 ItemConst {
1706 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1707 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001708 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001709 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001710 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001711 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001712 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001713 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001714 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001715 }
1716}
1717# [ cfg ( feature = "full" ) ]
1718pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1719 ItemDefaultImpl {
1720 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001721 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001722 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001723 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001724 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1725 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001726 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001727 }
1728}
1729# [ cfg ( feature = "full" ) ]
1730pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1731 ItemEnum {
1732 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1733 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001734 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001735 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001736 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001737 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001738 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1739 }
1740}
1741# [ cfg ( feature = "full" ) ]
1742pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1743 ItemExternCrate {
1744 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1745 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001746 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1747 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001748 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001749 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001750 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001751 _visitor.fold_ident(( it ) . 1),
1752 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001753 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754 }
1755}
1756# [ cfg ( feature = "full" ) ]
1757pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1758 ItemFn {
1759 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1760 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001761 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001762 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001763 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001764 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001765 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001766 block: Box::new(_visitor.fold_block(* _i . block)),
1767 }
1768}
1769# [ cfg ( feature = "full" ) ]
1770pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1771 ItemForeignMod {
1772 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1773 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001774 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001775 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1776 }
1777}
1778# [ cfg ( feature = "full" ) ]
1779pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1780 ItemImpl {
1781 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001782 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001783 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001786 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001787 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001788 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001789 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001790 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001791 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001792 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1794 }
1795}
1796# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001797pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1798 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001799 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001800 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001801 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001802 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001803 }
1804}
1805# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001806pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1807 ItemMacro2 {
1808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1809 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001811 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001812 args: _i . args,
1813 body: _i . body,
1814 }
1815}
1816# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001817pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001818 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001819 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001820 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001821 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001822 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001823 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001824 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001825 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1826 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001828 }
1829}
1830# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001831pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001832 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001833 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001834 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001835 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001836 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001837 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001839 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001840 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001841 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001843 }
1844}
1845# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001846pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001847 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001848 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001849 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001851 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001852 generics: _visitor.fold_generics(_i . generics),
1853 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001854 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001855 }
1856}
1857# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001858pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001859 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001860 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001861 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001862 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1864 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001865 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001866 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001868 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001869 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001870 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1871 }
1872}
1873# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001874pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1875 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001876 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001877 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001878 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001879 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001880 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001881 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001882 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
1885}
1886# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001888 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001892 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001893 generics: _visitor.fold_generics(_i . generics),
1894 data: _visitor.fold_variant_data(_i . data),
1895 }
1896}
1897# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001898pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001899 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001900 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001901 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1903 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001904 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1905 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001907 }
1908}
David Tolnay2ae520a2017-12-29 11:19:50 -05001909# [ cfg ( feature = "full" ) ]
1910pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1911 ItemVerbatim {
1912 tts: _i . tts,
1913 }
1914}
Nika Layzell27726662017-10-24 23:16:35 -04001915
Nika Layzella6f46c42017-10-26 15:26:16 -04001916pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001917 LifetimeDef {
1918 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001919 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001920 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001921 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1922 }
1923}
1924
1925pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1926 Lit {
1927 value: _i . value,
1928 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001929 }
1930}
1931# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001932pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001933 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001934 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001935 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1936 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1937 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1938 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1939 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1940 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1941 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001942 }
1943}
Nika Layzell27726662017-10-24 23:16:35 -04001944
David Tolnaydecf28d2017-11-11 11:56:45 -08001945pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1946 Macro {
1947 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001948 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayfe9d2782017-12-29 11:32:42 -05001949 tt: _i . tt,
David Tolnaydecf28d2017-11-11 11:56:45 -08001950 }
1951}
David Tolnay14982012017-12-29 00:49:51 -05001952
David Tolnay85b69a42017-12-27 20:43:10 -05001953pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1954 use ::Member::*;
1955 match _i {
1956 Named(_binding_0, ) => {
1957 Named (
1958 _visitor.fold_ident(_binding_0),
1959 )
1960 }
1961 Unnamed(_binding_0, ) => {
1962 Unnamed (
1963 _visitor.fold_index(_binding_0),
1964 )
1965 }
1966 }
1967}
David Tolnaydecf28d2017-11-11 11:56:45 -08001968
Nika Layzella6f46c42017-10-26 15:26:16 -04001969pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001970 use ::MetaItem::*;
1971 match _i {
1972 Term(_binding_0, ) => {
1973 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001974 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001975 )
1976 }
1977 List(_binding_0, ) => {
1978 List (
1979 _visitor.fold_meta_item_list(_binding_0),
1980 )
1981 }
1982 NameValue(_binding_0, ) => {
1983 NameValue (
1984 _visitor.fold_meta_name_value(_binding_0),
1985 )
1986 }
1987 }
1988}
1989
Nika Layzella6f46c42017-10-26 15:26:16 -04001990pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001991 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001992 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001993 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001994 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1995 }
1996}
1997
Nika Layzella6f46c42017-10-26 15:26:16 -04001998pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001999 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002000 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002001 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002002 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002003 }
2004}
2005# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002006pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002007 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002008 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002009 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002010 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002011 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002012 decl: _visitor.fold_fn_decl(_i . decl),
2013 }
2014}
David Tolnayd60cfec2017-12-29 00:21:38 -05002015# [ cfg ( feature = "full" ) ]
2016pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2017 MethodTurbofish {
2018 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2019 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2020 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2021 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2022 }
2023}
Nika Layzell27726662017-10-24 23:16:35 -04002024
Nika Layzella6f46c42017-10-26 15:26:16 -04002025pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002026 use ::NestedMetaItem::*;
2027 match _i {
2028 MetaItem(_binding_0, ) => {
2029 MetaItem (
2030 _visitor.fold_meta_item(_binding_0),
2031 )
2032 }
2033 Literal(_binding_0, ) => {
2034 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002035 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002036 )
2037 }
2038 }
2039}
2040
Nika Layzellc08227a2017-12-04 16:30:17 -05002041pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2042 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002043 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002044 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002045 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
2047}
2048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002049pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002050 use ::Pat::*;
2051 match _i {
2052 Wild(_binding_0, ) => {
2053 Wild (
2054 _visitor.fold_pat_wild(_binding_0),
2055 )
2056 }
2057 Ident(_binding_0, ) => {
2058 Ident (
2059 _visitor.fold_pat_ident(_binding_0),
2060 )
2061 }
2062 Struct(_binding_0, ) => {
2063 Struct (
2064 _visitor.fold_pat_struct(_binding_0),
2065 )
2066 }
2067 TupleStruct(_binding_0, ) => {
2068 TupleStruct (
2069 _visitor.fold_pat_tuple_struct(_binding_0),
2070 )
2071 }
2072 Path(_binding_0, ) => {
2073 Path (
2074 _visitor.fold_pat_path(_binding_0),
2075 )
2076 }
2077 Tuple(_binding_0, ) => {
2078 Tuple (
2079 _visitor.fold_pat_tuple(_binding_0),
2080 )
2081 }
2082 Box(_binding_0, ) => {
2083 Box (
2084 _visitor.fold_pat_box(_binding_0),
2085 )
2086 }
2087 Ref(_binding_0, ) => {
2088 Ref (
2089 _visitor.fold_pat_ref(_binding_0),
2090 )
2091 }
2092 Lit(_binding_0, ) => {
2093 Lit (
2094 _visitor.fold_pat_lit(_binding_0),
2095 )
2096 }
2097 Range(_binding_0, ) => {
2098 Range (
2099 _visitor.fold_pat_range(_binding_0),
2100 )
2101 }
2102 Slice(_binding_0, ) => {
2103 Slice (
2104 _visitor.fold_pat_slice(_binding_0),
2105 )
2106 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002107 Macro(_binding_0, ) => {
2108 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002109 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002110 )
2111 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002112 Verbatim(_binding_0, ) => {
2113 Verbatim (
2114 _visitor.fold_pat_verbatim(_binding_0),
2115 )
2116 }
Nika Layzell27726662017-10-24 23:16:35 -04002117 }
2118}
2119# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002120pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002121 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002122 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002123 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002124 }
2125}
2126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002127pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002128 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002129 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2130 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002131 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002132 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002133 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002134 }
2135}
2136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002137pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002138 PatLit {
2139 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2140 }
2141}
2142# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002143pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2144 PatMacro {
2145 mac: _visitor.fold_macro(_i . mac),
2146 }
2147}
2148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002149pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002150 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002151 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002152 path: _visitor.fold_path(_i . path),
2153 }
2154}
2155# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002156pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002157 PatRange {
2158 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002159 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002160 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002161 }
2162}
2163# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002164pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002165 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002166 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002167 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002168 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002169 }
2170}
2171# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002172pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002173 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002174 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002175 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002176 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002177 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002178 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002179 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
2181}
2182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002183pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002184 PatStruct {
2185 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002186 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002187 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002188 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
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<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002193 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002194 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002195 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002196 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002197 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2198 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002199 }
2200}
2201# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002202pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002203 PatTupleStruct {
2204 path: _visitor.fold_path(_i . path),
2205 pat: _visitor.fold_pat_tuple(_i . pat),
2206 }
2207}
2208# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002209pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2210 PatVerbatim {
2211 tts: _i . tts,
2212 }
2213}
2214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002215pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002216 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002217 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002218 }
2219}
2220
Nika Layzella6f46c42017-10-26 15:26:16 -04002221pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002222 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002223 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002224 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2225 }
2226}
Nika Layzellc08227a2017-12-04 16:30:17 -05002227
2228pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2229 use ::PathArguments::*;
2230 match _i {
2231 None => { None }
2232 AngleBracketed(_binding_0, ) => {
2233 AngleBracketed (
2234 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2235 )
2236 }
2237 Parenthesized(_binding_0, ) => {
2238 Parenthesized (
2239 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2240 )
2241 }
2242 }
2243}
Nika Layzell27726662017-10-24 23:16:35 -04002244
Nika Layzella6f46c42017-10-26 15:26:16 -04002245pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002246 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002247 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002248 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002249 }
2250}
Nika Layzell27726662017-10-24 23:16:35 -04002251
Nika Layzella6f46c42017-10-26 15:26:16 -04002252pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002253 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002254 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002255 trait_ref: _visitor.fold_path(_i . trait_ref),
2256 }
2257}
2258
Nika Layzella6f46c42017-10-26 15:26:16 -04002259pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002260 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002261 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002262 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002263 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002264 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2265 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002266 }
2267}
2268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002269pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002270 use ::RangeLimits::*;
2271 match _i {
2272 HalfOpen(_binding_0, ) => {
2273 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002274 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002275 )
2276 }
2277 Closed(_binding_0, ) => {
2278 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002279 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002280 )
2281 }
2282 }
2283}
David Tolnayf93b90d2017-11-11 19:21:26 -08002284
2285pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2286 use ::ReturnType::*;
2287 match _i {
2288 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002289 Type(_binding_0, _binding_1, ) => {
2290 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002291 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2292 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002293 )
2294 }
2295 }
2296}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002297
2298pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2299 _i
2300}
Nika Layzell27726662017-10-24 23:16:35 -04002301# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002302pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002303 use ::Stmt::*;
2304 match _i {
2305 Local(_binding_0, ) => {
2306 Local (
2307 Box::new(_visitor.fold_local(* _binding_0)),
2308 )
2309 }
2310 Item(_binding_0, ) => {
2311 Item (
2312 Box::new(_visitor.fold_item(* _binding_0)),
2313 )
2314 }
2315 Expr(_binding_0, ) => {
2316 Expr (
2317 Box::new(_visitor.fold_expr(* _binding_0)),
2318 )
2319 }
2320 Semi(_binding_0, _binding_1, ) => {
2321 Semi (
2322 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002323 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002324 )
2325 }
Nika Layzell27726662017-10-24 23:16:35 -04002326 }
2327}
2328
Nika Layzella6f46c42017-10-26 15:26:16 -04002329pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002330 use ::TraitBoundModifier::*;
2331 match _i {
2332 None => { None }
2333 Maybe(_binding_0, ) => {
2334 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002335 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002336 )
2337 }
2338 }
2339}
2340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002341pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002342 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002343 match _i {
2344 Const(_binding_0, ) => {
2345 Const (
2346 _visitor.fold_trait_item_const(_binding_0),
2347 )
2348 }
2349 Method(_binding_0, ) => {
2350 Method (
2351 _visitor.fold_trait_item_method(_binding_0),
2352 )
2353 }
2354 Type(_binding_0, ) => {
2355 Type (
2356 _visitor.fold_trait_item_type(_binding_0),
2357 )
2358 }
2359 Macro(_binding_0, ) => {
2360 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002361 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002362 )
2363 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002364 Verbatim(_binding_0, ) => {
2365 Verbatim (
2366 _visitor.fold_trait_item_verbatim(_binding_0),
2367 )
2368 }
Nika Layzell27726662017-10-24 23:16:35 -04002369 }
2370}
2371# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002372pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2373 TraitItemConst {
2374 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002375 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002376 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002377 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002378 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002379 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002380 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002381 _visitor.fold_expr(( it ) . 1),
2382 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002383 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002384 }
2385}
2386# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002387pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2388 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002389 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002390 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002391 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002392 }
2393}
2394# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002395pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002396 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002397 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002398 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002399 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002400 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002401 }
2402}
2403# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002404pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002405 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002406 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002407 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002408 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002409 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002410 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002411 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002412 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002413 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002414 _visitor.fold_type(( it ) . 1),
2415 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002416 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002417 }
2418}
David Tolnay2ae520a2017-12-29 11:19:50 -05002419# [ cfg ( feature = "full" ) ]
2420pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2421 TraitItemVerbatim {
2422 tts: _i . tts,
2423 }
2424}
Nika Layzell27726662017-10-24 23:16:35 -04002425
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002426pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2427 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002428 match _i {
2429 Slice(_binding_0, ) => {
2430 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002431 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002432 )
2433 }
2434 Array(_binding_0, ) => {
2435 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002436 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002437 )
2438 }
2439 Ptr(_binding_0, ) => {
2440 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002441 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002442 )
2443 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002444 Reference(_binding_0, ) => {
2445 Reference (
2446 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002447 )
2448 }
2449 BareFn(_binding_0, ) => {
2450 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002451 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002452 )
2453 }
2454 Never(_binding_0, ) => {
2455 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002456 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002457 )
2458 }
David Tolnay05362582017-12-26 01:33:57 -05002459 Tuple(_binding_0, ) => {
2460 Tuple (
2461 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002462 )
2463 }
2464 Path(_binding_0, ) => {
2465 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002467 )
2468 }
2469 TraitObject(_binding_0, ) => {
2470 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
2474 ImplTrait(_binding_0, ) => {
2475 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002476 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002477 )
2478 }
2479 Paren(_binding_0, ) => {
2480 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002481 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002482 )
2483 }
2484 Group(_binding_0, ) => {
2485 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002486 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002487 )
2488 }
2489 Infer(_binding_0, ) => {
2490 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002491 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002492 )
2493 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002494 Macro(_binding_0, ) => {
2495 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002496 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002497 )
2498 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002499 Verbatim(_binding_0, ) => {
2500 Verbatim (
2501 _visitor.fold_type_verbatim(_binding_0),
2502 )
2503 }
Nika Layzell27726662017-10-24 23:16:35 -04002504 }
2505}
2506
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002507pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2508 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002509 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002510 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002511 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002512 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002513 }
2514}
2515
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2517 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002518 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2519 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2520 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2521 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2522 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2523 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2524 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2525 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002526 }
2527}
2528
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002529pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2530 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002531 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002532 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533 ty: _visitor.fold_type(_i . ty),
2534 }
2535}
2536
2537pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2538 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002539 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002540 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002541 }
2542}
2543
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2545 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002546 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002547 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002548 }
2549}
2550
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002551pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2552 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002553 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnay323279a2017-12-29 11:26:32 -05002557pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2558 TypeMacro {
2559 mac: _visitor.fold_macro(_i . mac),
2560 }
2561}
2562
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002563pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2564 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002565 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002566 }
2567}
2568
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002569pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2570 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002571 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002572 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002573 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002575 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002576 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002577 }
2578}
2579
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002580pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2581 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002582 match _i {
2583 Trait(_binding_0, _binding_1, ) => {
2584 Trait (
2585 _visitor.fold_poly_trait_ref(_binding_0),
2586 _visitor.fold_trait_bound_modifier(_binding_1),
2587 )
2588 }
2589 Region(_binding_0, ) => {
2590 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002591 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002592 )
2593 }
2594 }
2595}
2596
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2598 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002599 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002600 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002601 }
2602}
2603
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002604pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2605 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002606 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002607 path: _visitor.fold_path(_i . path),
2608 }
2609}
2610
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2612 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002613 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2614 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002615 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2616 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002617 }
2618}
2619
David Tolnay0a89b4d2017-11-13 00:55:45 -08002620pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2621 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002622 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002623 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002624 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2625 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002626 }
2627}
2628
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002629pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2630 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002631 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002632 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002633 }
2634}
2635
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002636pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2637 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002638 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002639 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002640 }
2641}
2642
David Tolnay05362582017-12-26 01:33:57 -05002643pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2644 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002645 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002646 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002647 }
2648}
2649
David Tolnay2ae520a2017-12-29 11:19:50 -05002650pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2651 TypeVerbatim {
2652 tts: _i . tts,
2653 }
2654}
2655
Nika Layzella6f46c42017-10-26 15:26:16 -04002656pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002657 use ::UnOp::*;
2658 match _i {
2659 Deref(_binding_0, ) => {
2660 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002661 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002662 )
2663 }
2664 Not(_binding_0, ) => {
2665 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002666 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002667 )
2668 }
2669 Neg(_binding_0, ) => {
2670 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002671 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002672 )
2673 }
2674 }
2675}
David Tolnay5f332a92017-12-26 00:42:45 -05002676# [ cfg ( feature = "full" ) ]
2677pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2678 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002679 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002680 }
2681}
2682# [ cfg ( feature = "full" ) ]
2683pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2684 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002685 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002686 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2687 }
2688}
2689# [ cfg ( feature = "full" ) ]
2690pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2691 UsePath {
2692 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002693 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002694 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002695 _visitor.fold_ident(( it ) . 1),
2696 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002697 }
2698}
2699# [ cfg ( feature = "full" ) ]
2700pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2701 use ::UseTree::*;
2702 match _i {
2703 Path(_binding_0, ) => {
2704 Path (
2705 _visitor.fold_use_path(_binding_0),
2706 )
2707 }
2708 Glob(_binding_0, ) => {
2709 Glob (
2710 _visitor.fold_use_glob(_binding_0),
2711 )
2712 }
2713 List(_binding_0, ) => {
2714 List (
2715 _visitor.fold_use_list(_binding_0),
2716 )
2717 }
2718 }
2719}
Nika Layzell27726662017-10-24 23:16:35 -04002720
Nika Layzella6f46c42017-10-26 15:26:16 -04002721pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002722 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002723 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002724 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002725 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002726 discriminant: (_i . discriminant).map(|it| { (
2727 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2728 _visitor.fold_expr(( it ) . 1),
2729 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002730 }
2731}
2732
Nika Layzella6f46c42017-10-26 15:26:16 -04002733pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002734 use ::VariantData::*;
2735 match _i {
2736 Struct(_binding_0, _binding_1, ) => {
2737 Struct (
2738 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002739 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002740 )
2741 }
2742 Tuple(_binding_0, _binding_1, ) => {
2743 Tuple (
2744 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002745 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002746 )
2747 }
2748 Unit => { Unit }
2749 }
2750}
Nika Layzell27726662017-10-24 23:16:35 -04002751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002753 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002755 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002756 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002757 }
2758}
2759
Nika Layzella6f46c42017-10-26 15:26:16 -04002760pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002761 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002762 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002763 }
2764}
2765
Nika Layzella6f46c42017-10-26 15:26:16 -04002766pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002767 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002768 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002769 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002770 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002771 path: Box::new(_visitor.fold_path(* _i . path)),
2772 }
2773}
2774
Nika Layzella6f46c42017-10-26 15:26:16 -04002775pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002776 use ::Visibility::*;
2777 match _i {
2778 Public(_binding_0, ) => {
2779 Public (
2780 _visitor.fold_vis_public(_binding_0),
2781 )
2782 }
2783 Crate(_binding_0, ) => {
2784 Crate (
2785 _visitor.fold_vis_crate(_binding_0),
2786 )
2787 }
2788 Restricted(_binding_0, ) => {
2789 Restricted (
2790 _visitor.fold_vis_restricted(_binding_0),
2791 )
2792 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002793 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002794 }
2795}
2796
Nika Layzella6f46c42017-10-26 15:26:16 -04002797pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002798 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002799 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002800 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002801 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002802 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002803 }
2804}
2805
Nika Layzella6f46c42017-10-26 15:26:16 -04002806pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002807 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002808 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002809 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2810 }
2811}
2812
Nika Layzella6f46c42017-10-26 15:26:16 -04002813pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002814 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002815 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002816 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002817 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002818 }
2819}
2820
Nika Layzella6f46c42017-10-26 15:26:16 -04002821pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002822 use ::WherePredicate::*;
2823 match _i {
2824 BoundPredicate(_binding_0, ) => {
2825 BoundPredicate (
2826 _visitor.fold_where_bound_predicate(_binding_0),
2827 )
2828 }
2829 RegionPredicate(_binding_0, ) => {
2830 RegionPredicate (
2831 _visitor.fold_where_region_predicate(_binding_0),
2832 )
2833 }
2834 EqPredicate(_binding_0, ) => {
2835 EqPredicate (
2836 _visitor.fold_where_eq_predicate(_binding_0),
2837 )
2838 }
2839 }
2840}
2841
Nika Layzella6f46c42017-10-26 15:26:16 -04002842pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002843 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002844 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002845 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002846 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002847 }
2848}
2849