blob: 46e94b20bc42ba4b6494ae2d5c5e3c0b19cec635 [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 Tolnay12374262018-01-07 12:38:34 -080033///
34/// *This trait is available if Syn is built with the `"fold"` feature.*
David Tolnay4b4c4b62018-01-06 13:48:05 -080035pub trait Fold {
David Tolnay3cfd1d32018-01-03 00:22:08 -080036# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040037fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080038# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -050039fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040040# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040041fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040042# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080046# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(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_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(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_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(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(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(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_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080056# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080058# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay506e43a2017-12-29 11:34:36 -050059fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080060# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080062# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080064# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050065fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080066# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050067fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080068# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050069fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080070# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050071fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080072# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050073fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080074# [ cfg ( feature = "derive" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080076# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(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_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(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_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(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(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080084# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080086# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(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_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(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_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080092# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(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_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080096# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(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_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(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_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(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_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(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_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(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_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(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_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(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(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(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_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800114# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800116# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800118# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500119fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800120# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800122# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500123fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(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_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(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_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnay81ab4f62018-01-27 19:02:51 -0800128# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800130# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(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_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800134# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800136# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500137fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(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_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800140# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800142# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500143fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800144# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800146# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800148# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500149fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800150# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500151fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(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(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(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_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800156# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800158# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_field(&mut self, i: Field) -> Field { fold_field(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_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800162# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(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(&mut self, i: Fields) -> Fields { fold_fields(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_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800168# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500169fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800182# [ cfg ( feature = "full" ) ]
183fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500184# [ cfg ( feature = "full" ) ]
185fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800186# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500187fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800188# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500189fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800190# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc2f1aba2017-11-12 20:29:22 -0800191fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800192# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500194
195fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800201fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500206# [ cfg ( feature = "full" ) ]
207fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800208# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500209fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800225fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800227fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800237fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500242# [ cfg ( feature = "full" ) ]
243fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800244# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -0500245fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800246# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500247fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800248# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800250# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500251fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
David Tolnay360efd22018-01-04 23:35:26 -0800252# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
253fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
254# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
255fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
256# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
257fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
258# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
259fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
260# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
261fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
262# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
263fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
264# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
265fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
266# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
267fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800268# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800270# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800271fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800272# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -0500273fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800274# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500275fn fold_member(&mut self, i: Member) -> Member { fold_member(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(&mut self, i: Meta) -> Meta { fold_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800278# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800279fn fold_meta_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800280# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800284# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500285fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800286# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800287fn fold_nested_meta(&mut self, i: NestedMeta) -> NestedMeta { fold_nested_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800288# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500289fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(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(&mut self, i: Pat) -> Pat { fold_pat(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_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(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_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800296# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800298# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500299fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(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_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(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_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(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_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(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_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(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_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(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(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800312# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800314# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500315fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800316# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800318# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500321fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800322# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(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_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(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_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800328# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800329fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800330# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800332# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800334# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -0800335fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500336
337fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800338# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400339fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800340# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -0800341fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800342# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400345fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400347fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800349fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400351fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400353fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500354# [ cfg ( feature = "full" ) ]
355fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(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(&mut self, i: Type) -> Type { fold_type(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_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(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_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(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_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(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_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800366# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800367fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800368# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500369fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(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_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(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(&mut self, i: TypeParam) -> TypeParam { fold_type_param(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_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(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_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(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_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800380# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800381fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800382# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -0800383fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(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_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800386# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800387fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800388# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500389fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800390# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500391fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800392# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500394# [ cfg ( feature = "full" ) ]
395fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
396# [ cfg ( feature = "full" ) ]
397fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
398# [ cfg ( feature = "full" ) ]
399fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
400# [ cfg ( feature = "full" ) ]
401fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(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_variant(&mut self, i: Variant) -> Variant { fold_variant(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_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(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_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(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_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(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_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(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_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800414# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400415fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400416
Nika Layzell27726662017-10-24 23:16:35 -0400417}
418
David Tolnay360efd22018-01-04 23:35:26 -0800419macro_rules! fold_span_only {
420 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800421 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
Alex Crichton9a4dca22018-03-28 06:32:19 -0700422 let span = _visitor.fold_span(_i.span());
423 _i.set_span(span);
David Tolnay360efd22018-01-04 23:35:26 -0800424 _i
425 }
426 }
David Tolnayd0adf522017-12-29 01:30:07 -0500427}
428
David Tolnay360efd22018-01-04 23:35:26 -0800429fold_span_only!(fold_ident: Ident);
David Tolnay0a0d78c2018-01-05 15:24:01 -0800430#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay360efd22018-01-04 23:35:26 -0800431fold_span_only!(fold_lifetime: Lifetime);
432#[cfg(any(feature = "full", feature = "derive"))]
433fold_span_only!(fold_lit_byte: LitByte);
434#[cfg(any(feature = "full", feature = "derive"))]
435fold_span_only!(fold_lit_byte_str: LitByteStr);
436#[cfg(any(feature = "full", feature = "derive"))]
437fold_span_only!(fold_lit_char: LitChar);
438#[cfg(any(feature = "full", feature = "derive"))]
439fold_span_only!(fold_lit_float: LitFloat);
440#[cfg(any(feature = "full", feature = "derive"))]
441fold_span_only!(fold_lit_int: LitInt);
442#[cfg(any(feature = "full", feature = "derive"))]
443fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500444
David Tolnay3cfd1d32018-01-03 00:22:08 -0800445# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800446pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400447 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500448 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayc2749802018-01-06 23:40:41 -0800449 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400450 }
451}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800452# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800453pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500454 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500455 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500457 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 }
460}
461# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800462pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400463 ArgCaptured {
464 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500465 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800466 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400467 }
468}
469# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800470pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400471 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500472 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500473 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400474 }
475}
476# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800477pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400478 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500479 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500480 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500481 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500482 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400483 }
484}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800485# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800486pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400487 Arm {
488 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
489 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500490 guard: (_i . guard).map(|it| { (
491 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
492 Box::new(_visitor.fold_expr(* ( it ) . 1)),
493 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500494 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400495 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500496 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400497 }
498}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800499# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800500pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400501 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500502 AttrStyle::Outer => { AttrStyle::Outer }
503 AttrStyle::Inner(_binding_0, ) => {
504 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500505 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400506 )
507 }
508 }
509}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800510# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800511pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400512 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500513 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500514 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500515 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400516 path: _visitor.fold_path(_i . path),
517 tts: _i . tts,
518 is_sugared_doc: _i . is_sugared_doc,
519 }
520}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800521# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800522pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400523 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500524 name: (_i . name).map(|it| { (
525 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500526 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500527 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800528 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400529 }
530}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800531# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800532pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400533 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500534 BareFnArgName::Named(_binding_0, ) => {
535 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500536 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400537 )
538 }
David Tolnay6702ade2017-12-30 23:38:15 -0500539 BareFnArgName::Wild(_binding_0, ) => {
540 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 }
545}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800546# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800547pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400548 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500549 BinOp::Add(_binding_0, ) => {
550 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
David Tolnay6702ade2017-12-30 23:38:15 -0500554 BinOp::Sub(_binding_0, ) => {
555 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
David Tolnay6702ade2017-12-30 23:38:15 -0500559 BinOp::Mul(_binding_0, ) => {
560 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
David Tolnay6702ade2017-12-30 23:38:15 -0500564 BinOp::Div(_binding_0, ) => {
565 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
David Tolnay6702ade2017-12-30 23:38:15 -0500569 BinOp::Rem(_binding_0, ) => {
570 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
David Tolnay6702ade2017-12-30 23:38:15 -0500574 BinOp::And(_binding_0, ) => {
575 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
David Tolnay6702ade2017-12-30 23:38:15 -0500579 BinOp::Or(_binding_0, ) => {
580 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
David Tolnay6702ade2017-12-30 23:38:15 -0500584 BinOp::BitXor(_binding_0, ) => {
585 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
David Tolnay6702ade2017-12-30 23:38:15 -0500589 BinOp::BitAnd(_binding_0, ) => {
590 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
David Tolnay6702ade2017-12-30 23:38:15 -0500594 BinOp::BitOr(_binding_0, ) => {
595 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
David Tolnay6702ade2017-12-30 23:38:15 -0500599 BinOp::Shl(_binding_0, ) => {
600 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
David Tolnay6702ade2017-12-30 23:38:15 -0500604 BinOp::Shr(_binding_0, ) => {
605 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
David Tolnay6702ade2017-12-30 23:38:15 -0500609 BinOp::Eq(_binding_0, ) => {
610 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
David Tolnay6702ade2017-12-30 23:38:15 -0500614 BinOp::Lt(_binding_0, ) => {
615 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
David Tolnay6702ade2017-12-30 23:38:15 -0500619 BinOp::Le(_binding_0, ) => {
620 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
David Tolnay6702ade2017-12-30 23:38:15 -0500624 BinOp::Ne(_binding_0, ) => {
625 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
David Tolnay6702ade2017-12-30 23:38:15 -0500629 BinOp::Ge(_binding_0, ) => {
630 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
David Tolnay6702ade2017-12-30 23:38:15 -0500634 BinOp::Gt(_binding_0, ) => {
635 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
David Tolnay6702ade2017-12-30 23:38:15 -0500639 BinOp::AddEq(_binding_0, ) => {
640 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
David Tolnay6702ade2017-12-30 23:38:15 -0500644 BinOp::SubEq(_binding_0, ) => {
645 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
David Tolnay6702ade2017-12-30 23:38:15 -0500649 BinOp::MulEq(_binding_0, ) => {
650 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
David Tolnay6702ade2017-12-30 23:38:15 -0500654 BinOp::DivEq(_binding_0, ) => {
655 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500656 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400657 )
658 }
David Tolnay6702ade2017-12-30 23:38:15 -0500659 BinOp::RemEq(_binding_0, ) => {
660 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500661 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 )
663 }
David Tolnay6702ade2017-12-30 23:38:15 -0500664 BinOp::BitXorEq(_binding_0, ) => {
665 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400667 )
668 }
David Tolnay6702ade2017-12-30 23:38:15 -0500669 BinOp::BitAndEq(_binding_0, ) => {
670 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500671 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400672 )
673 }
David Tolnay6702ade2017-12-30 23:38:15 -0500674 BinOp::BitOrEq(_binding_0, ) => {
675 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500676 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400677 )
678 }
David Tolnay6702ade2017-12-30 23:38:15 -0500679 BinOp::ShlEq(_binding_0, ) => {
680 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500681 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400682 )
683 }
David Tolnay6702ade2017-12-30 23:38:15 -0500684 BinOp::ShrEq(_binding_0, ) => {
685 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500686 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400687 )
688 }
689 }
690}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800691# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800692pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500693 Binding {
694 ident: _visitor.fold_ident(_i . ident),
695 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
696 ty: _visitor.fold_type(_i . ty),
697 }
698}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800699# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800700pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400701 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500702 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400703 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
704 }
705}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800706# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800707pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400708 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500709 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
710 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400711 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500712 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400713 }
714}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800715# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800716pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500717 ConstParam {
718 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500719 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500720 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500721 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500722 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500724 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
725 }
726}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800727# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800728pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500729 match _i {
730 Data::Struct(_binding_0, ) => {
731 Data::Struct (
732 _visitor.fold_data_struct(_binding_0),
733 )
734 }
735 Data::Enum(_binding_0, ) => {
736 Data::Enum (
737 _visitor.fold_data_enum(_binding_0),
738 )
739 }
740 Data::Union(_binding_0, ) => {
741 Data::Union (
742 _visitor.fold_data_union(_binding_0),
743 )
744 }
745 }
746}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800747# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800748pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500749 DataEnum {
750 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
751 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
752 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
753 }
754}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800755# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800756pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500757 DataStruct {
758 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
759 fields: _visitor.fold_fields(_i . fields),
760 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
761 }
762}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800763# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800764pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500765 DataUnion {
766 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
767 fields: _visitor.fold_fields_named(_i . fields),
768 }
769}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800770# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800771pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400772 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400773 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500774 vis: _visitor.fold_visibility(_i . vis),
775 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400776 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500777 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400778 }
779}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800780# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800781pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400782 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500783 Expr::Box(_binding_0, ) => {
784 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400785 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400786 )
787 }
David Tolnay6702ade2017-12-30 23:38:15 -0500788 Expr::InPlace(_binding_0, ) => {
789 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400790 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400791 )
792 }
David Tolnay6702ade2017-12-30 23:38:15 -0500793 Expr::Array(_binding_0, ) => {
794 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400795 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400796 )
797 }
David Tolnay6702ade2017-12-30 23:38:15 -0500798 Expr::Call(_binding_0, ) => {
799 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400800 _visitor.fold_expr_call(_binding_0),
801 )
802 }
David Tolnay6702ade2017-12-30 23:38:15 -0500803 Expr::MethodCall(_binding_0, ) => {
804 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
David Tolnay6702ade2017-12-30 23:38:15 -0500808 Expr::Tuple(_binding_0, ) => {
809 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500810 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
David Tolnay6702ade2017-12-30 23:38:15 -0500813 Expr::Binary(_binding_0, ) => {
814 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400815 _visitor.fold_expr_binary(_binding_0),
816 )
817 }
David Tolnay6702ade2017-12-30 23:38:15 -0500818 Expr::Unary(_binding_0, ) => {
819 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400820 _visitor.fold_expr_unary(_binding_0),
821 )
822 }
David Tolnay6702ade2017-12-30 23:38:15 -0500823 Expr::Lit(_binding_0, ) => {
824 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500825 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400826 )
827 }
David Tolnay6702ade2017-12-30 23:38:15 -0500828 Expr::Cast(_binding_0, ) => {
829 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400830 _visitor.fold_expr_cast(_binding_0),
831 )
832 }
David Tolnay6702ade2017-12-30 23:38:15 -0500833 Expr::Type(_binding_0, ) => {
834 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500835 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400836 )
837 }
David Tolnay6702ade2017-12-30 23:38:15 -0500838 Expr::If(_binding_0, ) => {
839 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400840 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400841 )
842 }
David Tolnay6702ade2017-12-30 23:38:15 -0500843 Expr::IfLet(_binding_0, ) => {
844 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400845 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400846 )
847 }
David Tolnay6702ade2017-12-30 23:38:15 -0500848 Expr::While(_binding_0, ) => {
849 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400850 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400851 )
852 }
David Tolnay6702ade2017-12-30 23:38:15 -0500853 Expr::WhileLet(_binding_0, ) => {
854 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
David Tolnay6702ade2017-12-30 23:38:15 -0500858 Expr::ForLoop(_binding_0, ) => {
859 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400860 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400861 )
862 }
David Tolnay6702ade2017-12-30 23:38:15 -0500863 Expr::Loop(_binding_0, ) => {
864 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400865 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400866 )
867 }
David Tolnay6702ade2017-12-30 23:38:15 -0500868 Expr::Match(_binding_0, ) => {
869 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400870 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400871 )
872 }
David Tolnay6702ade2017-12-30 23:38:15 -0500873 Expr::Closure(_binding_0, ) => {
874 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400875 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400876 )
877 }
David Tolnay6702ade2017-12-30 23:38:15 -0500878 Expr::Unsafe(_binding_0, ) => {
879 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500880 full!(_visitor.fold_expr_unsafe(_binding_0)),
881 )
882 }
David Tolnay6702ade2017-12-30 23:38:15 -0500883 Expr::Block(_binding_0, ) => {
884 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400885 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
David Tolnay6702ade2017-12-30 23:38:15 -0500888 Expr::Assign(_binding_0, ) => {
889 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400890 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
David Tolnay6702ade2017-12-30 23:38:15 -0500893 Expr::AssignOp(_binding_0, ) => {
894 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400895 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 )
897 }
David Tolnay6702ade2017-12-30 23:38:15 -0500898 Expr::Field(_binding_0, ) => {
899 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400900 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
David Tolnay6702ade2017-12-30 23:38:15 -0500903 Expr::Index(_binding_0, ) => {
904 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400905 _visitor.fold_expr_index(_binding_0),
906 )
907 }
David Tolnay6702ade2017-12-30 23:38:15 -0500908 Expr::Range(_binding_0, ) => {
909 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400910 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
David Tolnay6702ade2017-12-30 23:38:15 -0500913 Expr::Path(_binding_0, ) => {
914 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400915 _visitor.fold_expr_path(_binding_0),
916 )
917 }
David Tolnay6702ade2017-12-30 23:38:15 -0500918 Expr::AddrOf(_binding_0, ) => {
919 Expr::AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400920 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 )
922 }
David Tolnay6702ade2017-12-30 23:38:15 -0500923 Expr::Break(_binding_0, ) => {
924 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400925 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400926 )
927 }
David Tolnay6702ade2017-12-30 23:38:15 -0500928 Expr::Continue(_binding_0, ) => {
929 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400930 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400931 )
932 }
David Tolnay6702ade2017-12-30 23:38:15 -0500933 Expr::Return(_binding_0, ) => {
934 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500935 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400936 )
937 }
David Tolnay6702ade2017-12-30 23:38:15 -0500938 Expr::Macro(_binding_0, ) => {
939 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500940 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400941 )
942 }
David Tolnay6702ade2017-12-30 23:38:15 -0500943 Expr::Struct(_binding_0, ) => {
944 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400945 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400946 )
947 }
David Tolnay6702ade2017-12-30 23:38:15 -0500948 Expr::Repeat(_binding_0, ) => {
949 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400950 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400951 )
952 }
David Tolnay6702ade2017-12-30 23:38:15 -0500953 Expr::Paren(_binding_0, ) => {
954 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800955 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400956 )
957 }
David Tolnay6702ade2017-12-30 23:38:15 -0500958 Expr::Group(_binding_0, ) => {
959 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500960 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400961 )
962 }
David Tolnay6702ade2017-12-30 23:38:15 -0500963 Expr::Try(_binding_0, ) => {
964 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400965 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400966 )
967 }
David Tolnay6702ade2017-12-30 23:38:15 -0500968 Expr::Catch(_binding_0, ) => {
969 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400970 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400971 )
972 }
David Tolnay6702ade2017-12-30 23:38:15 -0500973 Expr::Yield(_binding_0, ) => {
974 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400975 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400976 )
977 }
David Tolnay6702ade2017-12-30 23:38:15 -0500978 Expr::Verbatim(_binding_0, ) => {
979 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500980 _visitor.fold_expr_verbatim(_binding_0),
981 )
982 }
Nika Layzell27726662017-10-24 23:16:35 -0400983 }
984}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800985# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800986pub fn fold_expr_addr_of<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
David Tolnay8c91b882017-12-28 23:04:32 -0500987 ExprAddrOf {
988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
989 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500990 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500991 expr: Box::new(_visitor.fold_expr(* _i . expr)),
992 }
993}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800994# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800995pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500996 ExprArray {
997 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
998 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500999 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001000 }
1001}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001002# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001003pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -05001004 ExprAssign {
1005 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1006 left: Box::new(_visitor.fold_expr(* _i . left)),
1007 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1008 right: Box::new(_visitor.fold_expr(* _i . right)),
1009 }
1010}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001011# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001012pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001013 ExprAssignOp {
1014 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1015 left: Box::new(_visitor.fold_expr(* _i . left)),
1016 op: _visitor.fold_bin_op(_i . op),
1017 right: Box::new(_visitor.fold_expr(* _i . right)),
1018 }
1019}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001020# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001021pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001022 ExprBinary {
1023 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1024 left: Box::new(_visitor.fold_expr(* _i . left)),
1025 op: _visitor.fold_bin_op(_i . op),
1026 right: Box::new(_visitor.fold_expr(* _i . right)),
1027 }
1028}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001029# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001030pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001031 ExprBlock {
1032 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1033 block: _visitor.fold_block(_i . block),
1034 }
1035}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001036# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001037pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001038 ExprBox {
1039 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1040 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1041 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1042 }
1043}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001044# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001045pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001046 ExprBreak {
1047 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1048 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1049 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1050 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1051 }
1052}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001053# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001054pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001055 ExprCall {
1056 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1057 func: Box::new(_visitor.fold_expr(* _i . func)),
1058 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1059 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1060 }
1061}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001062# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001063pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001064 ExprCast {
1065 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1066 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1067 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1068 ty: Box::new(_visitor.fold_type(* _i . ty)),
1069 }
1070}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001071# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001072pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001073 ExprCatch {
1074 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1075 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1076 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1077 block: _visitor.fold_block(_i . block),
1078 }
1079}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001080# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001081pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001082 ExprClosure {
1083 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001084 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001085 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1086 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1087 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1088 output: _visitor.fold_return_type(_i . output),
1089 body: Box::new(_visitor.fold_expr(* _i . body)),
1090 }
1091}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001092# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001093pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001094 ExprContinue {
1095 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1096 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1097 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1098 }
1099}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001100# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001101pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001102 ExprField {
1103 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1104 base: Box::new(_visitor.fold_expr(* _i . base)),
1105 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1106 member: _visitor.fold_member(_i . member),
1107 }
1108}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001109# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001110pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001111 ExprForLoop {
1112 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001113 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001114 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1115 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1116 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1117 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1118 body: _visitor.fold_block(_i . body),
1119 }
1120}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001121# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001122pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001123 ExprGroup {
1124 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1125 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1126 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1127 }
1128}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001129# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001130pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001131 ExprIf {
1132 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1133 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1134 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001135 then_branch: _visitor.fold_block(_i . then_branch),
1136 else_branch: (_i . else_branch).map(|it| { (
1137 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1138 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1139 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001140 }
1141}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001142# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001143pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001144 ExprIfLet {
1145 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1146 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1147 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1148 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1149 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1150 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001151 then_branch: _visitor.fold_block(_i . then_branch),
1152 else_branch: (_i . else_branch).map(|it| { (
1153 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1154 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1155 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001156 }
1157}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001158# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001159pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001160 ExprInPlace {
1161 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1162 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001163 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001164 value: Box::new(_visitor.fold_expr(* _i . value)),
1165 }
1166}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001167# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001168pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001169 ExprIndex {
1170 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1171 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1172 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1173 index: Box::new(_visitor.fold_expr(* _i . index)),
1174 }
1175}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001176# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001177pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001178 ExprLit {
1179 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1180 lit: _visitor.fold_lit(_i . lit),
1181 }
1182}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001183# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001184pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001185 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001186 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001187 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001188 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1189 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
1191}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001192# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001193pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001194 ExprMacro {
1195 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1196 mac: _visitor.fold_macro(_i . mac),
1197 }
1198}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001199# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001200pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001201 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001202 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001203 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001204 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001205 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001206 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1207 }
1208}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001209# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001210pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001211 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001212 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001213 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001214 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001215 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001216 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1218 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
1220}
David Tolnay81ab4f62018-01-27 19:02:51 -08001221# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001222pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001225 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001226 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001227 }
1228}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001229# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001230pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001231 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001232 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001233 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001234 path: _visitor.fold_path(_i . path),
1235 }
1236}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001237# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001238pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001239 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001240 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001241 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001242 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001243 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001244 }
1245}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001246# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001247pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001248 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001249 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001250 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001251 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001252 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001253 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
1255}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001256# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001257pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001258 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001259 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001260 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001261 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001262 }
1263}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001264# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001265pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001266 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001267 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001268 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001269 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001270 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1271 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1272 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001273 }
1274}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001275# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001276pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001277 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001278 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001279 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001280 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001281 }
1282}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001283# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001284pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001285 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001286 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001287 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001288 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001289 }
1290}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001291# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001292pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001293 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001294 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001295 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001296 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001297 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001298 }
1299}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001300# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001301pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001302 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001303 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001304 op: _visitor.fold_un_op(_i . op),
1305 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1306 }
1307}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001308# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001309pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001310 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001311 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001313 block: _visitor.fold_block(_i . block),
1314 }
1315}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001316# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001317pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001318 ExprVerbatim {
1319 tts: _i . tts,
1320 }
1321}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001322# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001323pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001324 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001325 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001326 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001327 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001328 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1329 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001330 }
1331}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001332# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001333pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001334 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001335 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001336 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001337 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1338 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001339 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001340 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001341 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1342 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001343 }
1344}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001345# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001346pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001347 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001348 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001349 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001350 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001351 }
1352}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001353# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001354pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001355 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001356 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001357 vis: _visitor.fold_visibility(_i . vis),
1358 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001359 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001360 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001361 }
1362}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001363# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001364pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001365 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001366 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001367 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001368 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001369 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001370 }
1371}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001372# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001373pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001374 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001375 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1376 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001377 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001378 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001379 }
1380}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001381# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001382pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001383 match _i {
1384 Fields::Named(_binding_0, ) => {
1385 Fields::Named (
1386 _visitor.fold_fields_named(_binding_0),
1387 )
1388 }
1389 Fields::Unnamed(_binding_0, ) => {
1390 Fields::Unnamed (
1391 _visitor.fold_fields_unnamed(_binding_0),
1392 )
1393 }
1394 Fields::Unit => { Fields::Unit }
1395 }
1396}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001397# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001398pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001399 FieldsNamed {
1400 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001401 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001402 }
1403}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001404# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001405pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001406 FieldsUnnamed {
1407 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001408 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001409 }
1410}
Nika Layzell27726662017-10-24 23:16:35 -04001411# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001412pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001413 File {
1414 shebang: _i . shebang,
1415 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1416 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1417 }
1418}
1419# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001420pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001421 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001422 FnArg::SelfRef(_binding_0, ) => {
1423 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001424 _visitor.fold_arg_self_ref(_binding_0),
1425 )
1426 }
David Tolnay6702ade2017-12-30 23:38:15 -05001427 FnArg::SelfValue(_binding_0, ) => {
1428 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001429 _visitor.fold_arg_self(_binding_0),
1430 )
1431 }
David Tolnay6702ade2017-12-30 23:38:15 -05001432 FnArg::Captured(_binding_0, ) => {
1433 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001434 _visitor.fold_arg_captured(_binding_0),
1435 )
1436 }
David Tolnay6702ade2017-12-30 23:38:15 -05001437 FnArg::Inferred(_binding_0, ) => {
1438 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001439 _visitor.fold_pat(_binding_0),
1440 )
1441 }
David Tolnay6702ade2017-12-30 23:38:15 -05001442 FnArg::Ignored(_binding_0, ) => {
1443 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001444 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001445 )
1446 }
1447 }
1448}
1449# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001450pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001451 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001452 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001453 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001454 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001455 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001456 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001457 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001458 }
1459}
1460# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001461pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001462 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001463 ForeignItem::Fn(_binding_0, ) => {
1464 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001465 _visitor.fold_foreign_item_fn(_binding_0),
1466 )
1467 }
David Tolnay6702ade2017-12-30 23:38:15 -05001468 ForeignItem::Static(_binding_0, ) => {
1469 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001470 _visitor.fold_foreign_item_static(_binding_0),
1471 )
1472 }
David Tolnay6702ade2017-12-30 23:38:15 -05001473 ForeignItem::Type(_binding_0, ) => {
1474 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001475 _visitor.fold_foreign_item_type(_binding_0),
1476 )
1477 }
David Tolnay6702ade2017-12-30 23:38:15 -05001478 ForeignItem::Verbatim(_binding_0, ) => {
1479 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001480 _visitor.fold_foreign_item_verbatim(_binding_0),
1481 )
1482 }
Nika Layzell27726662017-10-24 23:16:35 -04001483 }
1484}
1485# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001486pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001487 ForeignItemFn {
1488 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1489 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001490 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001491 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001492 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001493 }
1494}
1495# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001496pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001497 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001498 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1499 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001500 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001501 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001502 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001503 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001504 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001505 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001506 }
1507}
David Tolnay199bcbb2017-11-12 10:33:52 -08001508# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001509pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001510 ForeignItemType {
1511 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1512 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001513 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001514 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001515 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001516 }
1517}
David Tolnay2ae520a2017-12-29 11:19:50 -05001518# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001519pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001520 ForeignItemVerbatim {
1521 tts: _i . tts,
1522 }
1523}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001524# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001525pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001526 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001527 GenericArgument::Lifetime(_binding_0, ) => {
1528 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001529 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001530 )
1531 }
David Tolnay6702ade2017-12-30 23:38:15 -05001532 GenericArgument::Type(_binding_0, ) => {
1533 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001534 _visitor.fold_type(_binding_0),
1535 )
1536 }
David Tolnay6702ade2017-12-30 23:38:15 -05001537 GenericArgument::Binding(_binding_0, ) => {
1538 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001539 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001540 )
1541 }
David Tolnay6702ade2017-12-30 23:38:15 -05001542 GenericArgument::Const(_binding_0, ) => {
1543 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001544 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001545 )
1546 }
Nika Layzell357885a2017-12-04 15:47:07 -05001547 }
1548}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001549# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001550pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001551 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001552 GenericMethodArgument::Type(_binding_0, ) => {
1553 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001554 _visitor.fold_type(_binding_0),
1555 )
1556 }
David Tolnay6702ade2017-12-30 23:38:15 -05001557 GenericMethodArgument::Const(_binding_0, ) => {
1558 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001559 _visitor.fold_expr(_binding_0),
1560 )
1561 }
1562 }
1563}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001564# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001565pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001566 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001567 GenericParam::Type(_binding_0, ) => {
1568 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001569 _visitor.fold_type_param(_binding_0),
1570 )
1571 }
David Tolnay517f3692018-01-01 20:17:23 -08001572 GenericParam::Lifetime(_binding_0, ) => {
1573 GenericParam::Lifetime (
1574 _visitor.fold_lifetime_def(_binding_0),
1575 )
1576 }
David Tolnay6702ade2017-12-30 23:38:15 -05001577 GenericParam::Const(_binding_0, ) => {
1578 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001579 _visitor.fold_const_param(_binding_0),
1580 )
1581 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001582 }
1583}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001584# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001585pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001586 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001587 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001588 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001589 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001590 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001591 }
1592}
1593# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001594pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001595 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001596 ImplItem::Const(_binding_0, ) => {
1597 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001598 _visitor.fold_impl_item_const(_binding_0),
1599 )
1600 }
David Tolnay6702ade2017-12-30 23:38:15 -05001601 ImplItem::Method(_binding_0, ) => {
1602 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001603 _visitor.fold_impl_item_method(_binding_0),
1604 )
1605 }
David Tolnay6702ade2017-12-30 23:38:15 -05001606 ImplItem::Type(_binding_0, ) => {
1607 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001608 _visitor.fold_impl_item_type(_binding_0),
1609 )
1610 }
David Tolnay6702ade2017-12-30 23:38:15 -05001611 ImplItem::Macro(_binding_0, ) => {
1612 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001613 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001614 )
1615 }
David Tolnay6702ade2017-12-30 23:38:15 -05001616 ImplItem::Verbatim(_binding_0, ) => {
1617 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001618 _visitor.fold_impl_item_verbatim(_binding_0),
1619 )
1620 }
Nika Layzell27726662017-10-24 23:16:35 -04001621 }
1622}
1623# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001624pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001625 ImplItemConst {
1626 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1627 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001628 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001629 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001630 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001631 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001632 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001633 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001634 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001635 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001636 }
1637}
1638# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001639pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001640 ImplItemMacro {
1641 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1642 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001643 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001644 }
1645}
1646# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001647pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001648 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001649 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001650 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001651 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001652 sig: _visitor.fold_method_sig(_i . sig),
1653 block: _visitor.fold_block(_i . block),
1654 }
1655}
1656# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001657pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001658 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001659 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001660 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001661 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001662 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001663 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001664 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001665 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001666 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001667 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001668 }
1669}
David Tolnay2ae520a2017-12-29 11:19:50 -05001670# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001671pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001672 ImplItemVerbatim {
1673 tts: _i . tts,
1674 }
1675}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001676# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001677pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001678 Index {
1679 index: _i . index,
1680 span: _visitor.fold_span(_i . span),
1681 }
1682}
1683# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001684pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001685 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001686 Item::ExternCrate(_binding_0, ) => {
1687 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001688 _visitor.fold_item_extern_crate(_binding_0),
1689 )
1690 }
David Tolnay6702ade2017-12-30 23:38:15 -05001691 Item::Use(_binding_0, ) => {
1692 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001693 _visitor.fold_item_use(_binding_0),
1694 )
1695 }
David Tolnay6702ade2017-12-30 23:38:15 -05001696 Item::Static(_binding_0, ) => {
1697 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001698 _visitor.fold_item_static(_binding_0),
1699 )
1700 }
David Tolnay6702ade2017-12-30 23:38:15 -05001701 Item::Const(_binding_0, ) => {
1702 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001703 _visitor.fold_item_const(_binding_0),
1704 )
1705 }
David Tolnay6702ade2017-12-30 23:38:15 -05001706 Item::Fn(_binding_0, ) => {
1707 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001708 _visitor.fold_item_fn(_binding_0),
1709 )
1710 }
David Tolnay6702ade2017-12-30 23:38:15 -05001711 Item::Mod(_binding_0, ) => {
1712 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001713 _visitor.fold_item_mod(_binding_0),
1714 )
1715 }
David Tolnay6702ade2017-12-30 23:38:15 -05001716 Item::ForeignMod(_binding_0, ) => {
1717 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001718 _visitor.fold_item_foreign_mod(_binding_0),
1719 )
1720 }
David Tolnay6702ade2017-12-30 23:38:15 -05001721 Item::Type(_binding_0, ) => {
1722 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001723 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001724 )
1725 }
David Tolnay6702ade2017-12-30 23:38:15 -05001726 Item::Struct(_binding_0, ) => {
1727 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001728 _visitor.fold_item_struct(_binding_0),
1729 )
1730 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001731 Item::Enum(_binding_0, ) => {
1732 Item::Enum (
1733 _visitor.fold_item_enum(_binding_0),
1734 )
1735 }
David Tolnay6702ade2017-12-30 23:38:15 -05001736 Item::Union(_binding_0, ) => {
1737 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001738 _visitor.fold_item_union(_binding_0),
1739 )
1740 }
David Tolnay6702ade2017-12-30 23:38:15 -05001741 Item::Trait(_binding_0, ) => {
1742 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001743 _visitor.fold_item_trait(_binding_0),
1744 )
1745 }
David Tolnay6702ade2017-12-30 23:38:15 -05001746 Item::Impl(_binding_0, ) => {
1747 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001748 _visitor.fold_item_impl(_binding_0),
1749 )
1750 }
David Tolnay6702ade2017-12-30 23:38:15 -05001751 Item::Macro(_binding_0, ) => {
1752 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001753 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001754 )
1755 }
David Tolnay6702ade2017-12-30 23:38:15 -05001756 Item::Macro2(_binding_0, ) => {
1757 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001758 _visitor.fold_item_macro2(_binding_0),
1759 )
1760 }
David Tolnay6702ade2017-12-30 23:38:15 -05001761 Item::Verbatim(_binding_0, ) => {
1762 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001763 _visitor.fold_item_verbatim(_binding_0),
1764 )
1765 }
Nika Layzell27726662017-10-24 23:16:35 -04001766 }
1767}
1768# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001769pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001770 ItemConst {
1771 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1772 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001773 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001774 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001775 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001776 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001777 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001778 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001779 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001780 }
1781}
1782# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001783pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001784 ItemEnum {
1785 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1786 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001787 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001788 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001790 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1792 }
1793}
1794# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001795pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 ItemExternCrate {
1797 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1798 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001799 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1800 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001801 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001802 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001804 _visitor.fold_ident(( it ) . 1),
1805 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001807 }
1808}
1809# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001810pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001811 ItemFn {
1812 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1813 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001814 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001815 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001816 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001817 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001818 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001819 block: Box::new(_visitor.fold_block(* _i . block)),
1820 }
1821}
1822# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001823pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001824 ItemForeignMod {
1825 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1826 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001827 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001828 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1829 }
1830}
1831# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001832pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001833 ItemImpl {
1834 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001835 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001836 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001837 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001838 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001839 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001840 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001841 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001843 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001844 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001845 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001846 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1847 }
1848}
1849# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001850pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001851 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001852 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001853 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001854 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001855 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001856 }
1857}
1858# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001859pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001860 ItemMacro2 {
1861 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1862 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001864 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001865 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001866 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001867 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001868 body: _i . body,
1869 }
1870}
1871# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001872pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001873 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001874 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001875 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001876 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001877 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001878 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001879 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001880 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1881 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001882 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001883 }
1884}
1885# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001886pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001887 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001888 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001889 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001890 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001891 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001892 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001893 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001894 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001896 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001897 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001898 }
1899}
1900# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001901pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001902 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001903 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001904 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001905 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001906 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001907 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001908 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001909 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001910 }
1911}
1912# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001913pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001914 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001915 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001916 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001917 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001918 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1919 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001920 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001921 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001922 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001923 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001924 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001925 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1926 }
1927}
1928# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001929pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001930 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001931 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001932 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001933 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001934 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001935 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001936 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001937 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001938 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001939 }
1940}
1941# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001942pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001943 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001944 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001945 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001946 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001947 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001948 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001949 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001950 }
1951}
1952# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001953pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001954 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001955 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001956 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001957 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1958 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001959 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1960 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001961 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001962 }
1963}
David Tolnay2ae520a2017-12-29 11:19:50 -05001964# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001965pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001966 ItemVerbatim {
1967 tts: _i . tts,
1968 }
1969}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001970# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001971pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001972 Label {
1973 name: _visitor.fold_lifetime(_i . name),
1974 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1975 }
1976}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001977# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001978pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001979 LifetimeDef {
1980 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001981 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001982 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001983 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1984 }
1985}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001986# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001987pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001988 match _i {
1989 Lit::Str(_binding_0, ) => {
1990 Lit::Str (
1991 _visitor.fold_lit_str(_binding_0),
1992 )
1993 }
1994 Lit::ByteStr(_binding_0, ) => {
1995 Lit::ByteStr (
1996 _visitor.fold_lit_byte_str(_binding_0),
1997 )
1998 }
1999 Lit::Byte(_binding_0, ) => {
2000 Lit::Byte (
2001 _visitor.fold_lit_byte(_binding_0),
2002 )
2003 }
2004 Lit::Char(_binding_0, ) => {
2005 Lit::Char (
2006 _visitor.fold_lit_char(_binding_0),
2007 )
2008 }
2009 Lit::Int(_binding_0, ) => {
2010 Lit::Int (
2011 _visitor.fold_lit_int(_binding_0),
2012 )
2013 }
2014 Lit::Float(_binding_0, ) => {
2015 Lit::Float (
2016 _visitor.fold_lit_float(_binding_0),
2017 )
2018 }
2019 Lit::Bool(_binding_0, ) => {
2020 Lit::Bool (
2021 _visitor.fold_lit_bool(_binding_0),
2022 )
2023 }
2024 Lit::Verbatim(_binding_0, ) => {
2025 Lit::Verbatim (
2026 _visitor.fold_lit_verbatim(_binding_0),
2027 )
2028 }
2029 }
2030}
2031# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002032pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002033 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002034 value: _i . value,
2035 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002036 }
2037}
David Tolnay360efd22018-01-04 23:35:26 -08002038# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002039pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002040 LitVerbatim {
2041 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002042 }
2043}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002044# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002045pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002046 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002047 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002048 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
2049 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05002050 ty: (_i . ty).map(|it| { (
2051 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2052 Box::new(_visitor.fold_type(* ( it ) . 1)),
2053 ) }),
2054 init: (_i . init).map(|it| { (
2055 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2056 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2057 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002058 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002059 }
2060}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002061# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002062pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002063 Macro {
2064 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002065 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002066 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2067 tts: _i . tts,
2068 }
2069}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002070# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002071pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002072 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002073 MacroDelimiter::Paren(_binding_0, ) => {
2074 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002075 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2076 )
2077 }
David Tolnay6702ade2017-12-30 23:38:15 -05002078 MacroDelimiter::Brace(_binding_0, ) => {
2079 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002080 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2081 )
2082 }
David Tolnay6702ade2017-12-30 23:38:15 -05002083 MacroDelimiter::Bracket(_binding_0, ) => {
2084 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002085 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2086 )
2087 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002088 }
2089}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002090# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002091pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002092 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002093 Member::Named(_binding_0, ) => {
2094 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05002095 _visitor.fold_ident(_binding_0),
2096 )
2097 }
David Tolnay6702ade2017-12-30 23:38:15 -05002098 Member::Unnamed(_binding_0, ) => {
2099 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002100 _visitor.fold_index(_binding_0),
2101 )
2102 }
2103 }
2104}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002105# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002106pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002107 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002108 Meta::Word(_binding_0, ) => {
2109 Meta::Word (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002110 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002111 )
2112 }
David Tolnayaaadd782018-01-06 22:58:13 -08002113 Meta::List(_binding_0, ) => {
2114 Meta::List (
2115 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002116 )
2117 }
David Tolnayaaadd782018-01-06 22:58:13 -08002118 Meta::NameValue(_binding_0, ) => {
2119 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002120 _visitor.fold_meta_name_value(_binding_0),
2121 )
2122 }
2123 }
2124}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002125# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002126pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2127 MetaList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002128 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002129 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002130 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002131 }
2132}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002133# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002134pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002135 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002136 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002137 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002138 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002139 }
2140}
2141# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002142pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002143 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002144 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002145 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002146 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002147 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002148 decl: _visitor.fold_fn_decl(_i . decl),
2149 }
2150}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002151# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002152pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002153 MethodTurbofish {
2154 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2155 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2156 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2157 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2158 }
2159}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002160# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002161pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002162 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002163 NestedMeta::Meta(_binding_0, ) => {
2164 NestedMeta::Meta (
2165 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002166 )
2167 }
David Tolnayaaadd782018-01-06 22:58:13 -08002168 NestedMeta::Literal(_binding_0, ) => {
2169 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002170 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002171 )
2172 }
2173 }
2174}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002175# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002176pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002177 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002178 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002179 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002180 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002181 }
2182}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002183# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002184pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002185 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002186 Pat::Wild(_binding_0, ) => {
2187 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002188 _visitor.fold_pat_wild(_binding_0),
2189 )
2190 }
David Tolnay6702ade2017-12-30 23:38:15 -05002191 Pat::Ident(_binding_0, ) => {
2192 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002193 _visitor.fold_pat_ident(_binding_0),
2194 )
2195 }
David Tolnay6702ade2017-12-30 23:38:15 -05002196 Pat::Struct(_binding_0, ) => {
2197 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002198 _visitor.fold_pat_struct(_binding_0),
2199 )
2200 }
David Tolnay6702ade2017-12-30 23:38:15 -05002201 Pat::TupleStruct(_binding_0, ) => {
2202 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002203 _visitor.fold_pat_tuple_struct(_binding_0),
2204 )
2205 }
David Tolnay6702ade2017-12-30 23:38:15 -05002206 Pat::Path(_binding_0, ) => {
2207 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002208 _visitor.fold_pat_path(_binding_0),
2209 )
2210 }
David Tolnay6702ade2017-12-30 23:38:15 -05002211 Pat::Tuple(_binding_0, ) => {
2212 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002213 _visitor.fold_pat_tuple(_binding_0),
2214 )
2215 }
David Tolnay6702ade2017-12-30 23:38:15 -05002216 Pat::Box(_binding_0, ) => {
2217 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002218 _visitor.fold_pat_box(_binding_0),
2219 )
2220 }
David Tolnay6702ade2017-12-30 23:38:15 -05002221 Pat::Ref(_binding_0, ) => {
2222 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002223 _visitor.fold_pat_ref(_binding_0),
2224 )
2225 }
David Tolnay6702ade2017-12-30 23:38:15 -05002226 Pat::Lit(_binding_0, ) => {
2227 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002228 _visitor.fold_pat_lit(_binding_0),
2229 )
2230 }
David Tolnay6702ade2017-12-30 23:38:15 -05002231 Pat::Range(_binding_0, ) => {
2232 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002233 _visitor.fold_pat_range(_binding_0),
2234 )
2235 }
David Tolnay6702ade2017-12-30 23:38:15 -05002236 Pat::Slice(_binding_0, ) => {
2237 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002238 _visitor.fold_pat_slice(_binding_0),
2239 )
2240 }
David Tolnay6702ade2017-12-30 23:38:15 -05002241 Pat::Macro(_binding_0, ) => {
2242 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002243 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002244 )
2245 }
David Tolnay6702ade2017-12-30 23:38:15 -05002246 Pat::Verbatim(_binding_0, ) => {
2247 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002248 _visitor.fold_pat_verbatim(_binding_0),
2249 )
2250 }
Nika Layzell27726662017-10-24 23:16:35 -04002251 }
2252}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002253# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002254pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002255 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002256 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002257 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002258 }
2259}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002260# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002261pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002262 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002263 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2264 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002265 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002266 subpat: (_i . subpat).map(|it| { (
2267 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2268 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2269 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002270 }
2271}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002272# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002273pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002274 PatLit {
2275 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2276 }
2277}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002278# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002279pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002280 PatMacro {
2281 mac: _visitor.fold_macro(_i . mac),
2282 }
2283}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002284# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002285pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002286 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002287 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002288 path: _visitor.fold_path(_i . path),
2289 }
2290}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002291# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002292pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002293 PatRange {
2294 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002295 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002296 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002297 }
2298}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002299# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002300pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002301 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002302 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002303 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002304 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002305 }
2306}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002307# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002308pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002309 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002310 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002311 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002312 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002313 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002314 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002315 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002316 }
2317}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002318# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002319pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002320 PatStruct {
2321 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002322 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002323 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002324 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002325 }
2326}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002327# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002328pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002329 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002330 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002331 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002332 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002333 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2334 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002335 }
2336}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002337# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002338pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002339 PatTupleStruct {
2340 path: _visitor.fold_path(_i . path),
2341 pat: _visitor.fold_pat_tuple(_i . pat),
2342 }
2343}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002344# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002345pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002346 PatVerbatim {
2347 tts: _i . tts,
2348 }
2349}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002350# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002351pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002352 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002353 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002354 }
2355}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002356# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002357pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002358 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002359 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002360 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2361 }
2362}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002363# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002364pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002365 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002366 PathArguments::None => { PathArguments::None }
2367 PathArguments::AngleBracketed(_binding_0, ) => {
2368 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002369 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2370 )
2371 }
David Tolnay6702ade2017-12-30 23:38:15 -05002372 PathArguments::Parenthesized(_binding_0, ) => {
2373 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002374 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2375 )
2376 }
2377 }
2378}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002379# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002380pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002381 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002382 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002383 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002384 }
2385}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002386# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002387pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002388 PredicateEq {
2389 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2390 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2391 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2392 }
2393}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002394# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002395pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002396 PredicateLifetime {
2397 lifetime: _visitor.fold_lifetime(_i . lifetime),
2398 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2399 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2400 }
2401}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002402# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002403pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002404 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002405 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002406 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2407 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2408 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2409 }
2410}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002411# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002412pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002413 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002414 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002416 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002417 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2418 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002419 }
2420}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002421# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002422pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002423 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002424 RangeLimits::HalfOpen(_binding_0, ) => {
2425 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002426 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002427 )
2428 }
David Tolnay6702ade2017-12-30 23:38:15 -05002429 RangeLimits::Closed(_binding_0, ) => {
2430 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002431 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002432 )
2433 }
2434 }
2435}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002436# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002437pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002438 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002439 ReturnType::Default => { ReturnType::Default }
2440 ReturnType::Type(_binding_0, _binding_1, ) => {
2441 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002442 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2443 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002444 )
2445 }
2446 }
2447}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002448
David Tolnay4b4c4b62018-01-06 13:48:05 -08002449pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002450 _i
2451}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002452# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002453pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002454 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002455 Stmt::Local(_binding_0, ) => {
2456 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002457 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002458 )
2459 }
David Tolnay6702ade2017-12-30 23:38:15 -05002460 Stmt::Item(_binding_0, ) => {
2461 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002462 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002463 )
2464 }
David Tolnay6702ade2017-12-30 23:38:15 -05002465 Stmt::Expr(_binding_0, ) => {
2466 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002467 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002468 )
2469 }
David Tolnay6702ade2017-12-30 23:38:15 -05002470 Stmt::Semi(_binding_0, _binding_1, ) => {
2471 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002472 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002473 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002474 )
2475 }
Nika Layzell27726662017-10-24 23:16:35 -04002476 }
2477}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002478# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002479pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002480 TraitBound {
2481 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2482 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2483 path: _visitor.fold_path(_i . path),
2484 }
2485}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002486# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002487pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002488 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002489 TraitBoundModifier::None => { TraitBoundModifier::None }
2490 TraitBoundModifier::Maybe(_binding_0, ) => {
2491 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002492 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002493 )
2494 }
2495 }
2496}
2497# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002498pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002499 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002500 TraitItem::Const(_binding_0, ) => {
2501 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002502 _visitor.fold_trait_item_const(_binding_0),
2503 )
2504 }
David Tolnay6702ade2017-12-30 23:38:15 -05002505 TraitItem::Method(_binding_0, ) => {
2506 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002507 _visitor.fold_trait_item_method(_binding_0),
2508 )
2509 }
David Tolnay6702ade2017-12-30 23:38:15 -05002510 TraitItem::Type(_binding_0, ) => {
2511 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002512 _visitor.fold_trait_item_type(_binding_0),
2513 )
2514 }
David Tolnay6702ade2017-12-30 23:38:15 -05002515 TraitItem::Macro(_binding_0, ) => {
2516 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002517 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002518 )
2519 }
David Tolnay6702ade2017-12-30 23:38:15 -05002520 TraitItem::Verbatim(_binding_0, ) => {
2521 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002522 _visitor.fold_trait_item_verbatim(_binding_0),
2523 )
2524 }
Nika Layzell27726662017-10-24 23:16:35 -04002525 }
2526}
2527# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002528pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002529 TraitItemConst {
2530 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002531 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002532 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002533 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002534 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002535 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002536 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002537 _visitor.fold_expr(( it ) . 1),
2538 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002539 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002540 }
2541}
2542# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002543pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002544 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002545 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002546 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002548 }
2549}
2550# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002551pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002552 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002553 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002554 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002555 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002556 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002557 }
2558}
2559# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002560pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002561 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002562 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002563 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002564 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002565 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002566 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002568 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002569 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002570 _visitor.fold_type(( it ) . 1),
2571 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002572 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002573 }
2574}
David Tolnay2ae520a2017-12-29 11:19:50 -05002575# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002576pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002577 TraitItemVerbatim {
2578 tts: _i . tts,
2579 }
2580}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002581# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002582pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002583 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002584 Type::Slice(_binding_0, ) => {
2585 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002586 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002587 )
2588 }
David Tolnay6702ade2017-12-30 23:38:15 -05002589 Type::Array(_binding_0, ) => {
2590 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002592 )
2593 }
David Tolnay6702ade2017-12-30 23:38:15 -05002594 Type::Ptr(_binding_0, ) => {
2595 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002597 )
2598 }
David Tolnay6702ade2017-12-30 23:38:15 -05002599 Type::Reference(_binding_0, ) => {
2600 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002601 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002602 )
2603 }
David Tolnay6702ade2017-12-30 23:38:15 -05002604 Type::BareFn(_binding_0, ) => {
2605 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002606 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002607 )
2608 }
David Tolnay6702ade2017-12-30 23:38:15 -05002609 Type::Never(_binding_0, ) => {
2610 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
David Tolnay6702ade2017-12-30 23:38:15 -05002614 Type::Tuple(_binding_0, ) => {
2615 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002616 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002617 )
2618 }
David Tolnay6702ade2017-12-30 23:38:15 -05002619 Type::Path(_binding_0, ) => {
2620 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002621 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002622 )
2623 }
David Tolnay6702ade2017-12-30 23:38:15 -05002624 Type::TraitObject(_binding_0, ) => {
2625 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002627 )
2628 }
David Tolnay6702ade2017-12-30 23:38:15 -05002629 Type::ImplTrait(_binding_0, ) => {
2630 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002632 )
2633 }
David Tolnay6702ade2017-12-30 23:38:15 -05002634 Type::Paren(_binding_0, ) => {
2635 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002636 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002637 )
2638 }
David Tolnay6702ade2017-12-30 23:38:15 -05002639 Type::Group(_binding_0, ) => {
2640 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002642 )
2643 }
David Tolnay6702ade2017-12-30 23:38:15 -05002644 Type::Infer(_binding_0, ) => {
2645 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002646 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
David Tolnay6702ade2017-12-30 23:38:15 -05002649 Type::Macro(_binding_0, ) => {
2650 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002651 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002652 )
2653 }
David Tolnay6702ade2017-12-30 23:38:15 -05002654 Type::Verbatim(_binding_0, ) => {
2655 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002656 _visitor.fold_type_verbatim(_binding_0),
2657 )
2658 }
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
2660}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002661# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002662pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002663 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002664 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002665 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002666 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002667 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002668 }
2669}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002670# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002671pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002672 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002673 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2674 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2675 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2676 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2677 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2678 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2679 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2680 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002681 }
2682}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002683# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002684pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002685 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002686 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002687 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002688 }
2689}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002690# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002691pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002692 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002693 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002694 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002695 }
2696}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002697# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002698pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002699 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002700 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002701 }
2702}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002703# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002704pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002705 TypeMacro {
2706 mac: _visitor.fold_macro(_i . mac),
2707 }
2708}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002709# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002710pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002711 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002712 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002713 }
2714}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002715# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002716pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002717 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002718 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002719 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002720 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002721 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002722 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002723 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002724 }
2725}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002726# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002727pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002728 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002729 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002730 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002731 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002732 )
2733 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002734 TypeParamBound::Lifetime(_binding_0, ) => {
2735 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002736 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002737 )
2738 }
2739 }
2740}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002741# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002742pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002743 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002744 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002745 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002746 }
2747}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002748# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002749pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002750 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002751 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002752 path: _visitor.fold_path(_i . path),
2753 }
2754}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002755# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002756pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002757 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002758 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2759 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002760 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2761 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002762 }
2763}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002764# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002765pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002766 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002767 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002768 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002769 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2770 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002771 }
2772}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002773# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002774pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002775 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002776 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002777 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002778 }
2779}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002780# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002781pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002782 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002783 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002784 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002785 }
2786}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002787# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002788pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002789 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002790 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002791 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002792 }
2793}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002794# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002795pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002796 TypeVerbatim {
2797 tts: _i . tts,
2798 }
2799}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002800# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002801pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002802 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002803 UnOp::Deref(_binding_0, ) => {
2804 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002805 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002806 )
2807 }
David Tolnay6702ade2017-12-30 23:38:15 -05002808 UnOp::Not(_binding_0, ) => {
2809 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002810 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002811 )
2812 }
David Tolnay6702ade2017-12-30 23:38:15 -05002813 UnOp::Neg(_binding_0, ) => {
2814 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002815 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002816 )
2817 }
2818 }
2819}
David Tolnay5f332a92017-12-26 00:42:45 -05002820# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002821pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002822 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002823 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002824 }
2825}
2826# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002827pub fn fold_use_list<V: Fold + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
David Tolnay5f332a92017-12-26 00:42:45 -05002828 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002829 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002830 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2831 }
2832}
2833# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002834pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002835 UsePath {
2836 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002837 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002838 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002839 _visitor.fold_ident(( it ) . 1),
2840 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002841 }
2842}
2843# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002844pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002845 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002846 UseTree::Path(_binding_0, ) => {
2847 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002848 _visitor.fold_use_path(_binding_0),
2849 )
2850 }
David Tolnay6702ade2017-12-30 23:38:15 -05002851 UseTree::Glob(_binding_0, ) => {
2852 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002853 _visitor.fold_use_glob(_binding_0),
2854 )
2855 }
David Tolnay6702ade2017-12-30 23:38:15 -05002856 UseTree::List(_binding_0, ) => {
2857 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002858 _visitor.fold_use_list(_binding_0),
2859 )
2860 }
2861 }
2862}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002863# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002864pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002865 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002866 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002867 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002868 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002869 discriminant: (_i . discriminant).map(|it| { (
2870 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2871 _visitor.fold_expr(( it ) . 1),
2872 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002873 }
2874}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002875# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002876pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002877 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002878 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002879 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002880 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002881 }
2882}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002883# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002884pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002885 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002886 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002887 }
2888}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002889# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002890pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002891 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002892 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002893 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002894 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002895 path: Box::new(_visitor.fold_path(* _i . path)),
2896 }
2897}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002898# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002899pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002900 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002901 Visibility::Public(_binding_0, ) => {
2902 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002903 _visitor.fold_vis_public(_binding_0),
2904 )
2905 }
David Tolnay6702ade2017-12-30 23:38:15 -05002906 Visibility::Crate(_binding_0, ) => {
2907 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002908 _visitor.fold_vis_crate(_binding_0),
2909 )
2910 }
David Tolnay6702ade2017-12-30 23:38:15 -05002911 Visibility::Restricted(_binding_0, ) => {
2912 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002913 _visitor.fold_vis_restricted(_binding_0),
2914 )
2915 }
David Tolnay6702ade2017-12-30 23:38:15 -05002916 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002917 }
2918}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002919# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002920pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002921 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002922 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002923 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2924 }
2925}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002926# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002927pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002928 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002929 WherePredicate::Type(_binding_0, ) => {
2930 WherePredicate::Type (
2931 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002932 )
2933 }
David Tolnayd4add852018-01-01 20:13:24 -08002934 WherePredicate::Lifetime(_binding_0, ) => {
2935 WherePredicate::Lifetime (
2936 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002937 )
2938 }
David Tolnayd4add852018-01-01 20:13:24 -08002939 WherePredicate::Eq(_binding_0, ) => {
2940 WherePredicate::Eq (
2941 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002942 )
2943 }
2944 }
2945}
2946