blob: 6c1d54b31b7fe4ee487b5b0bd977b111f38ba3c7 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnay0afc9b32017-12-27 13:38:24 -05003#![cfg_attr(rustfmt, rustfmt_skip)]
4
Nika Layzell27726662017-10-24 23:16:35 -04005// Unreachable code is generated sometimes without the full feature.
6#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -05007#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -04008
Nika Layzella6f46c42017-10-26 15:26:16 -04009use *;
David Tolnay0a0d78c2018-01-05 15:24:01 -080010#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay1e01f9c2017-12-28 20:16:19 -050011use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050012use proc_macro2::Span;
David Tolnay0a0d78c2018-01-05 15:24:01 -080013#[cfg(any(feature = "full", feature = "derive"))]
David Tolnayf60f4262017-12-28 19:17:58 -050014use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040015
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040016
17#[cfg(feature = "full")]
18macro_rules! full {
19 ($e:expr) => { $e }
20}
21
David Tolnay0a0d78c2018-01-05 15:24:01 -080022#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040023macro_rules! full {
24 ($e:expr) => { unreachable!() }
25}
26
27
David Tolnayded2d682018-01-06 18:53:53 -080028/// Syntax tree traversal to transform the nodes of an owned syntax tree.
Nika Layzell27726662017-10-24 23:16:35 -040029///
David Tolnayded2d682018-01-06 18:53:53 -080030/// See the [module documentation] for details.
Nika Layzell27726662017-10-24 23:16:35 -040031///
David Tolnayded2d682018-01-06 18:53:53 -080032/// [module documentation]: index.html
David Tolnay4b4c4b62018-01-06 13:48:05 -080033pub trait Fold {
David Tolnay3cfd1d32018-01-03 00:22:08 -080034# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040035fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080036# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -050037fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040038# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040039fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040040# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040041fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040042# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080044# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080046# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080048# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080050# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080052# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080054# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080056# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay506e43a2017-12-29 11:34:36 -050057fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080058# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080060# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080062# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050063fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080064# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050065fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080066# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050067fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080068# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050069fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080070# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050071fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080072# [ cfg ( feature = "derive" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080074# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080076# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080078# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080080# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080082# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080084# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080086# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080088# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080090# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080092# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080094# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080096# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080098# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800100# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800102# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800104# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800106# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800108# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800110# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800112# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800114# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800116# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500117fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800118# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800120# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500121fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800122# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800124# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800126# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800128# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800130# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800132# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800134# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500135fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800136# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800138# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800140# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500141fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800142# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800144# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800146# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500147fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800148# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500149fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800150# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800152# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800154# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800156# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800158# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800160# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800162# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500163fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800164# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500165fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800166# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500167fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800180# [ cfg ( feature = "full" ) ]
181fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500182# [ cfg ( feature = "full" ) ]
183fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800184# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500185fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800186# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500187fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800188# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc2f1aba2017-11-12 20:29:22 -0800189fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800190# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500192
193fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800199fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500204# [ cfg ( feature = "full" ) ]
205fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800206# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500207fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(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) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800242# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -0500243fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800244# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500245fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800246# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800248# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500249fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
David Tolnay360efd22018-01-04 23:35:26 -0800250# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
251fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
252# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
253fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
254# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
255fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
256# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
257fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
258# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
259fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
260# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
261fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
262# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
263fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
264# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
265fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800266# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800268# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800269fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800270# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -0500271fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800272# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500273fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800274# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800275fn fold_meta(&mut self, i: Meta) -> Meta { fold_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800276# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800277fn fold_meta_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800278# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800282# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500283fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800284# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800285fn fold_nested_meta(&mut self, i: NestedMeta) -> NestedMeta { fold_nested_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800286# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500287fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800288# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800290# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800292# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800294# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800296# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500297fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800298# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800300# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800302# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800306# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800308# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800310# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800312# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500313fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800314# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800316# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800318# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500319fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800322# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800323fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800324# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800325fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800326# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800327fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800328# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800330# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800332# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -0800333fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500334
335fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800336# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800338# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -0800339fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800340# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400341fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400345fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800347fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400349fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400351fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500352# [ cfg ( feature = "full" ) ]
353fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800354# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800355fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800356# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800357fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800358# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800359fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800360# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800361fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800362# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800363fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800364# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800365fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800366# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500367fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800368# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800369fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800370# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800371fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800372# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800373fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800374# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800375fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800376# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800377fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800378# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800379fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800380# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -0800381fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800382# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800383fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800384# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800385fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800386# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500387fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800388# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500389fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800390# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500392# [ cfg ( feature = "full" ) ]
393fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
394# [ cfg ( feature = "full" ) ]
395fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
396# [ cfg ( feature = "full" ) ]
397fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
398# [ cfg ( feature = "full" ) ]
399fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800400# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800402# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400403fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800404# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400405fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800406# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400407fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800408# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400409fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800410# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400411fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800412# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400413fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400414
Nika Layzell27726662017-10-24 23:16:35 -0400415}
416
David Tolnay360efd22018-01-04 23:35:26 -0800417macro_rules! fold_span_only {
418 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800419 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
David Tolnay360efd22018-01-04 23:35:26 -0800420 _i.span = _visitor.fold_span(_i.span);
421 _i
422 }
423 }
David Tolnayd0adf522017-12-29 01:30:07 -0500424}
425
David Tolnay360efd22018-01-04 23:35:26 -0800426fold_span_only!(fold_ident: Ident);
David Tolnay0a0d78c2018-01-05 15:24:01 -0800427#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay360efd22018-01-04 23:35:26 -0800428fold_span_only!(fold_lifetime: Lifetime);
429#[cfg(any(feature = "full", feature = "derive"))]
430fold_span_only!(fold_lit_byte: LitByte);
431#[cfg(any(feature = "full", feature = "derive"))]
432fold_span_only!(fold_lit_byte_str: LitByteStr);
433#[cfg(any(feature = "full", feature = "derive"))]
434fold_span_only!(fold_lit_char: LitChar);
435#[cfg(any(feature = "full", feature = "derive"))]
436fold_span_only!(fold_lit_float: LitFloat);
437#[cfg(any(feature = "full", feature = "derive"))]
438fold_span_only!(fold_lit_int: LitInt);
439#[cfg(any(feature = "full", feature = "derive"))]
440fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500441
David Tolnay3cfd1d32018-01-03 00:22:08 -0800442# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800443pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400444 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500446 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400447 }
448}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800449# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800450pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500451 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500452 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500453 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500454 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500455 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400456 }
457}
458# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800459pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400460 ArgCaptured {
461 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800463 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400464 }
465}
466# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800467pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400468 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500469 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 }
472}
473# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800474pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400475 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500476 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500477 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500478 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400480 }
481}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800482# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800483pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400484 Arm {
485 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
486 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500487 guard: (_i . guard).map(|it| { (
488 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
489 Box::new(_visitor.fold_expr(* ( it ) . 1)),
490 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400492 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500493 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800496# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800497pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400498 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500499 AttrStyle::Outer => { AttrStyle::Outer }
500 AttrStyle::Inner(_binding_0, ) => {
501 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500502 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 }
506}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800507# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800508pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400509 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500510 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500511 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500512 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400513 path: _visitor.fold_path(_i . path),
514 tts: _i . tts,
515 is_sugared_doc: _i . is_sugared_doc,
516 }
517}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800518# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800519pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400520 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500521 name: (_i . name).map(|it| { (
522 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500523 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500524 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800525 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400526 }
527}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800528# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800529pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400530 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500531 BareFnArgName::Named(_binding_0, ) => {
532 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500533 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400534 )
535 }
David Tolnay6702ade2017-12-30 23:38:15 -0500536 BareFnArgName::Wild(_binding_0, ) => {
537 BareFnArgName::Wild (
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 }
542}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800543# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800544pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400545 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500546 BinOp::Add(_binding_0, ) => {
547 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500548 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400549 )
550 }
David Tolnay6702ade2017-12-30 23:38:15 -0500551 BinOp::Sub(_binding_0, ) => {
552 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
David Tolnay6702ade2017-12-30 23:38:15 -0500556 BinOp::Mul(_binding_0, ) => {
557 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
David Tolnay6702ade2017-12-30 23:38:15 -0500561 BinOp::Div(_binding_0, ) => {
562 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
David Tolnay6702ade2017-12-30 23:38:15 -0500566 BinOp::Rem(_binding_0, ) => {
567 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
David Tolnay6702ade2017-12-30 23:38:15 -0500571 BinOp::And(_binding_0, ) => {
572 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
David Tolnay6702ade2017-12-30 23:38:15 -0500576 BinOp::Or(_binding_0, ) => {
577 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
David Tolnay6702ade2017-12-30 23:38:15 -0500581 BinOp::BitXor(_binding_0, ) => {
582 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
David Tolnay6702ade2017-12-30 23:38:15 -0500586 BinOp::BitAnd(_binding_0, ) => {
587 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
David Tolnay6702ade2017-12-30 23:38:15 -0500591 BinOp::BitOr(_binding_0, ) => {
592 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
David Tolnay6702ade2017-12-30 23:38:15 -0500596 BinOp::Shl(_binding_0, ) => {
597 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
David Tolnay6702ade2017-12-30 23:38:15 -0500601 BinOp::Shr(_binding_0, ) => {
602 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
David Tolnay6702ade2017-12-30 23:38:15 -0500606 BinOp::Eq(_binding_0, ) => {
607 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
David Tolnay6702ade2017-12-30 23:38:15 -0500611 BinOp::Lt(_binding_0, ) => {
612 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
David Tolnay6702ade2017-12-30 23:38:15 -0500616 BinOp::Le(_binding_0, ) => {
617 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
David Tolnay6702ade2017-12-30 23:38:15 -0500621 BinOp::Ne(_binding_0, ) => {
622 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
David Tolnay6702ade2017-12-30 23:38:15 -0500626 BinOp::Ge(_binding_0, ) => {
627 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
David Tolnay6702ade2017-12-30 23:38:15 -0500631 BinOp::Gt(_binding_0, ) => {
632 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
David Tolnay6702ade2017-12-30 23:38:15 -0500636 BinOp::AddEq(_binding_0, ) => {
637 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
David Tolnay6702ade2017-12-30 23:38:15 -0500641 BinOp::SubEq(_binding_0, ) => {
642 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
David Tolnay6702ade2017-12-30 23:38:15 -0500646 BinOp::MulEq(_binding_0, ) => {
647 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
David Tolnay6702ade2017-12-30 23:38:15 -0500651 BinOp::DivEq(_binding_0, ) => {
652 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
David Tolnay6702ade2017-12-30 23:38:15 -0500656 BinOp::RemEq(_binding_0, ) => {
657 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500658 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400659 )
660 }
David Tolnay6702ade2017-12-30 23:38:15 -0500661 BinOp::BitXorEq(_binding_0, ) => {
662 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500663 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400664 )
665 }
David Tolnay6702ade2017-12-30 23:38:15 -0500666 BinOp::BitAndEq(_binding_0, ) => {
667 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500668 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400669 )
670 }
David Tolnay6702ade2017-12-30 23:38:15 -0500671 BinOp::BitOrEq(_binding_0, ) => {
672 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500673 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400674 )
675 }
David Tolnay6702ade2017-12-30 23:38:15 -0500676 BinOp::ShlEq(_binding_0, ) => {
677 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500678 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400679 )
680 }
David Tolnay6702ade2017-12-30 23:38:15 -0500681 BinOp::ShrEq(_binding_0, ) => {
682 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500683 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400684 )
685 }
686 }
687}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800688# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800689pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500690 Binding {
691 ident: _visitor.fold_ident(_i . ident),
692 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
693 ty: _visitor.fold_type(_i . ty),
694 }
695}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800696# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800697pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400698 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500699 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400700 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
701 }
702}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800703# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800704pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400705 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500706 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
707 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400708 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500709 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400710 }
711}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800712# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800713pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500714 ConstParam {
715 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500717 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500719 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
722 }
723}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800724# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800725pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500726 match _i {
727 Data::Struct(_binding_0, ) => {
728 Data::Struct (
729 _visitor.fold_data_struct(_binding_0),
730 )
731 }
732 Data::Enum(_binding_0, ) => {
733 Data::Enum (
734 _visitor.fold_data_enum(_binding_0),
735 )
736 }
737 Data::Union(_binding_0, ) => {
738 Data::Union (
739 _visitor.fold_data_union(_binding_0),
740 )
741 }
742 }
743}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800744# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800745pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500746 DataEnum {
747 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
748 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
749 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
750 }
751}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800752# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800753pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500754 DataStruct {
755 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
756 fields: _visitor.fold_fields(_i . fields),
757 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
758 }
759}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800760# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800761pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500762 DataUnion {
763 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
764 fields: _visitor.fold_fields_named(_i . fields),
765 }
766}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800767# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800768pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400769 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400770 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500771 vis: _visitor.fold_visibility(_i . vis),
772 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400773 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500774 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400775 }
776}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800777# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800778pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400779 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500780 Expr::Box(_binding_0, ) => {
781 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400782 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400783 )
784 }
David Tolnay6702ade2017-12-30 23:38:15 -0500785 Expr::InPlace(_binding_0, ) => {
786 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400787 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400788 )
789 }
David Tolnay6702ade2017-12-30 23:38:15 -0500790 Expr::Array(_binding_0, ) => {
791 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400792 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400793 )
794 }
David Tolnay6702ade2017-12-30 23:38:15 -0500795 Expr::Call(_binding_0, ) => {
796 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400797 _visitor.fold_expr_call(_binding_0),
798 )
799 }
David Tolnay6702ade2017-12-30 23:38:15 -0500800 Expr::MethodCall(_binding_0, ) => {
801 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400802 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400803 )
804 }
David Tolnay6702ade2017-12-30 23:38:15 -0500805 Expr::Tuple(_binding_0, ) => {
806 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500807 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400808 )
809 }
David Tolnay6702ade2017-12-30 23:38:15 -0500810 Expr::Binary(_binding_0, ) => {
811 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400812 _visitor.fold_expr_binary(_binding_0),
813 )
814 }
David Tolnay6702ade2017-12-30 23:38:15 -0500815 Expr::Unary(_binding_0, ) => {
816 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400817 _visitor.fold_expr_unary(_binding_0),
818 )
819 }
David Tolnay6702ade2017-12-30 23:38:15 -0500820 Expr::Lit(_binding_0, ) => {
821 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500822 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400823 )
824 }
David Tolnay6702ade2017-12-30 23:38:15 -0500825 Expr::Cast(_binding_0, ) => {
826 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400827 _visitor.fold_expr_cast(_binding_0),
828 )
829 }
David Tolnay6702ade2017-12-30 23:38:15 -0500830 Expr::Type(_binding_0, ) => {
831 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500832 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400833 )
834 }
David Tolnay6702ade2017-12-30 23:38:15 -0500835 Expr::If(_binding_0, ) => {
836 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400837 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400838 )
839 }
David Tolnay6702ade2017-12-30 23:38:15 -0500840 Expr::IfLet(_binding_0, ) => {
841 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400842 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400843 )
844 }
David Tolnay6702ade2017-12-30 23:38:15 -0500845 Expr::While(_binding_0, ) => {
846 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400847 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400848 )
849 }
David Tolnay6702ade2017-12-30 23:38:15 -0500850 Expr::WhileLet(_binding_0, ) => {
851 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400852 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400853 )
854 }
David Tolnay6702ade2017-12-30 23:38:15 -0500855 Expr::ForLoop(_binding_0, ) => {
856 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400857 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400858 )
859 }
David Tolnay6702ade2017-12-30 23:38:15 -0500860 Expr::Loop(_binding_0, ) => {
861 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400862 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400863 )
864 }
David Tolnay6702ade2017-12-30 23:38:15 -0500865 Expr::Match(_binding_0, ) => {
866 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400867 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400868 )
869 }
David Tolnay6702ade2017-12-30 23:38:15 -0500870 Expr::Closure(_binding_0, ) => {
871 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400872 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400873 )
874 }
David Tolnay6702ade2017-12-30 23:38:15 -0500875 Expr::Unsafe(_binding_0, ) => {
876 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500877 full!(_visitor.fold_expr_unsafe(_binding_0)),
878 )
879 }
David Tolnay6702ade2017-12-30 23:38:15 -0500880 Expr::Block(_binding_0, ) => {
881 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400882 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400883 )
884 }
David Tolnay6702ade2017-12-30 23:38:15 -0500885 Expr::Assign(_binding_0, ) => {
886 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400887 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400888 )
889 }
David Tolnay6702ade2017-12-30 23:38:15 -0500890 Expr::AssignOp(_binding_0, ) => {
891 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400892 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400893 )
894 }
David Tolnay6702ade2017-12-30 23:38:15 -0500895 Expr::Field(_binding_0, ) => {
896 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400897 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400898 )
899 }
David Tolnay6702ade2017-12-30 23:38:15 -0500900 Expr::Index(_binding_0, ) => {
901 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400902 _visitor.fold_expr_index(_binding_0),
903 )
904 }
David Tolnay6702ade2017-12-30 23:38:15 -0500905 Expr::Range(_binding_0, ) => {
906 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400907 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400908 )
909 }
David Tolnay6702ade2017-12-30 23:38:15 -0500910 Expr::Path(_binding_0, ) => {
911 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400912 _visitor.fold_expr_path(_binding_0),
913 )
914 }
David Tolnay6702ade2017-12-30 23:38:15 -0500915 Expr::AddrOf(_binding_0, ) => {
916 Expr::AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400917 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400918 )
919 }
David Tolnay6702ade2017-12-30 23:38:15 -0500920 Expr::Break(_binding_0, ) => {
921 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400922 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400923 )
924 }
David Tolnay6702ade2017-12-30 23:38:15 -0500925 Expr::Continue(_binding_0, ) => {
926 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400927 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 )
929 }
David Tolnay6702ade2017-12-30 23:38:15 -0500930 Expr::Return(_binding_0, ) => {
931 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500932 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400933 )
934 }
David Tolnay6702ade2017-12-30 23:38:15 -0500935 Expr::Macro(_binding_0, ) => {
936 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500937 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400938 )
939 }
David Tolnay6702ade2017-12-30 23:38:15 -0500940 Expr::Struct(_binding_0, ) => {
941 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400942 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400943 )
944 }
David Tolnay6702ade2017-12-30 23:38:15 -0500945 Expr::Repeat(_binding_0, ) => {
946 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400947 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400948 )
949 }
David Tolnay6702ade2017-12-30 23:38:15 -0500950 Expr::Paren(_binding_0, ) => {
951 Expr::Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500952 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400953 )
954 }
David Tolnay6702ade2017-12-30 23:38:15 -0500955 Expr::Group(_binding_0, ) => {
956 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500957 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400958 )
959 }
David Tolnay6702ade2017-12-30 23:38:15 -0500960 Expr::Try(_binding_0, ) => {
961 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400962 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400963 )
964 }
David Tolnay6702ade2017-12-30 23:38:15 -0500965 Expr::Catch(_binding_0, ) => {
966 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400967 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400968 )
969 }
David Tolnay6702ade2017-12-30 23:38:15 -0500970 Expr::Yield(_binding_0, ) => {
971 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400972 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400973 )
974 }
David Tolnay6702ade2017-12-30 23:38:15 -0500975 Expr::Verbatim(_binding_0, ) => {
976 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500977 _visitor.fold_expr_verbatim(_binding_0),
978 )
979 }
Nika Layzell27726662017-10-24 23:16:35 -0400980 }
981}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800982# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800983pub fn fold_expr_addr_of<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
David Tolnay8c91b882017-12-28 23:04:32 -0500984 ExprAddrOf {
985 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
986 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500987 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500988 expr: Box::new(_visitor.fold_expr(* _i . expr)),
989 }
990}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800991# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800992pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500993 ExprArray {
994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
995 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500996 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500997 }
998}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800999# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001000pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -05001001 ExprAssign {
1002 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1003 left: Box::new(_visitor.fold_expr(* _i . left)),
1004 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1005 right: Box::new(_visitor.fold_expr(* _i . right)),
1006 }
1007}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001008# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001009pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001010 ExprAssignOp {
1011 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1012 left: Box::new(_visitor.fold_expr(* _i . left)),
1013 op: _visitor.fold_bin_op(_i . op),
1014 right: Box::new(_visitor.fold_expr(* _i . right)),
1015 }
1016}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001017# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001018pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001019 ExprBinary {
1020 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1021 left: Box::new(_visitor.fold_expr(* _i . left)),
1022 op: _visitor.fold_bin_op(_i . op),
1023 right: Box::new(_visitor.fold_expr(* _i . right)),
1024 }
1025}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001026# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001027pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001028 ExprBlock {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 block: _visitor.fold_block(_i . block),
1031 }
1032}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001033# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001034pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001035 ExprBox {
1036 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1037 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1038 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1039 }
1040}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001041# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001042pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001043 ExprBreak {
1044 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1045 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1046 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1047 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1048 }
1049}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001050# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001051pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001052 ExprCall {
1053 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1054 func: Box::new(_visitor.fold_expr(* _i . func)),
1055 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1056 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1057 }
1058}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001059# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001060pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001061 ExprCast {
1062 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1063 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1064 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1065 ty: Box::new(_visitor.fold_type(* _i . ty)),
1066 }
1067}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001068# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001069pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001070 ExprCatch {
1071 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1072 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1073 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1074 block: _visitor.fold_block(_i . block),
1075 }
1076}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001077# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001078pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001079 ExprClosure {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001081 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001082 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1083 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1084 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1085 output: _visitor.fold_return_type(_i . output),
1086 body: Box::new(_visitor.fold_expr(* _i . body)),
1087 }
1088}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001089# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001090pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001091 ExprContinue {
1092 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1093 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1094 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1095 }
1096}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001097# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001098pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001099 ExprField {
1100 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1101 base: Box::new(_visitor.fold_expr(* _i . base)),
1102 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1103 member: _visitor.fold_member(_i . member),
1104 }
1105}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001106# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001107pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001108 ExprForLoop {
1109 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001110 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001111 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1112 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1113 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1114 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1115 body: _visitor.fold_block(_i . body),
1116 }
1117}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001118# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001119pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001120 ExprGroup {
1121 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1122 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1123 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1124 }
1125}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001126# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001127pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001128 ExprIf {
1129 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1130 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1131 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001132 then_branch: _visitor.fold_block(_i . then_branch),
1133 else_branch: (_i . else_branch).map(|it| { (
1134 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1135 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1136 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001137 }
1138}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001139# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001140pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001141 ExprIfLet {
1142 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1143 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1144 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1145 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1146 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1147 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001148 then_branch: _visitor.fold_block(_i . then_branch),
1149 else_branch: (_i . else_branch).map(|it| { (
1150 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1151 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1152 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001153 }
1154}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001155# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001156pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001157 ExprInPlace {
1158 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1159 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001160 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001161 value: Box::new(_visitor.fold_expr(* _i . value)),
1162 }
1163}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001164# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001165pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001166 ExprIndex {
1167 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1168 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1169 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1170 index: Box::new(_visitor.fold_expr(* _i . index)),
1171 }
1172}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001173# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001174pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001175 ExprLit {
1176 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1177 lit: _visitor.fold_lit(_i . lit),
1178 }
1179}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001180# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001181pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001182 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001183 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001184 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001185 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1186 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001187 }
1188}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001189# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001190pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001191 ExprMacro {
1192 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1193 mac: _visitor.fold_macro(_i . mac),
1194 }
1195}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001196# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001197pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001198 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001199 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001200 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001201 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001202 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001203 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1204 }
1205}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001206# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001207pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001208 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001209 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001210 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001211 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001212 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001213 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001214 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1215 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
1217}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001218# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001219pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001220 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001221 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001222 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001223 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
1225}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001226# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001227pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001228 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001229 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001230 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001231 path: _visitor.fold_path(_i . path),
1232 }
1233}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001234# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001235pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001236 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001237 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001238 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001239 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001240 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001241 }
1242}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001243# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001244pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001245 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001246 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001247 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001248 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001249 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001250 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1251 }
1252}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001253# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001254pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001255 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001256 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001257 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001258 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
1260}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001261# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001262pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001263 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001264 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001265 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001266 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001267 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1268 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1269 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
1271}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001272# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001273pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001275 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001276 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001277 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001278 }
1279}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001280# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001281pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001282 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001283 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001284 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001285 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001286 }
1287}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001288# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001289pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001291 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001292 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001294 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001295 }
1296}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001297# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001298pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001299 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001300 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001301 op: _visitor.fold_un_op(_i . op),
1302 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1303 }
1304}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001305# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001306pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001307 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001308 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001309 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001310 block: _visitor.fold_block(_i . block),
1311 }
1312}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001313# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001314pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001315 ExprVerbatim {
1316 tts: _i . tts,
1317 }
1318}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001319# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001320pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001321 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001322 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001323 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001324 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001325 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1326 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001327 }
1328}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001329# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001330pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001331 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001332 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001333 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001334 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1335 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001336 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001337 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001338 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1339 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001340 }
1341}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001342# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001343pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001344 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001346 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001347 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001348 }
1349}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001350# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001351pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001352 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001353 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001354 vis: _visitor.fold_visibility(_i . vis),
1355 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001356 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001357 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001358 }
1359}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001360# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001361pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001362 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001363 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001364 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001365 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001366 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001367 }
1368}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001369# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001370pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001371 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001372 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1373 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001374 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001375 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001376 }
1377}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001378# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001379pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001380 match _i {
1381 Fields::Named(_binding_0, ) => {
1382 Fields::Named (
1383 _visitor.fold_fields_named(_binding_0),
1384 )
1385 }
1386 Fields::Unnamed(_binding_0, ) => {
1387 Fields::Unnamed (
1388 _visitor.fold_fields_unnamed(_binding_0),
1389 )
1390 }
1391 Fields::Unit => { Fields::Unit }
1392 }
1393}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001394# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001395pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001396 FieldsNamed {
1397 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001398 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001399 }
1400}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001401# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001402pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001403 FieldsUnnamed {
1404 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001405 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001406 }
1407}
Nika Layzell27726662017-10-24 23:16:35 -04001408# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001409pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001410 File {
1411 shebang: _i . shebang,
1412 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1413 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1414 }
1415}
1416# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001417pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001418 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001419 FnArg::SelfRef(_binding_0, ) => {
1420 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001421 _visitor.fold_arg_self_ref(_binding_0),
1422 )
1423 }
David Tolnay6702ade2017-12-30 23:38:15 -05001424 FnArg::SelfValue(_binding_0, ) => {
1425 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001426 _visitor.fold_arg_self(_binding_0),
1427 )
1428 }
David Tolnay6702ade2017-12-30 23:38:15 -05001429 FnArg::Captured(_binding_0, ) => {
1430 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001431 _visitor.fold_arg_captured(_binding_0),
1432 )
1433 }
David Tolnay6702ade2017-12-30 23:38:15 -05001434 FnArg::Inferred(_binding_0, ) => {
1435 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001436 _visitor.fold_pat(_binding_0),
1437 )
1438 }
David Tolnay6702ade2017-12-30 23:38:15 -05001439 FnArg::Ignored(_binding_0, ) => {
1440 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001441 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001442 )
1443 }
1444 }
1445}
1446# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001447pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001448 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001449 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001450 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001451 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001452 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001453 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001454 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001455 }
1456}
1457# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001458pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001459 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001460 ForeignItem::Fn(_binding_0, ) => {
1461 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001462 _visitor.fold_foreign_item_fn(_binding_0),
1463 )
1464 }
David Tolnay6702ade2017-12-30 23:38:15 -05001465 ForeignItem::Static(_binding_0, ) => {
1466 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001467 _visitor.fold_foreign_item_static(_binding_0),
1468 )
1469 }
David Tolnay6702ade2017-12-30 23:38:15 -05001470 ForeignItem::Type(_binding_0, ) => {
1471 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001472 _visitor.fold_foreign_item_type(_binding_0),
1473 )
1474 }
David Tolnay6702ade2017-12-30 23:38:15 -05001475 ForeignItem::Verbatim(_binding_0, ) => {
1476 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001477 _visitor.fold_foreign_item_verbatim(_binding_0),
1478 )
1479 }
Nika Layzell27726662017-10-24 23:16:35 -04001480 }
1481}
1482# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001483pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001484 ForeignItemFn {
1485 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1486 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001487 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001488 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001489 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001490 }
1491}
1492# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001493pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001494 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001495 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1496 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001497 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001498 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001499 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001500 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001501 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001502 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001503 }
1504}
David Tolnay199bcbb2017-11-12 10:33:52 -08001505# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001506pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001507 ForeignItemType {
1508 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1509 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001510 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001511 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001512 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001513 }
1514}
David Tolnay2ae520a2017-12-29 11:19:50 -05001515# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001516pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001517 ForeignItemVerbatim {
1518 tts: _i . tts,
1519 }
1520}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001521# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001522pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001523 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001524 GenericArgument::Lifetime(_binding_0, ) => {
1525 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001526 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001527 )
1528 }
David Tolnay6702ade2017-12-30 23:38:15 -05001529 GenericArgument::Type(_binding_0, ) => {
1530 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001531 _visitor.fold_type(_binding_0),
1532 )
1533 }
David Tolnay6702ade2017-12-30 23:38:15 -05001534 GenericArgument::Binding(_binding_0, ) => {
1535 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001536 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001537 )
1538 }
David Tolnay6702ade2017-12-30 23:38:15 -05001539 GenericArgument::Const(_binding_0, ) => {
1540 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001541 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001542 )
1543 }
Nika Layzell357885a2017-12-04 15:47:07 -05001544 }
1545}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001546# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001547pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001548 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001549 GenericMethodArgument::Type(_binding_0, ) => {
1550 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001551 _visitor.fold_type(_binding_0),
1552 )
1553 }
David Tolnay6702ade2017-12-30 23:38:15 -05001554 GenericMethodArgument::Const(_binding_0, ) => {
1555 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001556 _visitor.fold_expr(_binding_0),
1557 )
1558 }
1559 }
1560}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001561# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001562pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001563 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001564 GenericParam::Type(_binding_0, ) => {
1565 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001566 _visitor.fold_type_param(_binding_0),
1567 )
1568 }
David Tolnay517f3692018-01-01 20:17:23 -08001569 GenericParam::Lifetime(_binding_0, ) => {
1570 GenericParam::Lifetime (
1571 _visitor.fold_lifetime_def(_binding_0),
1572 )
1573 }
David Tolnay6702ade2017-12-30 23:38:15 -05001574 GenericParam::Const(_binding_0, ) => {
1575 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001576 _visitor.fold_const_param(_binding_0),
1577 )
1578 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001579 }
1580}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001581# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001582pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001583 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001584 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001585 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001586 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001587 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001588 }
1589}
1590# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001591pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001592 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001593 ImplItem::Const(_binding_0, ) => {
1594 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001595 _visitor.fold_impl_item_const(_binding_0),
1596 )
1597 }
David Tolnay6702ade2017-12-30 23:38:15 -05001598 ImplItem::Method(_binding_0, ) => {
1599 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001600 _visitor.fold_impl_item_method(_binding_0),
1601 )
1602 }
David Tolnay6702ade2017-12-30 23:38:15 -05001603 ImplItem::Type(_binding_0, ) => {
1604 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001605 _visitor.fold_impl_item_type(_binding_0),
1606 )
1607 }
David Tolnay6702ade2017-12-30 23:38:15 -05001608 ImplItem::Macro(_binding_0, ) => {
1609 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001610 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001611 )
1612 }
David Tolnay6702ade2017-12-30 23:38:15 -05001613 ImplItem::Verbatim(_binding_0, ) => {
1614 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001615 _visitor.fold_impl_item_verbatim(_binding_0),
1616 )
1617 }
Nika Layzell27726662017-10-24 23:16:35 -04001618 }
1619}
1620# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001621pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001622 ImplItemConst {
1623 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1624 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001625 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001626 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001627 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001628 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001629 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001630 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001631 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001632 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001633 }
1634}
1635# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001636pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001637 ImplItemMacro {
1638 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1639 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001640 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001641 }
1642}
1643# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001644pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001645 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001646 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001647 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001648 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001649 sig: _visitor.fold_method_sig(_i . sig),
1650 block: _visitor.fold_block(_i . block),
1651 }
1652}
1653# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001654pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001655 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001656 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001657 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001658 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001659 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001660 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001661 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001662 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001663 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001664 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001665 }
1666}
David Tolnay2ae520a2017-12-29 11:19:50 -05001667# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001668pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001669 ImplItemVerbatim {
1670 tts: _i . tts,
1671 }
1672}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001673# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001674pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001675 Index {
1676 index: _i . index,
1677 span: _visitor.fold_span(_i . span),
1678 }
1679}
1680# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001681pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001682 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001683 Item::ExternCrate(_binding_0, ) => {
1684 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001685 _visitor.fold_item_extern_crate(_binding_0),
1686 )
1687 }
David Tolnay6702ade2017-12-30 23:38:15 -05001688 Item::Use(_binding_0, ) => {
1689 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001690 _visitor.fold_item_use(_binding_0),
1691 )
1692 }
David Tolnay6702ade2017-12-30 23:38:15 -05001693 Item::Static(_binding_0, ) => {
1694 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001695 _visitor.fold_item_static(_binding_0),
1696 )
1697 }
David Tolnay6702ade2017-12-30 23:38:15 -05001698 Item::Const(_binding_0, ) => {
1699 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001700 _visitor.fold_item_const(_binding_0),
1701 )
1702 }
David Tolnay6702ade2017-12-30 23:38:15 -05001703 Item::Fn(_binding_0, ) => {
1704 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001705 _visitor.fold_item_fn(_binding_0),
1706 )
1707 }
David Tolnay6702ade2017-12-30 23:38:15 -05001708 Item::Mod(_binding_0, ) => {
1709 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001710 _visitor.fold_item_mod(_binding_0),
1711 )
1712 }
David Tolnay6702ade2017-12-30 23:38:15 -05001713 Item::ForeignMod(_binding_0, ) => {
1714 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001715 _visitor.fold_item_foreign_mod(_binding_0),
1716 )
1717 }
David Tolnay6702ade2017-12-30 23:38:15 -05001718 Item::Type(_binding_0, ) => {
1719 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001720 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001721 )
1722 }
David Tolnay6702ade2017-12-30 23:38:15 -05001723 Item::Struct(_binding_0, ) => {
1724 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001725 _visitor.fold_item_struct(_binding_0),
1726 )
1727 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001728 Item::Enum(_binding_0, ) => {
1729 Item::Enum (
1730 _visitor.fold_item_enum(_binding_0),
1731 )
1732 }
David Tolnay6702ade2017-12-30 23:38:15 -05001733 Item::Union(_binding_0, ) => {
1734 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001735 _visitor.fold_item_union(_binding_0),
1736 )
1737 }
David Tolnay6702ade2017-12-30 23:38:15 -05001738 Item::Trait(_binding_0, ) => {
1739 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001740 _visitor.fold_item_trait(_binding_0),
1741 )
1742 }
David Tolnay6702ade2017-12-30 23:38:15 -05001743 Item::Impl(_binding_0, ) => {
1744 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001745 _visitor.fold_item_impl(_binding_0),
1746 )
1747 }
David Tolnay6702ade2017-12-30 23:38:15 -05001748 Item::Macro(_binding_0, ) => {
1749 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001750 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001751 )
1752 }
David Tolnay6702ade2017-12-30 23:38:15 -05001753 Item::Macro2(_binding_0, ) => {
1754 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001755 _visitor.fold_item_macro2(_binding_0),
1756 )
1757 }
David Tolnay6702ade2017-12-30 23:38:15 -05001758 Item::Verbatim(_binding_0, ) => {
1759 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001760 _visitor.fold_item_verbatim(_binding_0),
1761 )
1762 }
Nika Layzell27726662017-10-24 23:16:35 -04001763 }
1764}
1765# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001766pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001767 ItemConst {
1768 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1769 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001770 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001771 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001772 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001773 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001774 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001775 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001776 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 }
1778}
1779# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001780pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 ItemEnum {
1782 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1783 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001785 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001787 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001788 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1789 }
1790}
1791# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001792pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 ItemExternCrate {
1794 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1795 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001796 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1797 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001798 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001799 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001801 _visitor.fold_ident(( it ) . 1),
1802 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 }
1805}
1806# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001807pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 ItemFn {
1809 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1810 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001811 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001812 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001813 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001814 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001815 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001816 block: Box::new(_visitor.fold_block(* _i . block)),
1817 }
1818}
1819# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001820pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001821 ItemForeignMod {
1822 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1823 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001824 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1826 }
1827}
1828# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001829pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001830 ItemImpl {
1831 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001832 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001833 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001834 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001836 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001837 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001838 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001839 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001840 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001841 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001842 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001843 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1844 }
1845}
1846# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001847pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001848 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001850 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001851 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001852 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 }
1854}
1855# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001856pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001857 ItemMacro2 {
1858 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1859 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001861 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001862 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001863 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001864 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001865 body: _i . body,
1866 }
1867}
1868# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001869pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001870 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001871 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001872 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001873 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001874 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001875 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001876 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001877 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1878 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001879 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001880 }
1881}
1882# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001883pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001884 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001885 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001886 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001888 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001889 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001890 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001891 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001892 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001893 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001894 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001895 }
1896}
1897# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001898pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001899 ItemStruct {
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 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001903 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001904 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001905 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001907 }
1908}
1909# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001910pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001911 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001912 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001913 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001914 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001915 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1916 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001917 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001918 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001919 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001920 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001921 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001922 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1923 }
1924}
1925# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001926pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001927 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001928 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001929 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001930 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001931 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001932 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001933 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001934 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001935 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001936 }
1937}
1938# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001939pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001940 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001941 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001942 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001943 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001944 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001945 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001946 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001947 }
1948}
1949# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001950pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001951 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001952 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001953 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001954 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1955 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001956 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1957 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001958 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001959 }
1960}
David Tolnay2ae520a2017-12-29 11:19:50 -05001961# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001962pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001963 ItemVerbatim {
1964 tts: _i . tts,
1965 }
1966}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001967# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001968pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001969 Label {
1970 name: _visitor.fold_lifetime(_i . name),
1971 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1972 }
1973}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001974# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001975pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001976 LifetimeDef {
1977 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001978 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001979 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001980 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1981 }
1982}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001983# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001984pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001985 match _i {
1986 Lit::Str(_binding_0, ) => {
1987 Lit::Str (
1988 _visitor.fold_lit_str(_binding_0),
1989 )
1990 }
1991 Lit::ByteStr(_binding_0, ) => {
1992 Lit::ByteStr (
1993 _visitor.fold_lit_byte_str(_binding_0),
1994 )
1995 }
1996 Lit::Byte(_binding_0, ) => {
1997 Lit::Byte (
1998 _visitor.fold_lit_byte(_binding_0),
1999 )
2000 }
2001 Lit::Char(_binding_0, ) => {
2002 Lit::Char (
2003 _visitor.fold_lit_char(_binding_0),
2004 )
2005 }
2006 Lit::Int(_binding_0, ) => {
2007 Lit::Int (
2008 _visitor.fold_lit_int(_binding_0),
2009 )
2010 }
2011 Lit::Float(_binding_0, ) => {
2012 Lit::Float (
2013 _visitor.fold_lit_float(_binding_0),
2014 )
2015 }
2016 Lit::Bool(_binding_0, ) => {
2017 Lit::Bool (
2018 _visitor.fold_lit_bool(_binding_0),
2019 )
2020 }
2021 Lit::Verbatim(_binding_0, ) => {
2022 Lit::Verbatim (
2023 _visitor.fold_lit_verbatim(_binding_0),
2024 )
2025 }
2026 }
2027}
2028# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002029pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002030 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002031 value: _i . value,
2032 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002033 }
2034}
David Tolnay360efd22018-01-04 23:35:26 -08002035# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002036pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002037 LitVerbatim {
2038 token: _i . token,
2039 span: _visitor.fold_span(_i . span),
2040 }
2041}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002042# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002043pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002044 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002045 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002046 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
2047 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05002048 ty: (_i . ty).map(|it| { (
2049 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2050 Box::new(_visitor.fold_type(* ( it ) . 1)),
2051 ) }),
2052 init: (_i . init).map(|it| { (
2053 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2054 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2055 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002056 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002057 }
2058}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002059# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002060pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002061 Macro {
2062 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002063 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002064 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2065 tts: _i . tts,
2066 }
2067}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002068# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002069pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002070 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002071 MacroDelimiter::Paren(_binding_0, ) => {
2072 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002073 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2074 )
2075 }
David Tolnay6702ade2017-12-30 23:38:15 -05002076 MacroDelimiter::Brace(_binding_0, ) => {
2077 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002078 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2079 )
2080 }
David Tolnay6702ade2017-12-30 23:38:15 -05002081 MacroDelimiter::Bracket(_binding_0, ) => {
2082 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002083 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2084 )
2085 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002086 }
2087}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002088# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002089pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002090 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002091 Member::Named(_binding_0, ) => {
2092 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05002093 _visitor.fold_ident(_binding_0),
2094 )
2095 }
David Tolnay6702ade2017-12-30 23:38:15 -05002096 Member::Unnamed(_binding_0, ) => {
2097 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002098 _visitor.fold_index(_binding_0),
2099 )
2100 }
2101 }
2102}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002103# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002104pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002105 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002106 Meta::Word(_binding_0, ) => {
2107 Meta::Word (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002108 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002109 )
2110 }
David Tolnayaaadd782018-01-06 22:58:13 -08002111 Meta::List(_binding_0, ) => {
2112 Meta::List (
2113 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002114 )
2115 }
David Tolnayaaadd782018-01-06 22:58:13 -08002116 Meta::NameValue(_binding_0, ) => {
2117 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002118 _visitor.fold_meta_name_value(_binding_0),
2119 )
2120 }
2121 }
2122}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002123# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002124pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2125 MetaList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002126 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002127 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002128 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002129 }
2130}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002131# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002132pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002133 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002134 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002135 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002136 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002137 }
2138}
2139# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002140pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002141 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002142 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002143 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002144 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002145 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002146 decl: _visitor.fold_fn_decl(_i . decl),
2147 }
2148}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002149# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002150pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002151 MethodTurbofish {
2152 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2153 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2154 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2155 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2156 }
2157}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002158# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002159pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002160 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002161 NestedMeta::Meta(_binding_0, ) => {
2162 NestedMeta::Meta (
2163 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002164 )
2165 }
David Tolnayaaadd782018-01-06 22:58:13 -08002166 NestedMeta::Literal(_binding_0, ) => {
2167 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002168 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002169 )
2170 }
2171 }
2172}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002173# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002174pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002175 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002176 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002177 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002178 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002179 }
2180}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002181# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002182pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002183 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002184 Pat::Wild(_binding_0, ) => {
2185 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002186 _visitor.fold_pat_wild(_binding_0),
2187 )
2188 }
David Tolnay6702ade2017-12-30 23:38:15 -05002189 Pat::Ident(_binding_0, ) => {
2190 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002191 _visitor.fold_pat_ident(_binding_0),
2192 )
2193 }
David Tolnay6702ade2017-12-30 23:38:15 -05002194 Pat::Struct(_binding_0, ) => {
2195 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002196 _visitor.fold_pat_struct(_binding_0),
2197 )
2198 }
David Tolnay6702ade2017-12-30 23:38:15 -05002199 Pat::TupleStruct(_binding_0, ) => {
2200 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002201 _visitor.fold_pat_tuple_struct(_binding_0),
2202 )
2203 }
David Tolnay6702ade2017-12-30 23:38:15 -05002204 Pat::Path(_binding_0, ) => {
2205 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002206 _visitor.fold_pat_path(_binding_0),
2207 )
2208 }
David Tolnay6702ade2017-12-30 23:38:15 -05002209 Pat::Tuple(_binding_0, ) => {
2210 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002211 _visitor.fold_pat_tuple(_binding_0),
2212 )
2213 }
David Tolnay6702ade2017-12-30 23:38:15 -05002214 Pat::Box(_binding_0, ) => {
2215 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002216 _visitor.fold_pat_box(_binding_0),
2217 )
2218 }
David Tolnay6702ade2017-12-30 23:38:15 -05002219 Pat::Ref(_binding_0, ) => {
2220 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002221 _visitor.fold_pat_ref(_binding_0),
2222 )
2223 }
David Tolnay6702ade2017-12-30 23:38:15 -05002224 Pat::Lit(_binding_0, ) => {
2225 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002226 _visitor.fold_pat_lit(_binding_0),
2227 )
2228 }
David Tolnay6702ade2017-12-30 23:38:15 -05002229 Pat::Range(_binding_0, ) => {
2230 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002231 _visitor.fold_pat_range(_binding_0),
2232 )
2233 }
David Tolnay6702ade2017-12-30 23:38:15 -05002234 Pat::Slice(_binding_0, ) => {
2235 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002236 _visitor.fold_pat_slice(_binding_0),
2237 )
2238 }
David Tolnay6702ade2017-12-30 23:38:15 -05002239 Pat::Macro(_binding_0, ) => {
2240 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002241 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002242 )
2243 }
David Tolnay6702ade2017-12-30 23:38:15 -05002244 Pat::Verbatim(_binding_0, ) => {
2245 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002246 _visitor.fold_pat_verbatim(_binding_0),
2247 )
2248 }
Nika Layzell27726662017-10-24 23:16:35 -04002249 }
2250}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002251# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002252pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002253 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002254 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002255 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002256 }
2257}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002258# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002259pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002260 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002261 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2262 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002263 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002264 subpat: (_i . subpat).map(|it| { (
2265 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2266 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2267 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002268 }
2269}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002270# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002271pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002272 PatLit {
2273 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2274 }
2275}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002276# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002277pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002278 PatMacro {
2279 mac: _visitor.fold_macro(_i . mac),
2280 }
2281}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002282# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002283pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002284 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002285 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002286 path: _visitor.fold_path(_i . path),
2287 }
2288}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002289# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002290pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002291 PatRange {
2292 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002293 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002294 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002295 }
2296}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002297# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002298pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002299 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002300 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002301 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002302 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002303 }
2304}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002305# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002306pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002307 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002308 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002309 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002310 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002311 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002312 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002313 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002314 }
2315}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002316# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002317pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002318 PatStruct {
2319 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002320 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002321 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002322 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002323 }
2324}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002325# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002326pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002327 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002328 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002329 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002330 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002331 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2332 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002333 }
2334}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002335# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002336pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002337 PatTupleStruct {
2338 path: _visitor.fold_path(_i . path),
2339 pat: _visitor.fold_pat_tuple(_i . pat),
2340 }
2341}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002342# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002343pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002344 PatVerbatim {
2345 tts: _i . tts,
2346 }
2347}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002348# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002349pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002350 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002351 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002352 }
2353}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002354# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002355pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002356 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002357 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002358 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2359 }
2360}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002361# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002362pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002363 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002364 PathArguments::None => { PathArguments::None }
2365 PathArguments::AngleBracketed(_binding_0, ) => {
2366 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002367 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2368 )
2369 }
David Tolnay6702ade2017-12-30 23:38:15 -05002370 PathArguments::Parenthesized(_binding_0, ) => {
2371 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002372 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2373 )
2374 }
2375 }
2376}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002377# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002378pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002379 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002380 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002381 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002382 }
2383}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002384# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002385pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002386 PredicateEq {
2387 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2388 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2389 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2390 }
2391}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002392# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002393pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002394 PredicateLifetime {
2395 lifetime: _visitor.fold_lifetime(_i . lifetime),
2396 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2397 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2398 }
2399}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002400# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002401pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002402 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002403 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002404 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2405 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2406 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2407 }
2408}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002409# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002410pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002411 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002412 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002413 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002414 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002415 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2416 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002417 }
2418}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002419# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002420pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002421 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002422 RangeLimits::HalfOpen(_binding_0, ) => {
2423 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002424 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002425 )
2426 }
David Tolnay6702ade2017-12-30 23:38:15 -05002427 RangeLimits::Closed(_binding_0, ) => {
2428 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002429 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002430 )
2431 }
2432 }
2433}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002434# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002435pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002436 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002437 ReturnType::Default => { ReturnType::Default }
2438 ReturnType::Type(_binding_0, _binding_1, ) => {
2439 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002440 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2441 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002442 )
2443 }
2444 }
2445}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002446
David Tolnay4b4c4b62018-01-06 13:48:05 -08002447pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002448 _i
2449}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002450# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002451pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002452 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002453 Stmt::Local(_binding_0, ) => {
2454 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002455 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002456 )
2457 }
David Tolnay6702ade2017-12-30 23:38:15 -05002458 Stmt::Item(_binding_0, ) => {
2459 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002460 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002461 )
2462 }
David Tolnay6702ade2017-12-30 23:38:15 -05002463 Stmt::Expr(_binding_0, ) => {
2464 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002465 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002466 )
2467 }
David Tolnay6702ade2017-12-30 23:38:15 -05002468 Stmt::Semi(_binding_0, _binding_1, ) => {
2469 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002470 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002471 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
Nika Layzell27726662017-10-24 23:16:35 -04002474 }
2475}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002476# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002477pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002478 TraitBound {
2479 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2480 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2481 path: _visitor.fold_path(_i . path),
2482 }
2483}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002484# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002485pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002486 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002487 TraitBoundModifier::None => { TraitBoundModifier::None }
2488 TraitBoundModifier::Maybe(_binding_0, ) => {
2489 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002490 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
2493 }
2494}
2495# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002496pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002497 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002498 TraitItem::Const(_binding_0, ) => {
2499 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002500 _visitor.fold_trait_item_const(_binding_0),
2501 )
2502 }
David Tolnay6702ade2017-12-30 23:38:15 -05002503 TraitItem::Method(_binding_0, ) => {
2504 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002505 _visitor.fold_trait_item_method(_binding_0),
2506 )
2507 }
David Tolnay6702ade2017-12-30 23:38:15 -05002508 TraitItem::Type(_binding_0, ) => {
2509 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002510 _visitor.fold_trait_item_type(_binding_0),
2511 )
2512 }
David Tolnay6702ade2017-12-30 23:38:15 -05002513 TraitItem::Macro(_binding_0, ) => {
2514 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002515 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002516 )
2517 }
David Tolnay6702ade2017-12-30 23:38:15 -05002518 TraitItem::Verbatim(_binding_0, ) => {
2519 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002520 _visitor.fold_trait_item_verbatim(_binding_0),
2521 )
2522 }
Nika Layzell27726662017-10-24 23:16:35 -04002523 }
2524}
2525# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002526pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002527 TraitItemConst {
2528 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002529 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002530 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002531 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002532 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002533 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002534 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002535 _visitor.fold_expr(( it ) . 1),
2536 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002537 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002538 }
2539}
2540# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002541pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002542 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002543 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002544 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002545 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002546 }
2547}
2548# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002549pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002550 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002551 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002552 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002553 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002554 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002555 }
2556}
2557# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002558pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002559 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002560 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002562 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002563 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002564 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002566 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002567 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002568 _visitor.fold_type(( it ) . 1),
2569 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002570 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002571 }
2572}
David Tolnay2ae520a2017-12-29 11:19:50 -05002573# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002574pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002575 TraitItemVerbatim {
2576 tts: _i . tts,
2577 }
2578}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002579# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002580pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002581 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002582 Type::Slice(_binding_0, ) => {
2583 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002584 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002585 )
2586 }
David Tolnay6702ade2017-12-30 23:38:15 -05002587 Type::Array(_binding_0, ) => {
2588 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002589 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002590 )
2591 }
David Tolnay6702ade2017-12-30 23:38:15 -05002592 Type::Ptr(_binding_0, ) => {
2593 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002594 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002595 )
2596 }
David Tolnay6702ade2017-12-30 23:38:15 -05002597 Type::Reference(_binding_0, ) => {
2598 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002599 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002600 )
2601 }
David Tolnay6702ade2017-12-30 23:38:15 -05002602 Type::BareFn(_binding_0, ) => {
2603 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002604 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002605 )
2606 }
David Tolnay6702ade2017-12-30 23:38:15 -05002607 Type::Never(_binding_0, ) => {
2608 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002609 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002610 )
2611 }
David Tolnay6702ade2017-12-30 23:38:15 -05002612 Type::Tuple(_binding_0, ) => {
2613 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002614 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002615 )
2616 }
David Tolnay6702ade2017-12-30 23:38:15 -05002617 Type::Path(_binding_0, ) => {
2618 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002619 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002620 )
2621 }
David Tolnay6702ade2017-12-30 23:38:15 -05002622 Type::TraitObject(_binding_0, ) => {
2623 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002624 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002625 )
2626 }
David Tolnay6702ade2017-12-30 23:38:15 -05002627 Type::ImplTrait(_binding_0, ) => {
2628 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002629 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002630 )
2631 }
David Tolnay6702ade2017-12-30 23:38:15 -05002632 Type::Paren(_binding_0, ) => {
2633 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002634 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002635 )
2636 }
David Tolnay6702ade2017-12-30 23:38:15 -05002637 Type::Group(_binding_0, ) => {
2638 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002639 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002640 )
2641 }
David Tolnay6702ade2017-12-30 23:38:15 -05002642 Type::Infer(_binding_0, ) => {
2643 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002644 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002645 )
2646 }
David Tolnay6702ade2017-12-30 23:38:15 -05002647 Type::Macro(_binding_0, ) => {
2648 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002649 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002650 )
2651 }
David Tolnay6702ade2017-12-30 23:38:15 -05002652 Type::Verbatim(_binding_0, ) => {
2653 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002654 _visitor.fold_type_verbatim(_binding_0),
2655 )
2656 }
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
2658}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002659# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002660pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002661 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002662 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002663 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002664 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002665 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
2667}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002668# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002669pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002670 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002671 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2672 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2673 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2674 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2675 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2676 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2677 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2678 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002679 }
2680}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002681# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002682pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002683 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002684 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002685 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002686 }
2687}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002688# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002689pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002690 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002691 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002692 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002693 }
2694}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002695# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002696pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002697 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002698 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002699 }
2700}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002701# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002702pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002703 TypeMacro {
2704 mac: _visitor.fold_macro(_i . mac),
2705 }
2706}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002707# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002708pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002709 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002710 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002711 }
2712}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002713# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002714pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002715 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002716 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002717 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002718 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002719 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002720 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002721 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002722 }
2723}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002724# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002725pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002726 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002727 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002728 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002729 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002730 )
2731 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002732 TypeParamBound::Lifetime(_binding_0, ) => {
2733 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002734 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002735 )
2736 }
2737 }
2738}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002739# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002740pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002741 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002742 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002743 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002744 }
2745}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002746# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002747pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002748 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002749 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002750 path: _visitor.fold_path(_i . path),
2751 }
2752}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002753# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002754pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002755 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002756 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2757 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002758 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2759 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002760 }
2761}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002762# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002763pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002764 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002765 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002766 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002767 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2768 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002769 }
2770}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002771# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002772pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002773 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002774 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002775 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002776 }
2777}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002778# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002779pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002780 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002781 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002782 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002785# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002786pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002787 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002788 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002789 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002790 }
2791}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002792# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002793pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002794 TypeVerbatim {
2795 tts: _i . tts,
2796 }
2797}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002798# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002799pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002800 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002801 UnOp::Deref(_binding_0, ) => {
2802 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002803 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002804 )
2805 }
David Tolnay6702ade2017-12-30 23:38:15 -05002806 UnOp::Not(_binding_0, ) => {
2807 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002808 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002809 )
2810 }
David Tolnay6702ade2017-12-30 23:38:15 -05002811 UnOp::Neg(_binding_0, ) => {
2812 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002813 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002814 )
2815 }
2816 }
2817}
David Tolnay5f332a92017-12-26 00:42:45 -05002818# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002819pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002820 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002821 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002822 }
2823}
2824# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002825pub fn fold_use_list<V: Fold + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
David Tolnay5f332a92017-12-26 00:42:45 -05002826 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002827 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002828 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2829 }
2830}
2831# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002832pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002833 UsePath {
2834 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002835 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002836 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002837 _visitor.fold_ident(( it ) . 1),
2838 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002839 }
2840}
2841# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002842pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002843 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002844 UseTree::Path(_binding_0, ) => {
2845 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002846 _visitor.fold_use_path(_binding_0),
2847 )
2848 }
David Tolnay6702ade2017-12-30 23:38:15 -05002849 UseTree::Glob(_binding_0, ) => {
2850 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002851 _visitor.fold_use_glob(_binding_0),
2852 )
2853 }
David Tolnay6702ade2017-12-30 23:38:15 -05002854 UseTree::List(_binding_0, ) => {
2855 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002856 _visitor.fold_use_list(_binding_0),
2857 )
2858 }
2859 }
2860}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002861# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002862pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002863 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002864 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002865 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002866 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002867 discriminant: (_i . discriminant).map(|it| { (
2868 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2869 _visitor.fold_expr(( it ) . 1),
2870 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002871 }
2872}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002873# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002874pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002875 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002876 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002877 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002878 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002879 }
2880}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002881# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002882pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002883 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002884 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002885 }
2886}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002887# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002888pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002889 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002890 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002891 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002892 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002893 path: Box::new(_visitor.fold_path(* _i . path)),
2894 }
2895}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002896# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002897pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002898 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002899 Visibility::Public(_binding_0, ) => {
2900 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002901 _visitor.fold_vis_public(_binding_0),
2902 )
2903 }
David Tolnay6702ade2017-12-30 23:38:15 -05002904 Visibility::Crate(_binding_0, ) => {
2905 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002906 _visitor.fold_vis_crate(_binding_0),
2907 )
2908 }
David Tolnay6702ade2017-12-30 23:38:15 -05002909 Visibility::Restricted(_binding_0, ) => {
2910 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002911 _visitor.fold_vis_restricted(_binding_0),
2912 )
2913 }
David Tolnay6702ade2017-12-30 23:38:15 -05002914 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002915 }
2916}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002917# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002918pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002919 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002920 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002921 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2922 }
2923}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002924# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002925pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002926 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002927 WherePredicate::Type(_binding_0, ) => {
2928 WherePredicate::Type (
2929 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002930 )
2931 }
David Tolnayd4add852018-01-01 20:13:24 -08002932 WherePredicate::Lifetime(_binding_0, ) => {
2933 WherePredicate::Lifetime (
2934 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002935 )
2936 }
David Tolnayd4add852018-01-01 20:13:24 -08002937 WherePredicate::Eq(_binding_0, ) => {
2938 WherePredicate::Eq (
2939 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002940 )
2941 }
2942 }
2943}
2944