blob: ba63aa4e1220dbc360041ea8a0756b0cd26159c2 [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_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080080# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080082# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080084# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080086# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080088# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080090# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080092# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080094# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080096# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080098# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800100# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800102# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800104# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800106# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800108# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800110# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800112# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800114# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800116# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500117fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800118# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800120# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500121fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800122# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800124# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnay81ab4f62018-01-27 19:02:51 -0800126# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800128# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800130# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800132# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +0200133fn fold_expr_reference(&mut self, i: ExprReference) -> ExprReference { fold_expr_reference(self, i) }
134# [ 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) }),
David Tolnay18cc4d42018-03-31 18:47:20 +0200489 leading_vert: (_i . leading_vert).map(|it| { Token ! [ | ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400490 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500491 guard: (_i . guard).map(|it| { (
492 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
493 Box::new(_visitor.fold_expr(* ( it ) . 1)),
494 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500495 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400496 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500497 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400498 }
499}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800500# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800501pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400502 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500503 AttrStyle::Outer => { AttrStyle::Outer }
504 AttrStyle::Inner(_binding_0, ) => {
505 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500506 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400507 )
508 }
509 }
510}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800511# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800512pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400513 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500514 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500515 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500516 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400517 path: _visitor.fold_path(_i . path),
518 tts: _i . tts,
519 is_sugared_doc: _i . is_sugared_doc,
520 }
521}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800522# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800523pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400524 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500525 name: (_i . name).map(|it| { (
526 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500527 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500528 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800529 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400530 }
531}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800532# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800533pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400534 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500535 BareFnArgName::Named(_binding_0, ) => {
536 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500537 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400538 )
539 }
David Tolnay6702ade2017-12-30 23:38:15 -0500540 BareFnArgName::Wild(_binding_0, ) => {
541 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500542 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400543 )
544 }
545 }
546}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800547# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800548pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400549 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500550 BinOp::Add(_binding_0, ) => {
551 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500552 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400553 )
554 }
David Tolnay6702ade2017-12-30 23:38:15 -0500555 BinOp::Sub(_binding_0, ) => {
556 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500557 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400558 )
559 }
David Tolnay6702ade2017-12-30 23:38:15 -0500560 BinOp::Mul(_binding_0, ) => {
561 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500562 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400563 )
564 }
David Tolnay6702ade2017-12-30 23:38:15 -0500565 BinOp::Div(_binding_0, ) => {
566 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500567 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400568 )
569 }
David Tolnay6702ade2017-12-30 23:38:15 -0500570 BinOp::Rem(_binding_0, ) => {
571 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500572 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400573 )
574 }
David Tolnay6702ade2017-12-30 23:38:15 -0500575 BinOp::And(_binding_0, ) => {
576 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500577 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400578 )
579 }
David Tolnay6702ade2017-12-30 23:38:15 -0500580 BinOp::Or(_binding_0, ) => {
581 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500582 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400583 )
584 }
David Tolnay6702ade2017-12-30 23:38:15 -0500585 BinOp::BitXor(_binding_0, ) => {
586 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500587 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400588 )
589 }
David Tolnay6702ade2017-12-30 23:38:15 -0500590 BinOp::BitAnd(_binding_0, ) => {
591 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500592 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400593 )
594 }
David Tolnay6702ade2017-12-30 23:38:15 -0500595 BinOp::BitOr(_binding_0, ) => {
596 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500597 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400598 )
599 }
David Tolnay6702ade2017-12-30 23:38:15 -0500600 BinOp::Shl(_binding_0, ) => {
601 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500602 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400603 )
604 }
David Tolnay6702ade2017-12-30 23:38:15 -0500605 BinOp::Shr(_binding_0, ) => {
606 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500607 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400608 )
609 }
David Tolnay6702ade2017-12-30 23:38:15 -0500610 BinOp::Eq(_binding_0, ) => {
611 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500612 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400613 )
614 }
David Tolnay6702ade2017-12-30 23:38:15 -0500615 BinOp::Lt(_binding_0, ) => {
616 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500617 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400618 )
619 }
David Tolnay6702ade2017-12-30 23:38:15 -0500620 BinOp::Le(_binding_0, ) => {
621 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500622 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400623 )
624 }
David Tolnay6702ade2017-12-30 23:38:15 -0500625 BinOp::Ne(_binding_0, ) => {
626 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500627 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400628 )
629 }
David Tolnay6702ade2017-12-30 23:38:15 -0500630 BinOp::Ge(_binding_0, ) => {
631 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500632 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400633 )
634 }
David Tolnay6702ade2017-12-30 23:38:15 -0500635 BinOp::Gt(_binding_0, ) => {
636 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500637 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400638 )
639 }
David Tolnay6702ade2017-12-30 23:38:15 -0500640 BinOp::AddEq(_binding_0, ) => {
641 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500642 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400643 )
644 }
David Tolnay6702ade2017-12-30 23:38:15 -0500645 BinOp::SubEq(_binding_0, ) => {
646 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500647 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400648 )
649 }
David Tolnay6702ade2017-12-30 23:38:15 -0500650 BinOp::MulEq(_binding_0, ) => {
651 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500652 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400653 )
654 }
David Tolnay6702ade2017-12-30 23:38:15 -0500655 BinOp::DivEq(_binding_0, ) => {
656 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500657 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400658 )
659 }
David Tolnay6702ade2017-12-30 23:38:15 -0500660 BinOp::RemEq(_binding_0, ) => {
661 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500662 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400663 )
664 }
David Tolnay6702ade2017-12-30 23:38:15 -0500665 BinOp::BitXorEq(_binding_0, ) => {
666 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500667 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400668 )
669 }
David Tolnay6702ade2017-12-30 23:38:15 -0500670 BinOp::BitAndEq(_binding_0, ) => {
671 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500672 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400673 )
674 }
David Tolnay6702ade2017-12-30 23:38:15 -0500675 BinOp::BitOrEq(_binding_0, ) => {
676 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500677 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400678 )
679 }
David Tolnay6702ade2017-12-30 23:38:15 -0500680 BinOp::ShlEq(_binding_0, ) => {
681 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500682 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400683 )
684 }
David Tolnay6702ade2017-12-30 23:38:15 -0500685 BinOp::ShrEq(_binding_0, ) => {
686 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500687 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400688 )
689 }
690 }
691}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800692# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800693pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500694 Binding {
695 ident: _visitor.fold_ident(_i . ident),
696 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
697 ty: _visitor.fold_type(_i . ty),
698 }
699}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800700# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800701pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400702 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500703 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400704 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
705 }
706}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800707# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800708pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400709 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500710 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
711 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400712 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500713 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400714 }
715}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800716# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800717pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500718 ConstParam {
719 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500721 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500723 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500724 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500725 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
726 }
727}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800728# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800729pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500730 match _i {
731 Data::Struct(_binding_0, ) => {
732 Data::Struct (
733 _visitor.fold_data_struct(_binding_0),
734 )
735 }
736 Data::Enum(_binding_0, ) => {
737 Data::Enum (
738 _visitor.fold_data_enum(_binding_0),
739 )
740 }
741 Data::Union(_binding_0, ) => {
742 Data::Union (
743 _visitor.fold_data_union(_binding_0),
744 )
745 }
746 }
747}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800748# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800749pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500750 DataEnum {
751 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
752 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
753 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
754 }
755}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800756# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800757pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500758 DataStruct {
759 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
760 fields: _visitor.fold_fields(_i . fields),
761 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
762 }
763}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800764# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800765pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500766 DataUnion {
767 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
768 fields: _visitor.fold_fields_named(_i . fields),
769 }
770}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800771# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800772pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400773 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400774 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500775 vis: _visitor.fold_visibility(_i . vis),
776 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400777 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500778 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400779 }
780}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800781# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800782pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400783 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500784 Expr::Box(_binding_0, ) => {
785 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400786 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400787 )
788 }
David Tolnay6702ade2017-12-30 23:38:15 -0500789 Expr::InPlace(_binding_0, ) => {
790 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400791 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400792 )
793 }
David Tolnay6702ade2017-12-30 23:38:15 -0500794 Expr::Array(_binding_0, ) => {
795 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400796 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400797 )
798 }
David Tolnay6702ade2017-12-30 23:38:15 -0500799 Expr::Call(_binding_0, ) => {
800 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400801 _visitor.fold_expr_call(_binding_0),
802 )
803 }
David Tolnay6702ade2017-12-30 23:38:15 -0500804 Expr::MethodCall(_binding_0, ) => {
805 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400806 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 )
808 }
David Tolnay6702ade2017-12-30 23:38:15 -0500809 Expr::Tuple(_binding_0, ) => {
810 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500811 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400812 )
813 }
David Tolnay6702ade2017-12-30 23:38:15 -0500814 Expr::Binary(_binding_0, ) => {
815 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400816 _visitor.fold_expr_binary(_binding_0),
817 )
818 }
David Tolnay6702ade2017-12-30 23:38:15 -0500819 Expr::Unary(_binding_0, ) => {
820 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400821 _visitor.fold_expr_unary(_binding_0),
822 )
823 }
David Tolnay6702ade2017-12-30 23:38:15 -0500824 Expr::Lit(_binding_0, ) => {
825 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500826 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400827 )
828 }
David Tolnay6702ade2017-12-30 23:38:15 -0500829 Expr::Cast(_binding_0, ) => {
830 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400831 _visitor.fold_expr_cast(_binding_0),
832 )
833 }
David Tolnay6702ade2017-12-30 23:38:15 -0500834 Expr::Type(_binding_0, ) => {
835 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500836 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400837 )
838 }
David Tolnay6702ade2017-12-30 23:38:15 -0500839 Expr::If(_binding_0, ) => {
840 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400841 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400842 )
843 }
David Tolnay6702ade2017-12-30 23:38:15 -0500844 Expr::IfLet(_binding_0, ) => {
845 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400846 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400847 )
848 }
David Tolnay6702ade2017-12-30 23:38:15 -0500849 Expr::While(_binding_0, ) => {
850 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
David Tolnay6702ade2017-12-30 23:38:15 -0500854 Expr::WhileLet(_binding_0, ) => {
855 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
David Tolnay6702ade2017-12-30 23:38:15 -0500859 Expr::ForLoop(_binding_0, ) => {
860 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400861 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400862 )
863 }
David Tolnay6702ade2017-12-30 23:38:15 -0500864 Expr::Loop(_binding_0, ) => {
865 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400866 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 )
868 }
David Tolnay6702ade2017-12-30 23:38:15 -0500869 Expr::Match(_binding_0, ) => {
870 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400871 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400872 )
873 }
David Tolnay6702ade2017-12-30 23:38:15 -0500874 Expr::Closure(_binding_0, ) => {
875 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400876 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400877 )
878 }
David Tolnay6702ade2017-12-30 23:38:15 -0500879 Expr::Unsafe(_binding_0, ) => {
880 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500881 full!(_visitor.fold_expr_unsafe(_binding_0)),
882 )
883 }
David Tolnay6702ade2017-12-30 23:38:15 -0500884 Expr::Block(_binding_0, ) => {
885 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400886 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400887 )
888 }
David Tolnay6702ade2017-12-30 23:38:15 -0500889 Expr::Assign(_binding_0, ) => {
890 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400891 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
David Tolnay6702ade2017-12-30 23:38:15 -0500894 Expr::AssignOp(_binding_0, ) => {
895 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400896 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
David Tolnay6702ade2017-12-30 23:38:15 -0500899 Expr::Field(_binding_0, ) => {
900 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400901 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400902 )
903 }
David Tolnay6702ade2017-12-30 23:38:15 -0500904 Expr::Index(_binding_0, ) => {
905 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400906 _visitor.fold_expr_index(_binding_0),
907 )
908 }
David Tolnay6702ade2017-12-30 23:38:15 -0500909 Expr::Range(_binding_0, ) => {
910 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400911 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400912 )
913 }
David Tolnay6702ade2017-12-30 23:38:15 -0500914 Expr::Path(_binding_0, ) => {
915 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400916 _visitor.fold_expr_path(_binding_0),
917 )
918 }
David Tolnay00674ba2018-03-31 18:14:11 +0200919 Expr::Reference(_binding_0, ) => {
920 Expr::Reference (
921 full!(_visitor.fold_expr_reference(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400922 )
923 }
David Tolnay6702ade2017-12-30 23:38:15 -0500924 Expr::Break(_binding_0, ) => {
925 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400926 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400927 )
928 }
David Tolnay6702ade2017-12-30 23:38:15 -0500929 Expr::Continue(_binding_0, ) => {
930 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400931 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400932 )
933 }
David Tolnay6702ade2017-12-30 23:38:15 -0500934 Expr::Return(_binding_0, ) => {
935 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500936 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400937 )
938 }
David Tolnay6702ade2017-12-30 23:38:15 -0500939 Expr::Macro(_binding_0, ) => {
940 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500941 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400942 )
943 }
David Tolnay6702ade2017-12-30 23:38:15 -0500944 Expr::Struct(_binding_0, ) => {
945 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400946 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400947 )
948 }
David Tolnay6702ade2017-12-30 23:38:15 -0500949 Expr::Repeat(_binding_0, ) => {
950 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400951 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400952 )
953 }
David Tolnay6702ade2017-12-30 23:38:15 -0500954 Expr::Paren(_binding_0, ) => {
955 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800956 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400957 )
958 }
David Tolnay6702ade2017-12-30 23:38:15 -0500959 Expr::Group(_binding_0, ) => {
960 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500961 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400962 )
963 }
David Tolnay6702ade2017-12-30 23:38:15 -0500964 Expr::Try(_binding_0, ) => {
965 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400966 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400967 )
968 }
David Tolnay6702ade2017-12-30 23:38:15 -0500969 Expr::Catch(_binding_0, ) => {
970 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400971 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400972 )
973 }
David Tolnay6702ade2017-12-30 23:38:15 -0500974 Expr::Yield(_binding_0, ) => {
975 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400976 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400977 )
978 }
David Tolnay6702ade2017-12-30 23:38:15 -0500979 Expr::Verbatim(_binding_0, ) => {
980 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500981 _visitor.fold_expr_verbatim(_binding_0),
982 )
983 }
Nika Layzell27726662017-10-24 23:16:35 -0400984 }
985}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800986# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800987pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500988 ExprArray {
989 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
990 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500991 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500992 }
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_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -0500996 ExprAssign {
997 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
998 left: Box::new(_visitor.fold_expr(* _i . left)),
999 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1000 right: Box::new(_visitor.fold_expr(* _i . right)),
1001 }
1002}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001003# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001004pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001005 ExprAssignOp {
1006 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1007 left: Box::new(_visitor.fold_expr(* _i . left)),
1008 op: _visitor.fold_bin_op(_i . op),
1009 right: Box::new(_visitor.fold_expr(* _i . right)),
1010 }
1011}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001012# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001013pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001014 ExprBinary {
1015 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1016 left: Box::new(_visitor.fold_expr(* _i . left)),
1017 op: _visitor.fold_bin_op(_i . op),
1018 right: Box::new(_visitor.fold_expr(* _i . right)),
1019 }
1020}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001021# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001022pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001023 ExprBlock {
1024 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1025 block: _visitor.fold_block(_i . block),
1026 }
1027}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001028# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001029pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001030 ExprBox {
1031 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1032 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1033 expr: Box::new(_visitor.fold_expr(* _i . expr)),
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_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001038 ExprBreak {
1039 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1040 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1041 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1042 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1043 }
1044}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001045# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001046pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001047 ExprCall {
1048 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1049 func: Box::new(_visitor.fold_expr(* _i . func)),
1050 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1051 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1052 }
1053}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001054# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001055pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001056 ExprCast {
1057 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1058 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1059 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1060 ty: Box::new(_visitor.fold_type(* _i . ty)),
1061 }
1062}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001063# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001064pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001065 ExprCatch {
1066 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1067 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1068 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1069 block: _visitor.fold_block(_i . block),
1070 }
1071}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001072# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001073pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001074 ExprClosure {
1075 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001076 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001077 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1078 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1079 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1080 output: _visitor.fold_return_type(_i . output),
1081 body: Box::new(_visitor.fold_expr(* _i . body)),
1082 }
1083}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001084# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001085pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001086 ExprContinue {
1087 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1088 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1089 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
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_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001094 ExprField {
1095 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1096 base: Box::new(_visitor.fold_expr(* _i . base)),
1097 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1098 member: _visitor.fold_member(_i . member),
1099 }
1100}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001101# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001102pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001103 ExprForLoop {
1104 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001105 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001106 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1107 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1108 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1109 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1110 body: _visitor.fold_block(_i . body),
1111 }
1112}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001113# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001114pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001115 ExprGroup {
1116 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1117 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1118 expr: Box::new(_visitor.fold_expr(* _i . expr)),
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_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001123 ExprIf {
1124 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1125 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1126 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001127 then_branch: _visitor.fold_block(_i . then_branch),
1128 else_branch: (_i . else_branch).map(|it| { (
1129 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1130 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1131 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001132 }
1133}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001134# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001135pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001136 ExprIfLet {
1137 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1138 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1139 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1140 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1141 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1142 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001143 then_branch: _visitor.fold_block(_i . then_branch),
1144 else_branch: (_i . else_branch).map(|it| { (
1145 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1146 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1147 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001148 }
1149}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001150# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001151pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001152 ExprInPlace {
1153 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1154 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001155 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001156 value: Box::new(_visitor.fold_expr(* _i . value)),
1157 }
1158}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001159# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001160pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001161 ExprIndex {
1162 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1163 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1164 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1165 index: Box::new(_visitor.fold_expr(* _i . index)),
1166 }
1167}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001168# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001169pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001170 ExprLit {
1171 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1172 lit: _visitor.fold_lit(_i . lit),
1173 }
1174}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001175# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001176pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001177 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001178 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001179 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001180 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1181 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001182 }
1183}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001184# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001185pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001186 ExprMacro {
1187 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1188 mac: _visitor.fold_macro(_i . mac),
1189 }
1190}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001191# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001192pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001193 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001194 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001195 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001196 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001197 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001198 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1199 }
1200}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001201# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001202pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001203 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001204 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001205 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001206 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001207 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001208 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001209 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1210 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001211 }
1212}
David Tolnay81ab4f62018-01-27 19:02:51 -08001213# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001214pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001215 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001216 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001217 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001218 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
1220}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001221# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001222pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001225 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001226 path: _visitor.fold_path(_i . path),
1227 }
1228}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001229# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001230pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001231 ExprRange {
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 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001234 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001235 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 }
1237}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001238# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +02001239pub fn fold_expr_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReference) -> ExprReference {
1240 ExprReference {
1241 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1242 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1243 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1244 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1245 }
1246}
1247# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001248pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001249 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001251 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001253 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001254 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001257# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001258pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001259 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001261 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001262 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001263 }
1264}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001265# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001266pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001267 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001268 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001269 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001270 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001271 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1272 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1273 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001274 }
1275}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001276# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001277pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001278 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001279 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001280 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001281 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001282 }
1283}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001284# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001285pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001286 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001287 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001288 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001289 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001290 }
1291}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001292# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001293pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001294 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001295 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001296 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001297 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001298 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001299 }
1300}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001301# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001302pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001303 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001305 op: _visitor.fold_un_op(_i . op),
1306 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1307 }
1308}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001309# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001310pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001311 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001312 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001313 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001314 block: _visitor.fold_block(_i . block),
1315 }
1316}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001317# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001318pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001319 ExprVerbatim {
1320 tts: _i . tts,
1321 }
1322}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001323# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001324pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001325 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001326 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001327 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001328 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001329 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1330 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001331 }
1332}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001333# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001334pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001335 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001336 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001337 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001338 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1339 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001340 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001341 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001342 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1343 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001344 }
1345}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001346# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001347pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001348 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001349 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001350 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001351 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001352 }
1353}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001354# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001355pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001356 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001357 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001358 vis: _visitor.fold_visibility(_i . vis),
1359 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001360 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001361 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001362 }
1363}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001364# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001365pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001366 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001367 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001368 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001369 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001370 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001371 }
1372}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001373# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001374pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001375 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001376 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1377 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001378 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001379 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001380 }
1381}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001382# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001383pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001384 match _i {
1385 Fields::Named(_binding_0, ) => {
1386 Fields::Named (
1387 _visitor.fold_fields_named(_binding_0),
1388 )
1389 }
1390 Fields::Unnamed(_binding_0, ) => {
1391 Fields::Unnamed (
1392 _visitor.fold_fields_unnamed(_binding_0),
1393 )
1394 }
1395 Fields::Unit => { Fields::Unit }
1396 }
1397}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001398# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001399pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001400 FieldsNamed {
1401 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001402 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001403 }
1404}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001405# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001406pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001407 FieldsUnnamed {
1408 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001409 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001410 }
1411}
Nika Layzell27726662017-10-24 23:16:35 -04001412# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001413pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001414 File {
1415 shebang: _i . shebang,
1416 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1417 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1418 }
1419}
1420# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001421pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001422 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001423 FnArg::SelfRef(_binding_0, ) => {
1424 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001425 _visitor.fold_arg_self_ref(_binding_0),
1426 )
1427 }
David Tolnay6702ade2017-12-30 23:38:15 -05001428 FnArg::SelfValue(_binding_0, ) => {
1429 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001430 _visitor.fold_arg_self(_binding_0),
1431 )
1432 }
David Tolnay6702ade2017-12-30 23:38:15 -05001433 FnArg::Captured(_binding_0, ) => {
1434 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001435 _visitor.fold_arg_captured(_binding_0),
1436 )
1437 }
David Tolnay6702ade2017-12-30 23:38:15 -05001438 FnArg::Inferred(_binding_0, ) => {
1439 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001440 _visitor.fold_pat(_binding_0),
1441 )
1442 }
David Tolnay6702ade2017-12-30 23:38:15 -05001443 FnArg::Ignored(_binding_0, ) => {
1444 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001445 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001446 )
1447 }
1448 }
1449}
1450# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001451pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001452 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001453 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001454 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001455 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001456 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001457 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001458 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001459 }
1460}
1461# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001462pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001463 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001464 ForeignItem::Fn(_binding_0, ) => {
1465 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001466 _visitor.fold_foreign_item_fn(_binding_0),
1467 )
1468 }
David Tolnay6702ade2017-12-30 23:38:15 -05001469 ForeignItem::Static(_binding_0, ) => {
1470 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001471 _visitor.fold_foreign_item_static(_binding_0),
1472 )
1473 }
David Tolnay6702ade2017-12-30 23:38:15 -05001474 ForeignItem::Type(_binding_0, ) => {
1475 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001476 _visitor.fold_foreign_item_type(_binding_0),
1477 )
1478 }
David Tolnay6702ade2017-12-30 23:38:15 -05001479 ForeignItem::Verbatim(_binding_0, ) => {
1480 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001481 _visitor.fold_foreign_item_verbatim(_binding_0),
1482 )
1483 }
Nika Layzell27726662017-10-24 23:16:35 -04001484 }
1485}
1486# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001487pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001488 ForeignItemFn {
1489 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1490 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001491 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001492 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001493 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001494 }
1495}
1496# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001497pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001498 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001499 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1500 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001501 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001502 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001503 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001505 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001506 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001507 }
1508}
David Tolnay199bcbb2017-11-12 10:33:52 -08001509# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001510pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001511 ForeignItemType {
1512 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1513 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001514 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001515 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001516 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001517 }
1518}
David Tolnay2ae520a2017-12-29 11:19:50 -05001519# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001520pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001521 ForeignItemVerbatim {
1522 tts: _i . tts,
1523 }
1524}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001525# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001526pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001527 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001528 GenericArgument::Lifetime(_binding_0, ) => {
1529 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001530 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001531 )
1532 }
David Tolnay6702ade2017-12-30 23:38:15 -05001533 GenericArgument::Type(_binding_0, ) => {
1534 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001535 _visitor.fold_type(_binding_0),
1536 )
1537 }
David Tolnay6702ade2017-12-30 23:38:15 -05001538 GenericArgument::Binding(_binding_0, ) => {
1539 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001540 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001541 )
1542 }
David Tolnay6702ade2017-12-30 23:38:15 -05001543 GenericArgument::Const(_binding_0, ) => {
1544 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001545 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001546 )
1547 }
Nika Layzell357885a2017-12-04 15:47:07 -05001548 }
1549}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001550# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001551pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001552 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001553 GenericMethodArgument::Type(_binding_0, ) => {
1554 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001555 _visitor.fold_type(_binding_0),
1556 )
1557 }
David Tolnay6702ade2017-12-30 23:38:15 -05001558 GenericMethodArgument::Const(_binding_0, ) => {
1559 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001560 _visitor.fold_expr(_binding_0),
1561 )
1562 }
1563 }
1564}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001565# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001566pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001567 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001568 GenericParam::Type(_binding_0, ) => {
1569 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001570 _visitor.fold_type_param(_binding_0),
1571 )
1572 }
David Tolnay517f3692018-01-01 20:17:23 -08001573 GenericParam::Lifetime(_binding_0, ) => {
1574 GenericParam::Lifetime (
1575 _visitor.fold_lifetime_def(_binding_0),
1576 )
1577 }
David Tolnay6702ade2017-12-30 23:38:15 -05001578 GenericParam::Const(_binding_0, ) => {
1579 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001580 _visitor.fold_const_param(_binding_0),
1581 )
1582 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001583 }
1584}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001585# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001586pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001587 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001588 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001589 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001590 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001591 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001592 }
1593}
1594# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001595pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001596 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001597 ImplItem::Const(_binding_0, ) => {
1598 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001599 _visitor.fold_impl_item_const(_binding_0),
1600 )
1601 }
David Tolnay6702ade2017-12-30 23:38:15 -05001602 ImplItem::Method(_binding_0, ) => {
1603 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001604 _visitor.fold_impl_item_method(_binding_0),
1605 )
1606 }
David Tolnay6702ade2017-12-30 23:38:15 -05001607 ImplItem::Type(_binding_0, ) => {
1608 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001609 _visitor.fold_impl_item_type(_binding_0),
1610 )
1611 }
David Tolnay6702ade2017-12-30 23:38:15 -05001612 ImplItem::Macro(_binding_0, ) => {
1613 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001614 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001615 )
1616 }
David Tolnay6702ade2017-12-30 23:38:15 -05001617 ImplItem::Verbatim(_binding_0, ) => {
1618 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001619 _visitor.fold_impl_item_verbatim(_binding_0),
1620 )
1621 }
Nika Layzell27726662017-10-24 23:16:35 -04001622 }
1623}
1624# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001625pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001626 ImplItemConst {
1627 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1628 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001629 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001630 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001631 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001632 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001633 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001634 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001635 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001636 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001637 }
1638}
1639# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001640pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001641 ImplItemMacro {
1642 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1643 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001644 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001645 }
1646}
1647# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001648pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001649 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001650 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001651 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001652 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001653 sig: _visitor.fold_method_sig(_i . sig),
1654 block: _visitor.fold_block(_i . block),
1655 }
1656}
1657# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001658pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001659 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001660 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001661 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001662 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001663 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001664 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001665 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001666 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001667 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001668 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001669 }
1670}
David Tolnay2ae520a2017-12-29 11:19:50 -05001671# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001672pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001673 ImplItemVerbatim {
1674 tts: _i . tts,
1675 }
1676}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001677# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001678pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001679 Index {
1680 index: _i . index,
1681 span: _visitor.fold_span(_i . span),
1682 }
1683}
1684# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001685pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001686 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001687 Item::ExternCrate(_binding_0, ) => {
1688 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001689 _visitor.fold_item_extern_crate(_binding_0),
1690 )
1691 }
David Tolnay6702ade2017-12-30 23:38:15 -05001692 Item::Use(_binding_0, ) => {
1693 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001694 _visitor.fold_item_use(_binding_0),
1695 )
1696 }
David Tolnay6702ade2017-12-30 23:38:15 -05001697 Item::Static(_binding_0, ) => {
1698 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001699 _visitor.fold_item_static(_binding_0),
1700 )
1701 }
David Tolnay6702ade2017-12-30 23:38:15 -05001702 Item::Const(_binding_0, ) => {
1703 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001704 _visitor.fold_item_const(_binding_0),
1705 )
1706 }
David Tolnay6702ade2017-12-30 23:38:15 -05001707 Item::Fn(_binding_0, ) => {
1708 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001709 _visitor.fold_item_fn(_binding_0),
1710 )
1711 }
David Tolnay6702ade2017-12-30 23:38:15 -05001712 Item::Mod(_binding_0, ) => {
1713 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001714 _visitor.fold_item_mod(_binding_0),
1715 )
1716 }
David Tolnay6702ade2017-12-30 23:38:15 -05001717 Item::ForeignMod(_binding_0, ) => {
1718 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001719 _visitor.fold_item_foreign_mod(_binding_0),
1720 )
1721 }
David Tolnay6702ade2017-12-30 23:38:15 -05001722 Item::Type(_binding_0, ) => {
1723 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001724 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001725 )
1726 }
David Tolnay6702ade2017-12-30 23:38:15 -05001727 Item::Struct(_binding_0, ) => {
1728 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001729 _visitor.fold_item_struct(_binding_0),
1730 )
1731 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001732 Item::Enum(_binding_0, ) => {
1733 Item::Enum (
1734 _visitor.fold_item_enum(_binding_0),
1735 )
1736 }
David Tolnay6702ade2017-12-30 23:38:15 -05001737 Item::Union(_binding_0, ) => {
1738 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001739 _visitor.fold_item_union(_binding_0),
1740 )
1741 }
David Tolnay6702ade2017-12-30 23:38:15 -05001742 Item::Trait(_binding_0, ) => {
1743 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001744 _visitor.fold_item_trait(_binding_0),
1745 )
1746 }
David Tolnay6702ade2017-12-30 23:38:15 -05001747 Item::Impl(_binding_0, ) => {
1748 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001749 _visitor.fold_item_impl(_binding_0),
1750 )
1751 }
David Tolnay6702ade2017-12-30 23:38:15 -05001752 Item::Macro(_binding_0, ) => {
1753 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001754 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001755 )
1756 }
David Tolnay6702ade2017-12-30 23:38:15 -05001757 Item::Macro2(_binding_0, ) => {
1758 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001759 _visitor.fold_item_macro2(_binding_0),
1760 )
1761 }
David Tolnay6702ade2017-12-30 23:38:15 -05001762 Item::Verbatim(_binding_0, ) => {
1763 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001764 _visitor.fold_item_verbatim(_binding_0),
1765 )
1766 }
Nika Layzell27726662017-10-24 23:16:35 -04001767 }
1768}
1769# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001770pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001771 ItemConst {
1772 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1773 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001774 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001775 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001776 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001777 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001779 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 }
1782}
1783# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001784pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 ItemEnum {
1786 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1787 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001788 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001789 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001790 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001791 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1793 }
1794}
1795# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001796pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001797 ItemExternCrate {
1798 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1799 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1801 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001802 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001803 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001804 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001805 _visitor.fold_ident(( it ) . 1),
1806 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001807 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 }
1809}
1810# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001811pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 ItemFn {
1813 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1814 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001815 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001816 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001817 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001818 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001819 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 block: Box::new(_visitor.fold_block(* _i . block)),
1821 }
1822}
1823# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001824pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 ItemForeignMod {
1826 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1827 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001828 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001829 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1830 }
1831}
1832# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001833pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001834 ItemImpl {
1835 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001836 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001837 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001839 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001840 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001841 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001842 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001843 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001844 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001845 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001846 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001847 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1848 }
1849}
1850# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001851pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001852 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001854 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001855 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001857 }
1858}
1859# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001860pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001861 ItemMacro2 {
1862 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1863 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001865 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001866 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001867 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001868 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001869 body: _i . body,
1870 }
1871}
1872# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001873pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001874 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001875 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001876 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001877 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001878 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001879 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001880 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001881 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1882 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
1885}
1886# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001887pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001888 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001892 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001893 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001894 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001895 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001896 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001897 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001898 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001899 }
1900}
1901# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001902pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001903 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001904 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001905 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001907 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001908 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001909 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001911 }
1912}
1913# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001914pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001915 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001916 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001917 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001918 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001919 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1920 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001921 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001922 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001923 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001924 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001925 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001926 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1927 }
1928}
1929# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001930pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001931 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001932 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001933 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001934 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001935 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001936 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001937 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001938 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001939 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001940 }
1941}
1942# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001943pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001944 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001945 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001946 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001947 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001948 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001949 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001950 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001951 }
1952}
1953# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001954pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001955 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001956 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001957 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001958 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1959 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001960 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1961 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001962 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001963 }
1964}
David Tolnay2ae520a2017-12-29 11:19:50 -05001965# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001966pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001967 ItemVerbatim {
1968 tts: _i . tts,
1969 }
1970}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001971# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001972pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001973 Label {
1974 name: _visitor.fold_lifetime(_i . name),
1975 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1976 }
1977}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001978# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001979pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001980 LifetimeDef {
1981 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001982 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001983 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001984 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1985 }
1986}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001987# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001988pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001989 match _i {
1990 Lit::Str(_binding_0, ) => {
1991 Lit::Str (
1992 _visitor.fold_lit_str(_binding_0),
1993 )
1994 }
1995 Lit::ByteStr(_binding_0, ) => {
1996 Lit::ByteStr (
1997 _visitor.fold_lit_byte_str(_binding_0),
1998 )
1999 }
2000 Lit::Byte(_binding_0, ) => {
2001 Lit::Byte (
2002 _visitor.fold_lit_byte(_binding_0),
2003 )
2004 }
2005 Lit::Char(_binding_0, ) => {
2006 Lit::Char (
2007 _visitor.fold_lit_char(_binding_0),
2008 )
2009 }
2010 Lit::Int(_binding_0, ) => {
2011 Lit::Int (
2012 _visitor.fold_lit_int(_binding_0),
2013 )
2014 }
2015 Lit::Float(_binding_0, ) => {
2016 Lit::Float (
2017 _visitor.fold_lit_float(_binding_0),
2018 )
2019 }
2020 Lit::Bool(_binding_0, ) => {
2021 Lit::Bool (
2022 _visitor.fold_lit_bool(_binding_0),
2023 )
2024 }
2025 Lit::Verbatim(_binding_0, ) => {
2026 Lit::Verbatim (
2027 _visitor.fold_lit_verbatim(_binding_0),
2028 )
2029 }
2030 }
2031}
2032# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002033pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002034 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002035 value: _i . value,
2036 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002037 }
2038}
David Tolnay360efd22018-01-04 23:35:26 -08002039# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002040pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002041 LitVerbatim {
2042 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002043 }
2044}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002045# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002046pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002047 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002048 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002049 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
2050 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05002051 ty: (_i . ty).map(|it| { (
2052 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2053 Box::new(_visitor.fold_type(* ( it ) . 1)),
2054 ) }),
2055 init: (_i . init).map(|it| { (
2056 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2057 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2058 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002059 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002060 }
2061}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002062# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002063pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002064 Macro {
2065 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002066 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002067 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2068 tts: _i . tts,
2069 }
2070}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002071# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002072pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002073 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002074 MacroDelimiter::Paren(_binding_0, ) => {
2075 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002076 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2077 )
2078 }
David Tolnay6702ade2017-12-30 23:38:15 -05002079 MacroDelimiter::Brace(_binding_0, ) => {
2080 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002081 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2082 )
2083 }
David Tolnay6702ade2017-12-30 23:38:15 -05002084 MacroDelimiter::Bracket(_binding_0, ) => {
2085 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002086 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2087 )
2088 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002089 }
2090}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002091# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002092pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002093 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002094 Member::Named(_binding_0, ) => {
2095 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05002096 _visitor.fold_ident(_binding_0),
2097 )
2098 }
David Tolnay6702ade2017-12-30 23:38:15 -05002099 Member::Unnamed(_binding_0, ) => {
2100 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002101 _visitor.fold_index(_binding_0),
2102 )
2103 }
2104 }
2105}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002106# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002107pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002108 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002109 Meta::Word(_binding_0, ) => {
2110 Meta::Word (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002111 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002112 )
2113 }
David Tolnayaaadd782018-01-06 22:58:13 -08002114 Meta::List(_binding_0, ) => {
2115 Meta::List (
2116 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002117 )
2118 }
David Tolnayaaadd782018-01-06 22:58:13 -08002119 Meta::NameValue(_binding_0, ) => {
2120 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002121 _visitor.fold_meta_name_value(_binding_0),
2122 )
2123 }
2124 }
2125}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002126# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002127pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2128 MetaList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002129 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002130 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002131 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002132 }
2133}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002134# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002135pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002136 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002137 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002138 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002139 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002140 }
2141}
2142# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002143pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002144 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002145 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002146 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002147 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002148 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002149 decl: _visitor.fold_fn_decl(_i . decl),
2150 }
2151}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002152# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002153pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002154 MethodTurbofish {
2155 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2156 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2157 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2158 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2159 }
2160}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002161# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002162pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002163 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002164 NestedMeta::Meta(_binding_0, ) => {
2165 NestedMeta::Meta (
2166 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002167 )
2168 }
David Tolnayaaadd782018-01-06 22:58:13 -08002169 NestedMeta::Literal(_binding_0, ) => {
2170 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002171 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002172 )
2173 }
2174 }
2175}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002176# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002177pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002178 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002179 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002180 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002181 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002182 }
2183}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002184# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002185pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002186 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002187 Pat::Wild(_binding_0, ) => {
2188 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002189 _visitor.fold_pat_wild(_binding_0),
2190 )
2191 }
David Tolnay6702ade2017-12-30 23:38:15 -05002192 Pat::Ident(_binding_0, ) => {
2193 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002194 _visitor.fold_pat_ident(_binding_0),
2195 )
2196 }
David Tolnay6702ade2017-12-30 23:38:15 -05002197 Pat::Struct(_binding_0, ) => {
2198 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002199 _visitor.fold_pat_struct(_binding_0),
2200 )
2201 }
David Tolnay6702ade2017-12-30 23:38:15 -05002202 Pat::TupleStruct(_binding_0, ) => {
2203 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002204 _visitor.fold_pat_tuple_struct(_binding_0),
2205 )
2206 }
David Tolnay6702ade2017-12-30 23:38:15 -05002207 Pat::Path(_binding_0, ) => {
2208 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002209 _visitor.fold_pat_path(_binding_0),
2210 )
2211 }
David Tolnay6702ade2017-12-30 23:38:15 -05002212 Pat::Tuple(_binding_0, ) => {
2213 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002214 _visitor.fold_pat_tuple(_binding_0),
2215 )
2216 }
David Tolnay6702ade2017-12-30 23:38:15 -05002217 Pat::Box(_binding_0, ) => {
2218 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002219 _visitor.fold_pat_box(_binding_0),
2220 )
2221 }
David Tolnay6702ade2017-12-30 23:38:15 -05002222 Pat::Ref(_binding_0, ) => {
2223 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002224 _visitor.fold_pat_ref(_binding_0),
2225 )
2226 }
David Tolnay6702ade2017-12-30 23:38:15 -05002227 Pat::Lit(_binding_0, ) => {
2228 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002229 _visitor.fold_pat_lit(_binding_0),
2230 )
2231 }
David Tolnay6702ade2017-12-30 23:38:15 -05002232 Pat::Range(_binding_0, ) => {
2233 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002234 _visitor.fold_pat_range(_binding_0),
2235 )
2236 }
David Tolnay6702ade2017-12-30 23:38:15 -05002237 Pat::Slice(_binding_0, ) => {
2238 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002239 _visitor.fold_pat_slice(_binding_0),
2240 )
2241 }
David Tolnay6702ade2017-12-30 23:38:15 -05002242 Pat::Macro(_binding_0, ) => {
2243 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002244 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002245 )
2246 }
David Tolnay6702ade2017-12-30 23:38:15 -05002247 Pat::Verbatim(_binding_0, ) => {
2248 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002249 _visitor.fold_pat_verbatim(_binding_0),
2250 )
2251 }
Nika Layzell27726662017-10-24 23:16:35 -04002252 }
2253}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002254# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002255pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002256 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002257 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002258 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002259 }
2260}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002261# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002262pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002263 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002264 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2265 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002266 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002267 subpat: (_i . subpat).map(|it| { (
2268 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2269 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2270 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002271 }
2272}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002273# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002274pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002275 PatLit {
2276 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2277 }
2278}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002279# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002280pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002281 PatMacro {
2282 mac: _visitor.fold_macro(_i . mac),
2283 }
2284}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002285# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002286pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002287 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002288 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002289 path: _visitor.fold_path(_i . path),
2290 }
2291}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002292# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002293pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002294 PatRange {
2295 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002296 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002297 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002298 }
2299}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002300# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002301pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002302 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002303 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002304 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002305 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002306 }
2307}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002308# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002309pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002310 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002311 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002312 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002313 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002314 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002315 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002316 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002317 }
2318}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002319# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002320pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002321 PatStruct {
2322 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002323 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002324 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002326 }
2327}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002328# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002329pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002330 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002331 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002332 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002333 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002334 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2335 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002336 }
2337}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002338# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002339pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002340 PatTupleStruct {
2341 path: _visitor.fold_path(_i . path),
2342 pat: _visitor.fold_pat_tuple(_i . pat),
2343 }
2344}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002345# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002346pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002347 PatVerbatim {
2348 tts: _i . tts,
2349 }
2350}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002351# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002352pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002353 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002354 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002355 }
2356}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002357# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002358pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002359 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002360 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002361 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2362 }
2363}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002364# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002365pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002366 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002367 PathArguments::None => { PathArguments::None }
2368 PathArguments::AngleBracketed(_binding_0, ) => {
2369 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002370 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2371 )
2372 }
David Tolnay6702ade2017-12-30 23:38:15 -05002373 PathArguments::Parenthesized(_binding_0, ) => {
2374 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002375 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2376 )
2377 }
2378 }
2379}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002380# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002381pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002382 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002383 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002384 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002385 }
2386}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002387# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002388pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002389 PredicateEq {
2390 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2391 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2392 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2393 }
2394}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002395# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002396pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002397 PredicateLifetime {
2398 lifetime: _visitor.fold_lifetime(_i . lifetime),
2399 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2400 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2401 }
2402}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002403# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002404pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002405 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002406 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002407 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2408 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2409 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2410 }
2411}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002412# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002413pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002414 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002415 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002416 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002417 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002418 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2419 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002420 }
2421}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002422# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002423pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002424 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002425 RangeLimits::HalfOpen(_binding_0, ) => {
2426 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002428 )
2429 }
David Tolnay6702ade2017-12-30 23:38:15 -05002430 RangeLimits::Closed(_binding_0, ) => {
2431 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002432 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002433 )
2434 }
2435 }
2436}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002437# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002438pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002439 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002440 ReturnType::Default => { ReturnType::Default }
2441 ReturnType::Type(_binding_0, _binding_1, ) => {
2442 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002443 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2444 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002445 )
2446 }
2447 }
2448}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002449
David Tolnay4b4c4b62018-01-06 13:48:05 -08002450pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002451 _i
2452}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002453# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002454pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002455 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002456 Stmt::Local(_binding_0, ) => {
2457 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002458 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002459 )
2460 }
David Tolnay6702ade2017-12-30 23:38:15 -05002461 Stmt::Item(_binding_0, ) => {
2462 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002463 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002464 )
2465 }
David Tolnay6702ade2017-12-30 23:38:15 -05002466 Stmt::Expr(_binding_0, ) => {
2467 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002468 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002469 )
2470 }
David Tolnay6702ade2017-12-30 23:38:15 -05002471 Stmt::Semi(_binding_0, _binding_1, ) => {
2472 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002473 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002474 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002475 )
2476 }
Nika Layzell27726662017-10-24 23:16:35 -04002477 }
2478}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002479# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002480pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002481 TraitBound {
2482 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2483 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2484 path: _visitor.fold_path(_i . path),
2485 }
2486}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002487# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002488pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002489 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002490 TraitBoundModifier::None => { TraitBoundModifier::None }
2491 TraitBoundModifier::Maybe(_binding_0, ) => {
2492 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002493 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002494 )
2495 }
2496 }
2497}
2498# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002499pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002500 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002501 TraitItem::Const(_binding_0, ) => {
2502 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002503 _visitor.fold_trait_item_const(_binding_0),
2504 )
2505 }
David Tolnay6702ade2017-12-30 23:38:15 -05002506 TraitItem::Method(_binding_0, ) => {
2507 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002508 _visitor.fold_trait_item_method(_binding_0),
2509 )
2510 }
David Tolnay6702ade2017-12-30 23:38:15 -05002511 TraitItem::Type(_binding_0, ) => {
2512 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002513 _visitor.fold_trait_item_type(_binding_0),
2514 )
2515 }
David Tolnay6702ade2017-12-30 23:38:15 -05002516 TraitItem::Macro(_binding_0, ) => {
2517 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002518 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002519 )
2520 }
David Tolnay6702ade2017-12-30 23:38:15 -05002521 TraitItem::Verbatim(_binding_0, ) => {
2522 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002523 _visitor.fold_trait_item_verbatim(_binding_0),
2524 )
2525 }
Nika Layzell27726662017-10-24 23:16:35 -04002526 }
2527}
2528# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002529pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002530 TraitItemConst {
2531 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002532 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002533 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002534 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002536 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002537 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002538 _visitor.fold_expr(( it ) . 1),
2539 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002540 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002541 }
2542}
2543# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002544pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002545 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002546 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002547 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002548 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002549 }
2550}
2551# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002552pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002553 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002554 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002555 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002556 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002557 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002558 }
2559}
2560# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002561pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002562 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002563 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002564 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002565 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002566 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002567 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002569 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002570 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002571 _visitor.fold_type(( it ) . 1),
2572 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002573 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002574 }
2575}
David Tolnay2ae520a2017-12-29 11:19:50 -05002576# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002577pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002578 TraitItemVerbatim {
2579 tts: _i . tts,
2580 }
2581}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002582# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002583pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002584 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002585 Type::Slice(_binding_0, ) => {
2586 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002587 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002588 )
2589 }
David Tolnay6702ade2017-12-30 23:38:15 -05002590 Type::Array(_binding_0, ) => {
2591 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002592 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002593 )
2594 }
David Tolnay6702ade2017-12-30 23:38:15 -05002595 Type::Ptr(_binding_0, ) => {
2596 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002598 )
2599 }
David Tolnay6702ade2017-12-30 23:38:15 -05002600 Type::Reference(_binding_0, ) => {
2601 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002602 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002603 )
2604 }
David Tolnay6702ade2017-12-30 23:38:15 -05002605 Type::BareFn(_binding_0, ) => {
2606 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002607 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002608 )
2609 }
David Tolnay6702ade2017-12-30 23:38:15 -05002610 Type::Never(_binding_0, ) => {
2611 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002612 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002613 )
2614 }
David Tolnay6702ade2017-12-30 23:38:15 -05002615 Type::Tuple(_binding_0, ) => {
2616 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002617 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002618 )
2619 }
David Tolnay6702ade2017-12-30 23:38:15 -05002620 Type::Path(_binding_0, ) => {
2621 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002623 )
2624 }
David Tolnay6702ade2017-12-30 23:38:15 -05002625 Type::TraitObject(_binding_0, ) => {
2626 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002627 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002628 )
2629 }
David Tolnay6702ade2017-12-30 23:38:15 -05002630 Type::ImplTrait(_binding_0, ) => {
2631 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002632 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002633 )
2634 }
David Tolnay6702ade2017-12-30 23:38:15 -05002635 Type::Paren(_binding_0, ) => {
2636 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002638 )
2639 }
David Tolnay6702ade2017-12-30 23:38:15 -05002640 Type::Group(_binding_0, ) => {
2641 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002642 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002643 )
2644 }
David Tolnay6702ade2017-12-30 23:38:15 -05002645 Type::Infer(_binding_0, ) => {
2646 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002647 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002648 )
2649 }
David Tolnay6702ade2017-12-30 23:38:15 -05002650 Type::Macro(_binding_0, ) => {
2651 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002652 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002653 )
2654 }
David Tolnay6702ade2017-12-30 23:38:15 -05002655 Type::Verbatim(_binding_0, ) => {
2656 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002657 _visitor.fold_type_verbatim(_binding_0),
2658 )
2659 }
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
2661}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002662# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002663pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002664 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002665 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002666 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002667 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002668 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002669 }
2670}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002671# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002672pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002673 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002674 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2675 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2676 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2677 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2678 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2679 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2680 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2681 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002682 }
2683}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002684# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002685pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002686 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002687 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002688 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002689 }
2690}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002691# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002692pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002693 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002694 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002695 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002696 }
2697}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002698# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002699pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002700 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002701 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002702 }
2703}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002704# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002705pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002706 TypeMacro {
2707 mac: _visitor.fold_macro(_i . mac),
2708 }
2709}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002710# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002711pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002712 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002713 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002714 }
2715}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002716# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002717pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002718 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002719 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002720 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002721 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002722 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002723 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002724 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002725 }
2726}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002727# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002728pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002729 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002730 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002731 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002732 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002733 )
2734 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002735 TypeParamBound::Lifetime(_binding_0, ) => {
2736 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002737 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002738 )
2739 }
2740 }
2741}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002742# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002743pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002744 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002745 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002746 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002747 }
2748}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002749# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002750pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002751 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002752 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002753 path: _visitor.fold_path(_i . path),
2754 }
2755}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002756# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002757pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002758 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002759 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2760 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002761 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2762 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002763 }
2764}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002765# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002766pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002767 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002768 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002769 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002770 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2771 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002772 }
2773}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002774# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002775pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002776 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002777 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002778 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002779 }
2780}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002781# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002782pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002783 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002784 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002785 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002786 }
2787}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002788# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002789pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002790 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002791 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002792 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002793 }
2794}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002795# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002796pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002797 TypeVerbatim {
2798 tts: _i . tts,
2799 }
2800}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002801# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002802pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002803 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002804 UnOp::Deref(_binding_0, ) => {
2805 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002806 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002807 )
2808 }
David Tolnay6702ade2017-12-30 23:38:15 -05002809 UnOp::Not(_binding_0, ) => {
2810 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002811 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002812 )
2813 }
David Tolnay6702ade2017-12-30 23:38:15 -05002814 UnOp::Neg(_binding_0, ) => {
2815 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002816 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002817 )
2818 }
2819 }
2820}
David Tolnay5f332a92017-12-26 00:42:45 -05002821# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002822pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002823 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002824 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002825 }
2826}
2827# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002828pub fn fold_use_list<V: Fold + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
David Tolnay5f332a92017-12-26 00:42:45 -05002829 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002830 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002831 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2832 }
2833}
2834# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002835pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002836 UsePath {
2837 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002838 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002839 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002840 _visitor.fold_ident(( it ) . 1),
2841 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002842 }
2843}
2844# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002845pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002846 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002847 UseTree::Path(_binding_0, ) => {
2848 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002849 _visitor.fold_use_path(_binding_0),
2850 )
2851 }
David Tolnay6702ade2017-12-30 23:38:15 -05002852 UseTree::Glob(_binding_0, ) => {
2853 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002854 _visitor.fold_use_glob(_binding_0),
2855 )
2856 }
David Tolnay6702ade2017-12-30 23:38:15 -05002857 UseTree::List(_binding_0, ) => {
2858 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002859 _visitor.fold_use_list(_binding_0),
2860 )
2861 }
2862 }
2863}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002864# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002865pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002866 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002867 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002868 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002869 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002870 discriminant: (_i . discriminant).map(|it| { (
2871 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2872 _visitor.fold_expr(( it ) . 1),
2873 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002874 }
2875}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002876# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002877pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002878 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002879 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002880 }
2881}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002882# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002883pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002884 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002885 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002886 }
2887}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002888# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002889pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002890 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002891 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002892 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002893 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002894 path: Box::new(_visitor.fold_path(* _i . path)),
2895 }
2896}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002897# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002898pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002899 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002900 Visibility::Public(_binding_0, ) => {
2901 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002902 _visitor.fold_vis_public(_binding_0),
2903 )
2904 }
David Tolnay6702ade2017-12-30 23:38:15 -05002905 Visibility::Crate(_binding_0, ) => {
2906 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002907 _visitor.fold_vis_crate(_binding_0),
2908 )
2909 }
David Tolnay6702ade2017-12-30 23:38:15 -05002910 Visibility::Restricted(_binding_0, ) => {
2911 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002912 _visitor.fold_vis_restricted(_binding_0),
2913 )
2914 }
David Tolnay6702ade2017-12-30 23:38:15 -05002915 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002916 }
2917}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002918# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002919pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002920 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002921 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002922 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2923 }
2924}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002925# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002926pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002927 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002928 WherePredicate::Type(_binding_0, ) => {
2929 WherePredicate::Type (
2930 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002931 )
2932 }
David Tolnayd4add852018-01-01 20:13:24 -08002933 WherePredicate::Lifetime(_binding_0, ) => {
2934 WherePredicate::Lifetime (
2935 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002936 )
2937 }
David Tolnayd4add852018-01-01 20:13:24 -08002938 WherePredicate::Eq(_binding_0, ) => {
2939 WherePredicate::Eq (
2940 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002941 )
2942 }
2943 }
2944}
2945