blob: 236acc378bab88e75f2a63261d48c4ee7ed5b122 [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 Tolnaye303b7c2018-05-20 16:46:35 -070012use 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) }
Alex Crichtond261d092018-05-18 13:47:35 -0700194
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" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200397fn fold_use_group(&mut self, i: UseGroup) -> UseGroup { fold_use_group(self, i) }
398# [ cfg ( feature = "full" ) ]
399fn fold_use_name(&mut self, i: UseName) -> UseName { fold_use_name(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500400# [ cfg ( feature = "full" ) ]
401fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
402# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200403fn fold_use_rename(&mut self, i: UseRename) -> UseRename { fold_use_rename(self, i) }
404# [ cfg ( feature = "full" ) ]
David Tolnay5f332a92017-12-26 00:42:45 -0500405fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(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_variant(&mut self, i: Variant) -> Variant { fold_variant(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_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(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_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(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_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(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_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800416# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400417fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800418# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400419fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400420
Nika Layzell27726662017-10-24 23:16:35 -0400421}
422
David Tolnayd3f32142018-05-20 20:21:12 -0700423#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay360efd22018-01-04 23:35:26 -0800424macro_rules! fold_span_only {
425 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800426 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
Alex Crichton9a4dca22018-03-28 06:32:19 -0700427 let span = _visitor.fold_span(_i.span());
428 _i.set_span(span);
David Tolnay360efd22018-01-04 23:35:26 -0800429 _i
430 }
431 }
David Tolnayd0adf522017-12-29 01:30:07 -0500432}
433
David Tolnay360efd22018-01-04 23:35:26 -0800434#[cfg(any(feature = "full", feature = "derive"))]
435fold_span_only!(fold_lit_byte: LitByte);
436#[cfg(any(feature = "full", feature = "derive"))]
437fold_span_only!(fold_lit_byte_str: LitByteStr);
438#[cfg(any(feature = "full", feature = "derive"))]
439fold_span_only!(fold_lit_char: LitChar);
440#[cfg(any(feature = "full", feature = "derive"))]
441fold_span_only!(fold_lit_float: LitFloat);
442#[cfg(any(feature = "full", feature = "derive"))]
443fold_span_only!(fold_lit_int: LitInt);
444#[cfg(any(feature = "full", feature = "derive"))]
445fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500446
David Tolnay3cfd1d32018-01-03 00:22:08 -0800447# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800448pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400449 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500450 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayc2749802018-01-06 23:40:41 -0800451 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400452 }
453}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800454# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800455pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500456 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500457 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500459 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800464pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400465 ArgCaptured {
466 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500467 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800468 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400469 }
470}
471# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800472pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400473 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500474 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500475 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400476 }
477}
478# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800479pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400480 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500481 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500482 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500483 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500484 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400485 }
486}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800487# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800488pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400489 Arm {
490 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay18cc4d42018-03-31 18:47:20 +0200491 leading_vert: (_i . leading_vert).map(|it| { Token ! [ | ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400492 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500493 guard: (_i . guard).map(|it| { (
494 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
495 Box::new(_visitor.fold_expr(* ( it ) . 1)),
496 ) }),
David Tolnaydfb91432018-03-31 19:19:44 +0200497 fat_arrow_token: Token ! [ => ](tokens_helper(_visitor, &(_i . fat_arrow_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400498 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500499 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400500 }
501}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800502# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800503pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400504 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500505 AttrStyle::Outer => { AttrStyle::Outer }
506 AttrStyle::Inner(_binding_0, ) => {
507 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500508 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400509 )
510 }
511 }
512}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800513# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800514pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400515 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500516 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500517 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500518 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400519 path: _visitor.fold_path(_i . path),
520 tts: _i . tts,
521 is_sugared_doc: _i . is_sugared_doc,
522 }
523}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800524# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800525pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400526 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500527 name: (_i . name).map(|it| { (
528 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500530 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800531 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400532 }
533}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800534# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800535pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400536 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500537 BareFnArgName::Named(_binding_0, ) => {
538 BareFnArgName::Named (
Alex Crichtond261d092018-05-18 13:47:35 -0700539 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
David Tolnay6702ade2017-12-30 23:38:15 -0500542 BareFnArgName::Wild(_binding_0, ) => {
543 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
547 }
548}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800549# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800550pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400551 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500552 BinOp::Add(_binding_0, ) => {
553 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
David Tolnay6702ade2017-12-30 23:38:15 -0500557 BinOp::Sub(_binding_0, ) => {
558 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
David Tolnay6702ade2017-12-30 23:38:15 -0500562 BinOp::Mul(_binding_0, ) => {
563 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
David Tolnay6702ade2017-12-30 23:38:15 -0500567 BinOp::Div(_binding_0, ) => {
568 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
David Tolnay6702ade2017-12-30 23:38:15 -0500572 BinOp::Rem(_binding_0, ) => {
573 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
David Tolnay6702ade2017-12-30 23:38:15 -0500577 BinOp::And(_binding_0, ) => {
578 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
David Tolnay6702ade2017-12-30 23:38:15 -0500582 BinOp::Or(_binding_0, ) => {
583 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
David Tolnay6702ade2017-12-30 23:38:15 -0500587 BinOp::BitXor(_binding_0, ) => {
588 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
David Tolnay6702ade2017-12-30 23:38:15 -0500592 BinOp::BitAnd(_binding_0, ) => {
593 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
David Tolnay6702ade2017-12-30 23:38:15 -0500597 BinOp::BitOr(_binding_0, ) => {
598 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
David Tolnay6702ade2017-12-30 23:38:15 -0500602 BinOp::Shl(_binding_0, ) => {
603 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
David Tolnay6702ade2017-12-30 23:38:15 -0500607 BinOp::Shr(_binding_0, ) => {
608 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
David Tolnay6702ade2017-12-30 23:38:15 -0500612 BinOp::Eq(_binding_0, ) => {
613 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
David Tolnay6702ade2017-12-30 23:38:15 -0500617 BinOp::Lt(_binding_0, ) => {
618 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
David Tolnay6702ade2017-12-30 23:38:15 -0500622 BinOp::Le(_binding_0, ) => {
623 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
David Tolnay6702ade2017-12-30 23:38:15 -0500627 BinOp::Ne(_binding_0, ) => {
628 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
David Tolnay6702ade2017-12-30 23:38:15 -0500632 BinOp::Ge(_binding_0, ) => {
633 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
David Tolnay6702ade2017-12-30 23:38:15 -0500637 BinOp::Gt(_binding_0, ) => {
638 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
David Tolnay6702ade2017-12-30 23:38:15 -0500642 BinOp::AddEq(_binding_0, ) => {
643 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
David Tolnay6702ade2017-12-30 23:38:15 -0500647 BinOp::SubEq(_binding_0, ) => {
648 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
David Tolnay6702ade2017-12-30 23:38:15 -0500652 BinOp::MulEq(_binding_0, ) => {
653 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500654 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400655 )
656 }
David Tolnay6702ade2017-12-30 23:38:15 -0500657 BinOp::DivEq(_binding_0, ) => {
658 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500659 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400660 )
661 }
David Tolnay6702ade2017-12-30 23:38:15 -0500662 BinOp::RemEq(_binding_0, ) => {
663 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500664 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400665 )
666 }
David Tolnay6702ade2017-12-30 23:38:15 -0500667 BinOp::BitXorEq(_binding_0, ) => {
668 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500669 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400670 )
671 }
David Tolnay6702ade2017-12-30 23:38:15 -0500672 BinOp::BitAndEq(_binding_0, ) => {
673 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500674 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400675 )
676 }
David Tolnay6702ade2017-12-30 23:38:15 -0500677 BinOp::BitOrEq(_binding_0, ) => {
678 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500679 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400680 )
681 }
David Tolnay6702ade2017-12-30 23:38:15 -0500682 BinOp::ShlEq(_binding_0, ) => {
683 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500684 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400685 )
686 }
David Tolnay6702ade2017-12-30 23:38:15 -0500687 BinOp::ShrEq(_binding_0, ) => {
688 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500689 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400690 )
691 }
692 }
693}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800694# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800695pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500696 Binding {
Alex Crichtond261d092018-05-18 13:47:35 -0700697 ident: _visitor.fold_ident(_i . ident),
David Tolnay506e43a2017-12-29 11:34:36 -0500698 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
699 ty: _visitor.fold_type(_i . ty),
700 }
701}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800702# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800703pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400704 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500705 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400706 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
707 }
708}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800709# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800710pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400711 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500712 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
713 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400714 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500715 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400716 }
717}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800718# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800719pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500720 ConstParam {
721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -0700723 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500724 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500725 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500726 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500727 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
728 }
729}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800730# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800731pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500732 match _i {
733 Data::Struct(_binding_0, ) => {
734 Data::Struct (
735 _visitor.fold_data_struct(_binding_0),
736 )
737 }
738 Data::Enum(_binding_0, ) => {
739 Data::Enum (
740 _visitor.fold_data_enum(_binding_0),
741 )
742 }
743 Data::Union(_binding_0, ) => {
744 Data::Union (
745 _visitor.fold_data_union(_binding_0),
746 )
747 }
748 }
749}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800750# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800751pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500752 DataEnum {
753 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
754 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
755 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
756 }
757}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800758# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800759pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500760 DataStruct {
761 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
762 fields: _visitor.fold_fields(_i . fields),
763 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
764 }
765}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800766# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800767pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500768 DataUnion {
769 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
770 fields: _visitor.fold_fields_named(_i . fields),
771 }
772}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800773# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800774pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400775 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500777 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -0700778 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400779 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500780 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400781 }
782}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800783# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800784pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400785 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500786 Expr::Box(_binding_0, ) => {
787 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400788 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400789 )
790 }
David Tolnay6702ade2017-12-30 23:38:15 -0500791 Expr::InPlace(_binding_0, ) => {
792 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400793 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400794 )
795 }
David Tolnay6702ade2017-12-30 23:38:15 -0500796 Expr::Array(_binding_0, ) => {
797 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400798 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400799 )
800 }
David Tolnay6702ade2017-12-30 23:38:15 -0500801 Expr::Call(_binding_0, ) => {
802 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400803 _visitor.fold_expr_call(_binding_0),
804 )
805 }
David Tolnay6702ade2017-12-30 23:38:15 -0500806 Expr::MethodCall(_binding_0, ) => {
807 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400808 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400809 )
810 }
David Tolnay6702ade2017-12-30 23:38:15 -0500811 Expr::Tuple(_binding_0, ) => {
812 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500813 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400814 )
815 }
David Tolnay6702ade2017-12-30 23:38:15 -0500816 Expr::Binary(_binding_0, ) => {
817 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400818 _visitor.fold_expr_binary(_binding_0),
819 )
820 }
David Tolnay6702ade2017-12-30 23:38:15 -0500821 Expr::Unary(_binding_0, ) => {
822 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400823 _visitor.fold_expr_unary(_binding_0),
824 )
825 }
David Tolnay6702ade2017-12-30 23:38:15 -0500826 Expr::Lit(_binding_0, ) => {
827 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500828 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400829 )
830 }
David Tolnay6702ade2017-12-30 23:38:15 -0500831 Expr::Cast(_binding_0, ) => {
832 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400833 _visitor.fold_expr_cast(_binding_0),
834 )
835 }
David Tolnay6702ade2017-12-30 23:38:15 -0500836 Expr::Type(_binding_0, ) => {
837 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500838 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400839 )
840 }
David Tolnay6702ade2017-12-30 23:38:15 -0500841 Expr::If(_binding_0, ) => {
842 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400843 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400844 )
845 }
David Tolnay6702ade2017-12-30 23:38:15 -0500846 Expr::IfLet(_binding_0, ) => {
847 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400848 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400849 )
850 }
David Tolnay6702ade2017-12-30 23:38:15 -0500851 Expr::While(_binding_0, ) => {
852 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400853 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400854 )
855 }
David Tolnay6702ade2017-12-30 23:38:15 -0500856 Expr::WhileLet(_binding_0, ) => {
857 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400858 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400859 )
860 }
David Tolnay6702ade2017-12-30 23:38:15 -0500861 Expr::ForLoop(_binding_0, ) => {
862 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400863 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400864 )
865 }
David Tolnay6702ade2017-12-30 23:38:15 -0500866 Expr::Loop(_binding_0, ) => {
867 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400868 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400869 )
870 }
David Tolnay6702ade2017-12-30 23:38:15 -0500871 Expr::Match(_binding_0, ) => {
872 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400873 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400874 )
875 }
David Tolnay6702ade2017-12-30 23:38:15 -0500876 Expr::Closure(_binding_0, ) => {
877 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400878 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400879 )
880 }
David Tolnay6702ade2017-12-30 23:38:15 -0500881 Expr::Unsafe(_binding_0, ) => {
882 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500883 full!(_visitor.fold_expr_unsafe(_binding_0)),
884 )
885 }
David Tolnay6702ade2017-12-30 23:38:15 -0500886 Expr::Block(_binding_0, ) => {
887 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400888 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400889 )
890 }
David Tolnay6702ade2017-12-30 23:38:15 -0500891 Expr::Assign(_binding_0, ) => {
892 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400893 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400894 )
895 }
David Tolnay6702ade2017-12-30 23:38:15 -0500896 Expr::AssignOp(_binding_0, ) => {
897 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400898 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400899 )
900 }
David Tolnay6702ade2017-12-30 23:38:15 -0500901 Expr::Field(_binding_0, ) => {
902 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400903 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400904 )
905 }
David Tolnay6702ade2017-12-30 23:38:15 -0500906 Expr::Index(_binding_0, ) => {
907 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400908 _visitor.fold_expr_index(_binding_0),
909 )
910 }
David Tolnay6702ade2017-12-30 23:38:15 -0500911 Expr::Range(_binding_0, ) => {
912 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400913 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400914 )
915 }
David Tolnay6702ade2017-12-30 23:38:15 -0500916 Expr::Path(_binding_0, ) => {
917 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400918 _visitor.fold_expr_path(_binding_0),
919 )
920 }
David Tolnay00674ba2018-03-31 18:14:11 +0200921 Expr::Reference(_binding_0, ) => {
922 Expr::Reference (
923 full!(_visitor.fold_expr_reference(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400924 )
925 }
David Tolnay6702ade2017-12-30 23:38:15 -0500926 Expr::Break(_binding_0, ) => {
927 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400928 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400929 )
930 }
David Tolnay6702ade2017-12-30 23:38:15 -0500931 Expr::Continue(_binding_0, ) => {
932 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400933 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400934 )
935 }
David Tolnay6702ade2017-12-30 23:38:15 -0500936 Expr::Return(_binding_0, ) => {
937 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500938 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400939 )
940 }
David Tolnay6702ade2017-12-30 23:38:15 -0500941 Expr::Macro(_binding_0, ) => {
942 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500943 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400944 )
945 }
David Tolnay6702ade2017-12-30 23:38:15 -0500946 Expr::Struct(_binding_0, ) => {
947 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400948 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400949 )
950 }
David Tolnay6702ade2017-12-30 23:38:15 -0500951 Expr::Repeat(_binding_0, ) => {
952 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400953 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400954 )
955 }
David Tolnay6702ade2017-12-30 23:38:15 -0500956 Expr::Paren(_binding_0, ) => {
957 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800958 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400959 )
960 }
David Tolnay6702ade2017-12-30 23:38:15 -0500961 Expr::Group(_binding_0, ) => {
962 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500963 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400964 )
965 }
David Tolnay6702ade2017-12-30 23:38:15 -0500966 Expr::Try(_binding_0, ) => {
967 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400968 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400969 )
970 }
David Tolnay6702ade2017-12-30 23:38:15 -0500971 Expr::Catch(_binding_0, ) => {
972 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400973 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400974 )
975 }
David Tolnay6702ade2017-12-30 23:38:15 -0500976 Expr::Yield(_binding_0, ) => {
977 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400978 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400979 )
980 }
David Tolnay6702ade2017-12-30 23:38:15 -0500981 Expr::Verbatim(_binding_0, ) => {
982 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500983 _visitor.fold_expr_verbatim(_binding_0),
984 )
985 }
Nika Layzell27726662017-10-24 23:16:35 -0400986 }
987}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800988# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800989pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500990 ExprArray {
991 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
992 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500993 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500994 }
995}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800996# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800997pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -0500998 ExprAssign {
999 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1000 left: Box::new(_visitor.fold_expr(* _i . left)),
1001 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1002 right: Box::new(_visitor.fold_expr(* _i . right)),
1003 }
1004}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001005# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001006pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001007 ExprAssignOp {
1008 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1009 left: Box::new(_visitor.fold_expr(* _i . left)),
1010 op: _visitor.fold_bin_op(_i . op),
1011 right: Box::new(_visitor.fold_expr(* _i . right)),
1012 }
1013}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001014# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001015pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001016 ExprBinary {
1017 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1018 left: Box::new(_visitor.fold_expr(* _i . left)),
1019 op: _visitor.fold_bin_op(_i . op),
1020 right: Box::new(_visitor.fold_expr(* _i . right)),
1021 }
1022}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001023# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001024pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001025 ExprBlock {
1026 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1027 block: _visitor.fold_block(_i . block),
1028 }
1029}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001030# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001031pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001032 ExprBox {
1033 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1034 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1035 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1036 }
1037}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001038# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001039pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001040 ExprBreak {
1041 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1042 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1043 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1044 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1045 }
1046}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001047# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001048pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001049 ExprCall {
1050 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1051 func: Box::new(_visitor.fold_expr(* _i . func)),
1052 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1053 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1054 }
1055}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001056# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001057pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001058 ExprCast {
1059 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1060 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1061 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1062 ty: Box::new(_visitor.fold_type(* _i . ty)),
1063 }
1064}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001065# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001066pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001067 ExprCatch {
1068 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1069 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1070 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1071 block: _visitor.fold_block(_i . block),
1072 }
1073}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001074# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001075pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001076 ExprClosure {
1077 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay13d4c0e2018-03-31 20:53:59 +02001078 movability: (_i . movability).map(|it| { Token ! [ static ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001079 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001080 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1081 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1082 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1083 output: _visitor.fold_return_type(_i . output),
1084 body: Box::new(_visitor.fold_expr(* _i . body)),
1085 }
1086}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001087# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001088pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001089 ExprContinue {
1090 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1091 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1092 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1093 }
1094}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001095# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001096pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001097 ExprField {
1098 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1099 base: Box::new(_visitor.fold_expr(* _i . base)),
1100 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1101 member: _visitor.fold_member(_i . member),
1102 }
1103}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001104# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001105pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001106 ExprForLoop {
1107 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001108 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001109 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1110 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1111 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1112 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1113 body: _visitor.fold_block(_i . body),
1114 }
1115}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001116# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001117pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001118 ExprGroup {
1119 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1120 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1121 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1122 }
1123}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001124# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001125pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001126 ExprIf {
1127 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1128 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1129 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001130 then_branch: _visitor.fold_block(_i . then_branch),
1131 else_branch: (_i . else_branch).map(|it| { (
1132 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1133 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1134 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001135 }
1136}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001137# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001138pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001139 ExprIfLet {
1140 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1141 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1142 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001143 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001144 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1145 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001146 then_branch: _visitor.fold_block(_i . then_branch),
1147 else_branch: (_i . else_branch).map(|it| { (
1148 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1149 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1150 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001151 }
1152}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001153# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001154pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001155 ExprInPlace {
1156 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1157 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001158 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001159 value: Box::new(_visitor.fold_expr(* _i . value)),
1160 }
1161}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001162# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001163pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001164 ExprIndex {
1165 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1166 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1167 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1168 index: Box::new(_visitor.fold_expr(* _i . index)),
1169 }
1170}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001171# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001172pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001173 ExprLit {
1174 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1175 lit: _visitor.fold_lit(_i . lit),
1176 }
1177}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001178# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001179pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001180 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001181 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001182 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001183 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1184 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001185 }
1186}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001187# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001188pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001189 ExprMacro {
1190 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1191 mac: _visitor.fold_macro(_i . mac),
1192 }
1193}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001194# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001195pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001198 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001199 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001201 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1202 }
1203}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001204# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001205pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001206 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001207 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001208 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001209 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001210 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001211 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001212 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1213 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001214 }
1215}
David Tolnay81ab4f62018-01-27 19:02:51 -08001216# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001217pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001218 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001219 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001220 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001221 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
1223}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001224# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001225pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001226 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001227 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001228 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001229 path: _visitor.fold_path(_i . path),
1230 }
1231}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001232# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001233pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001235 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001236 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001237 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001238 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
1240}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001241# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +02001242pub fn fold_expr_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReference) -> ExprReference {
1243 ExprReference {
1244 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1245 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1246 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1247 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1248 }
1249}
1250# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001251pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001254 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001256 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001257 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001258 }
1259}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001260# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001261pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001262 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001263 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001264 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001265 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
1267}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001268# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001269pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001270 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001271 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001272 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001273 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001274 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1275 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1276 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001277 }
1278}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001279# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001280pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001281 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001282 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001283 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001284 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001285 }
1286}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001287# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001288pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001289 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001290 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001291 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001292 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001293 }
1294}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001295# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001296pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001297 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001298 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001299 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001300 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001301 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001302 }
1303}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001305pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001307 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001308 op: _visitor.fold_un_op(_i . op),
1309 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1310 }
1311}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001312# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001313pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001314 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001315 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001316 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001317 block: _visitor.fold_block(_i . block),
1318 }
1319}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001321pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001322 ExprVerbatim {
1323 tts: _i . tts,
1324 }
1325}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001326# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001327pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001328 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001329 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001330 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001331 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001332 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1333 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001334 }
1335}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001336# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001337pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001338 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001339 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001340 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001341 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1342 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001343 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001344 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001345 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1346 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001347 }
1348}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001349# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001350pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001351 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001352 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001353 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001354 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001355 }
1356}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001357# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001358pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001359 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001360 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001361 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001362 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001363 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001364 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001365 }
1366}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001367# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001368pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001369 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001370 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001371 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001372 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001373 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001374 }
1375}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001376# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001377pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001378 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001379 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1380 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001381 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001382 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001383 }
1384}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001385# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001386pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001387 match _i {
1388 Fields::Named(_binding_0, ) => {
1389 Fields::Named (
1390 _visitor.fold_fields_named(_binding_0),
1391 )
1392 }
1393 Fields::Unnamed(_binding_0, ) => {
1394 Fields::Unnamed (
1395 _visitor.fold_fields_unnamed(_binding_0),
1396 )
1397 }
1398 Fields::Unit => { Fields::Unit }
1399 }
1400}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001401# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001402pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001403 FieldsNamed {
1404 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001405 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001406 }
1407}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001408# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001409pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001410 FieldsUnnamed {
1411 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001412 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001413 }
1414}
Nika Layzell27726662017-10-24 23:16:35 -04001415# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001416pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001417 File {
1418 shebang: _i . shebang,
1419 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1420 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1421 }
1422}
1423# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001424pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001425 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001426 FnArg::SelfRef(_binding_0, ) => {
1427 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001428 _visitor.fold_arg_self_ref(_binding_0),
1429 )
1430 }
David Tolnay6702ade2017-12-30 23:38:15 -05001431 FnArg::SelfValue(_binding_0, ) => {
1432 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001433 _visitor.fold_arg_self(_binding_0),
1434 )
1435 }
David Tolnay6702ade2017-12-30 23:38:15 -05001436 FnArg::Captured(_binding_0, ) => {
1437 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001438 _visitor.fold_arg_captured(_binding_0),
1439 )
1440 }
David Tolnay6702ade2017-12-30 23:38:15 -05001441 FnArg::Inferred(_binding_0, ) => {
1442 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001443 _visitor.fold_pat(_binding_0),
1444 )
1445 }
David Tolnay6702ade2017-12-30 23:38:15 -05001446 FnArg::Ignored(_binding_0, ) => {
1447 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001448 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001449 )
1450 }
1451 }
1452}
1453# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001454pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001455 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001456 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001457 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001458 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001459 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001460 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001461 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001462 }
1463}
1464# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001465pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001466 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001467 ForeignItem::Fn(_binding_0, ) => {
1468 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001469 _visitor.fold_foreign_item_fn(_binding_0),
1470 )
1471 }
David Tolnay6702ade2017-12-30 23:38:15 -05001472 ForeignItem::Static(_binding_0, ) => {
1473 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001474 _visitor.fold_foreign_item_static(_binding_0),
1475 )
1476 }
David Tolnay6702ade2017-12-30 23:38:15 -05001477 ForeignItem::Type(_binding_0, ) => {
1478 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001479 _visitor.fold_foreign_item_type(_binding_0),
1480 )
1481 }
David Tolnay6702ade2017-12-30 23:38:15 -05001482 ForeignItem::Verbatim(_binding_0, ) => {
1483 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001484 _visitor.fold_foreign_item_verbatim(_binding_0),
1485 )
1486 }
Nika Layzell27726662017-10-24 23:16:35 -04001487 }
1488}
1489# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001490pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001491 ForeignItemFn {
1492 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1493 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001494 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001495 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001496 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001497 }
1498}
1499# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001500pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001501 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001502 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1503 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001505 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001506 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001507 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001508 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001509 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001510 }
1511}
David Tolnay199bcbb2017-11-12 10:33:52 -08001512# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001513pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001514 ForeignItemType {
1515 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1516 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001517 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001518 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001519 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001520 }
1521}
David Tolnay2ae520a2017-12-29 11:19:50 -05001522# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001523pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001524 ForeignItemVerbatim {
1525 tts: _i . tts,
1526 }
1527}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001528# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001529pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001530 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001531 GenericArgument::Lifetime(_binding_0, ) => {
1532 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001533 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001534 )
1535 }
David Tolnay6702ade2017-12-30 23:38:15 -05001536 GenericArgument::Type(_binding_0, ) => {
1537 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001538 _visitor.fold_type(_binding_0),
1539 )
1540 }
David Tolnay6702ade2017-12-30 23:38:15 -05001541 GenericArgument::Binding(_binding_0, ) => {
1542 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001543 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001544 )
1545 }
David Tolnay6702ade2017-12-30 23:38:15 -05001546 GenericArgument::Const(_binding_0, ) => {
1547 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001548 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001549 )
1550 }
Nika Layzell357885a2017-12-04 15:47:07 -05001551 }
1552}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001553# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001554pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001555 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001556 GenericMethodArgument::Type(_binding_0, ) => {
1557 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001558 _visitor.fold_type(_binding_0),
1559 )
1560 }
David Tolnay6702ade2017-12-30 23:38:15 -05001561 GenericMethodArgument::Const(_binding_0, ) => {
1562 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001563 _visitor.fold_expr(_binding_0),
1564 )
1565 }
1566 }
1567}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001568# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001569pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001570 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001571 GenericParam::Type(_binding_0, ) => {
1572 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001573 _visitor.fold_type_param(_binding_0),
1574 )
1575 }
David Tolnay517f3692018-01-01 20:17:23 -08001576 GenericParam::Lifetime(_binding_0, ) => {
1577 GenericParam::Lifetime (
1578 _visitor.fold_lifetime_def(_binding_0),
1579 )
1580 }
David Tolnay6702ade2017-12-30 23:38:15 -05001581 GenericParam::Const(_binding_0, ) => {
1582 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001583 _visitor.fold_const_param(_binding_0),
1584 )
1585 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001586 }
1587}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001588# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001589pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001590 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001592 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001594 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001595 }
1596}
Alex Crichtond261d092018-05-18 13:47:35 -07001597
1598pub fn fold_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay18837692018-05-20 20:17:20 -07001599 Ident::new(&_i.to_string(), _visitor.fold_span(_i.span()))
Alex Crichtond261d092018-05-18 13:47:35 -07001600}
Nika Layzell27726662017-10-24 23:16:35 -04001601# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001602pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001603 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001604 ImplItem::Const(_binding_0, ) => {
1605 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001606 _visitor.fold_impl_item_const(_binding_0),
1607 )
1608 }
David Tolnay6702ade2017-12-30 23:38:15 -05001609 ImplItem::Method(_binding_0, ) => {
1610 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001611 _visitor.fold_impl_item_method(_binding_0),
1612 )
1613 }
David Tolnay6702ade2017-12-30 23:38:15 -05001614 ImplItem::Type(_binding_0, ) => {
1615 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001616 _visitor.fold_impl_item_type(_binding_0),
1617 )
1618 }
David Tolnay6702ade2017-12-30 23:38:15 -05001619 ImplItem::Macro(_binding_0, ) => {
1620 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001621 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001622 )
1623 }
David Tolnay6702ade2017-12-30 23:38:15 -05001624 ImplItem::Verbatim(_binding_0, ) => {
1625 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001626 _visitor.fold_impl_item_verbatim(_binding_0),
1627 )
1628 }
Nika Layzell27726662017-10-24 23:16:35 -04001629 }
1630}
1631# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001632pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001633 ImplItemConst {
1634 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1635 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001636 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001637 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001638 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001639 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001640 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001641 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001642 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001643 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001644 }
1645}
1646# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001647pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001648 ImplItemMacro {
1649 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1650 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001651 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001652 }
1653}
1654# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001655pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001656 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001657 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001658 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001659 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001660 sig: _visitor.fold_method_sig(_i . sig),
1661 block: _visitor.fold_block(_i . block),
1662 }
1663}
1664# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001665pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001666 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001667 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001668 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001669 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001670 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001671 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001672 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001673 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001674 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001675 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001676 }
1677}
David Tolnay2ae520a2017-12-29 11:19:50 -05001678# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001679pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001680 ImplItemVerbatim {
1681 tts: _i . tts,
1682 }
1683}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001684# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001685pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001686 Index {
1687 index: _i . index,
1688 span: _visitor.fold_span(_i . span),
1689 }
1690}
1691# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001692pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001693 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001694 Item::ExternCrate(_binding_0, ) => {
1695 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001696 _visitor.fold_item_extern_crate(_binding_0),
1697 )
1698 }
David Tolnay6702ade2017-12-30 23:38:15 -05001699 Item::Use(_binding_0, ) => {
1700 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001701 _visitor.fold_item_use(_binding_0),
1702 )
1703 }
David Tolnay6702ade2017-12-30 23:38:15 -05001704 Item::Static(_binding_0, ) => {
1705 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001706 _visitor.fold_item_static(_binding_0),
1707 )
1708 }
David Tolnay6702ade2017-12-30 23:38:15 -05001709 Item::Const(_binding_0, ) => {
1710 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001711 _visitor.fold_item_const(_binding_0),
1712 )
1713 }
David Tolnay6702ade2017-12-30 23:38:15 -05001714 Item::Fn(_binding_0, ) => {
1715 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001716 _visitor.fold_item_fn(_binding_0),
1717 )
1718 }
David Tolnay6702ade2017-12-30 23:38:15 -05001719 Item::Mod(_binding_0, ) => {
1720 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001721 _visitor.fold_item_mod(_binding_0),
1722 )
1723 }
David Tolnay6702ade2017-12-30 23:38:15 -05001724 Item::ForeignMod(_binding_0, ) => {
1725 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001726 _visitor.fold_item_foreign_mod(_binding_0),
1727 )
1728 }
David Tolnay6702ade2017-12-30 23:38:15 -05001729 Item::Type(_binding_0, ) => {
1730 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001731 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001732 )
1733 }
David Tolnay6702ade2017-12-30 23:38:15 -05001734 Item::Struct(_binding_0, ) => {
1735 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001736 _visitor.fold_item_struct(_binding_0),
1737 )
1738 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001739 Item::Enum(_binding_0, ) => {
1740 Item::Enum (
1741 _visitor.fold_item_enum(_binding_0),
1742 )
1743 }
David Tolnay6702ade2017-12-30 23:38:15 -05001744 Item::Union(_binding_0, ) => {
1745 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001746 _visitor.fold_item_union(_binding_0),
1747 )
1748 }
David Tolnay6702ade2017-12-30 23:38:15 -05001749 Item::Trait(_binding_0, ) => {
1750 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001751 _visitor.fold_item_trait(_binding_0),
1752 )
1753 }
David Tolnay6702ade2017-12-30 23:38:15 -05001754 Item::Impl(_binding_0, ) => {
1755 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001756 _visitor.fold_item_impl(_binding_0),
1757 )
1758 }
David Tolnay6702ade2017-12-30 23:38:15 -05001759 Item::Macro(_binding_0, ) => {
1760 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001761 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001762 )
1763 }
David Tolnay6702ade2017-12-30 23:38:15 -05001764 Item::Macro2(_binding_0, ) => {
1765 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001766 _visitor.fold_item_macro2(_binding_0),
1767 )
1768 }
David Tolnay6702ade2017-12-30 23:38:15 -05001769 Item::Verbatim(_binding_0, ) => {
1770 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001771 _visitor.fold_item_verbatim(_binding_0),
1772 )
1773 }
Nika Layzell27726662017-10-24 23:16:35 -04001774 }
1775}
1776# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001777pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001778 ItemConst {
1779 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1780 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001781 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001782 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001783 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001784 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001785 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001787 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001788 }
1789}
1790# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001791pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 ItemEnum {
1793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1794 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001795 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001796 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001797 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001798 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001799 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1800 }
1801}
1802# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001803pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 ItemExternCrate {
1805 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1806 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001807 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1808 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001809 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001810 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001811 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001812 _visitor.fold_ident(( it ) . 1),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001813 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001814 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001815 }
1816}
1817# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001818pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001819 ItemFn {
1820 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1821 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001822 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001823 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001824 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001825 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001826 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001827 block: Box::new(_visitor.fold_block(* _i . block)),
1828 }
1829}
1830# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001831pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001832 ItemForeignMod {
1833 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1834 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001835 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001836 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1837 }
1838}
1839# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001840pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001841 ItemImpl {
1842 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001843 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001844 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001845 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001846 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001847 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001848 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001849 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001851 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001852 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001853 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001854 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1855 }
1856}
1857# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001858pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001859 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001860 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001861 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001862 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001864 }
1865}
1866# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001867pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001868 ItemMacro2 {
1869 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1870 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001872 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001873 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001874 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001875 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001876 body: _i . body,
1877 }
1878}
1879# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001880pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001881 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001882 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001883 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001884 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001885 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001886 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001887 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001888 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1889 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001890 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001891 }
1892}
1893# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001894pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001895 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001896 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001897 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001898 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001899 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001900 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001901 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001902 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001903 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001904 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001905 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001906 }
1907}
1908# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001909pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001910 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001911 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001912 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001913 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001914 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001915 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001916 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001917 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001918 }
1919}
1920# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001921pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001922 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001923 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001924 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001925 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001926 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1927 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001928 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001929 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001930 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001931 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001932 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001933 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1934 }
1935}
1936# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001937pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001938 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001939 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001940 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001941 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001942 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001943 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001944 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001945 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001946 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001947 }
1948}
1949# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001950pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001951 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001952 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001953 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001954 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001955 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001956 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001957 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001958 }
1959}
1960# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001961pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001962 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001963 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001964 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001965 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1966 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001967 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001968 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001969 }
1970}
David Tolnay2ae520a2017-12-29 11:19:50 -05001971# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001972pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001973 ItemVerbatim {
1974 tts: _i . tts,
1975 }
1976}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001977# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001978pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001979 Label {
1980 name: _visitor.fold_lifetime(_i . name),
1981 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1982 }
1983}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001984# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Alex Crichton131308c2018-05-18 14:00:24 -07001985pub fn fold_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1986 Lifetime {
1987 apostrophe: _i . apostrophe,
1988 ident: _visitor.fold_ident(_i . ident),
1989 }
1990}
1991# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001992pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001993 LifetimeDef {
1994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001995 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001996 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001997 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1998 }
1999}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002000# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002001pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08002002 match _i {
2003 Lit::Str(_binding_0, ) => {
2004 Lit::Str (
2005 _visitor.fold_lit_str(_binding_0),
2006 )
2007 }
2008 Lit::ByteStr(_binding_0, ) => {
2009 Lit::ByteStr (
2010 _visitor.fold_lit_byte_str(_binding_0),
2011 )
2012 }
2013 Lit::Byte(_binding_0, ) => {
2014 Lit::Byte (
2015 _visitor.fold_lit_byte(_binding_0),
2016 )
2017 }
2018 Lit::Char(_binding_0, ) => {
2019 Lit::Char (
2020 _visitor.fold_lit_char(_binding_0),
2021 )
2022 }
2023 Lit::Int(_binding_0, ) => {
2024 Lit::Int (
2025 _visitor.fold_lit_int(_binding_0),
2026 )
2027 }
2028 Lit::Float(_binding_0, ) => {
2029 Lit::Float (
2030 _visitor.fold_lit_float(_binding_0),
2031 )
2032 }
2033 Lit::Bool(_binding_0, ) => {
2034 Lit::Bool (
2035 _visitor.fold_lit_bool(_binding_0),
2036 )
2037 }
2038 Lit::Verbatim(_binding_0, ) => {
2039 Lit::Verbatim (
2040 _visitor.fold_lit_verbatim(_binding_0),
2041 )
2042 }
2043 }
2044}
2045# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002046pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002047 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002048 value: _i . value,
2049 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002050 }
2051}
David Tolnay360efd22018-01-04 23:35:26 -08002052# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002053pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002054 LitVerbatim {
2055 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002056 }
2057}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002058# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002059pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002060 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002061 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002062 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02002063 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -05002064 ty: (_i . ty).map(|it| { (
2065 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2066 Box::new(_visitor.fold_type(* ( it ) . 1)),
2067 ) }),
2068 init: (_i . init).map(|it| { (
2069 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2070 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2071 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002072 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002073 }
2074}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002075# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002076pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002077 Macro {
2078 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002079 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002080 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2081 tts: _i . tts,
2082 }
2083}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002084# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002085pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002086 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002087 MacroDelimiter::Paren(_binding_0, ) => {
2088 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002089 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2090 )
2091 }
David Tolnay6702ade2017-12-30 23:38:15 -05002092 MacroDelimiter::Brace(_binding_0, ) => {
2093 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002094 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2095 )
2096 }
David Tolnay6702ade2017-12-30 23:38:15 -05002097 MacroDelimiter::Bracket(_binding_0, ) => {
2098 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002099 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2100 )
2101 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002102 }
2103}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002104# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002105pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002106 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002107 Member::Named(_binding_0, ) => {
2108 Member::Named (
Alex Crichtond261d092018-05-18 13:47:35 -07002109 _visitor.fold_ident(_binding_0),
David Tolnay85b69a42017-12-27 20:43:10 -05002110 )
2111 }
David Tolnay6702ade2017-12-30 23:38:15 -05002112 Member::Unnamed(_binding_0, ) => {
2113 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002114 _visitor.fold_index(_binding_0),
2115 )
2116 }
2117 }
2118}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002119# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002120pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002121 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002122 Meta::Word(_binding_0, ) => {
2123 Meta::Word (
Alex Crichtond261d092018-05-18 13:47:35 -07002124 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002125 )
2126 }
David Tolnayaaadd782018-01-06 22:58:13 -08002127 Meta::List(_binding_0, ) => {
2128 Meta::List (
2129 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002130 )
2131 }
David Tolnayaaadd782018-01-06 22:58:13 -08002132 Meta::NameValue(_binding_0, ) => {
2133 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002134 _visitor.fold_meta_name_value(_binding_0),
2135 )
2136 }
2137 }
2138}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002139# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002140pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2141 MetaList {
Alex Crichtond261d092018-05-18 13:47:35 -07002142 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002143 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002144 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
2146}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002147# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002148pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002149 MetaNameValue {
Alex Crichtond261d092018-05-18 13:47:35 -07002150 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002151 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002152 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002153 }
2154}
2155# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002156pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002157 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002158 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002159 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002160 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002161 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002162 decl: _visitor.fold_fn_decl(_i . decl),
2163 }
2164}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002165# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002166pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002167 MethodTurbofish {
2168 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2169 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2170 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2171 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2172 }
2173}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002174# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002175pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002176 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002177 NestedMeta::Meta(_binding_0, ) => {
2178 NestedMeta::Meta (
2179 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002180 )
2181 }
David Tolnayaaadd782018-01-06 22:58:13 -08002182 NestedMeta::Literal(_binding_0, ) => {
2183 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002184 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002185 )
2186 }
2187 }
2188}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002189# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002190pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002191 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002192 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002193 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002194 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002195 }
2196}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002197# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002198pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002199 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002200 Pat::Wild(_binding_0, ) => {
2201 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002202 _visitor.fold_pat_wild(_binding_0),
2203 )
2204 }
David Tolnay6702ade2017-12-30 23:38:15 -05002205 Pat::Ident(_binding_0, ) => {
2206 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002207 _visitor.fold_pat_ident(_binding_0),
2208 )
2209 }
David Tolnay6702ade2017-12-30 23:38:15 -05002210 Pat::Struct(_binding_0, ) => {
2211 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002212 _visitor.fold_pat_struct(_binding_0),
2213 )
2214 }
David Tolnay6702ade2017-12-30 23:38:15 -05002215 Pat::TupleStruct(_binding_0, ) => {
2216 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002217 _visitor.fold_pat_tuple_struct(_binding_0),
2218 )
2219 }
David Tolnay6702ade2017-12-30 23:38:15 -05002220 Pat::Path(_binding_0, ) => {
2221 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002222 _visitor.fold_pat_path(_binding_0),
2223 )
2224 }
David Tolnay6702ade2017-12-30 23:38:15 -05002225 Pat::Tuple(_binding_0, ) => {
2226 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002227 _visitor.fold_pat_tuple(_binding_0),
2228 )
2229 }
David Tolnay6702ade2017-12-30 23:38:15 -05002230 Pat::Box(_binding_0, ) => {
2231 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002232 _visitor.fold_pat_box(_binding_0),
2233 )
2234 }
David Tolnay6702ade2017-12-30 23:38:15 -05002235 Pat::Ref(_binding_0, ) => {
2236 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002237 _visitor.fold_pat_ref(_binding_0),
2238 )
2239 }
David Tolnay6702ade2017-12-30 23:38:15 -05002240 Pat::Lit(_binding_0, ) => {
2241 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002242 _visitor.fold_pat_lit(_binding_0),
2243 )
2244 }
David Tolnay6702ade2017-12-30 23:38:15 -05002245 Pat::Range(_binding_0, ) => {
2246 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002247 _visitor.fold_pat_range(_binding_0),
2248 )
2249 }
David Tolnay6702ade2017-12-30 23:38:15 -05002250 Pat::Slice(_binding_0, ) => {
2251 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002252 _visitor.fold_pat_slice(_binding_0),
2253 )
2254 }
David Tolnay6702ade2017-12-30 23:38:15 -05002255 Pat::Macro(_binding_0, ) => {
2256 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002257 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002258 )
2259 }
David Tolnay6702ade2017-12-30 23:38:15 -05002260 Pat::Verbatim(_binding_0, ) => {
2261 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002262 _visitor.fold_pat_verbatim(_binding_0),
2263 )
2264 }
Nika Layzell27726662017-10-24 23:16:35 -04002265 }
2266}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002267# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002268pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002269 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002270 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002271 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002272 }
2273}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002274# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002275pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002276 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002277 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2278 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002279 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002280 subpat: (_i . subpat).map(|it| { (
2281 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2282 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2283 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002284 }
2285}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002286# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002287pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002288 PatLit {
2289 expr: Box::new(_visitor.fold_expr(* _i . expr)),
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_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002294 PatMacro {
2295 mac: _visitor.fold_macro(_i . mac),
2296 }
2297}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002298# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002299pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002300 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002301 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002302 path: _visitor.fold_path(_i . path),
2303 }
2304}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002305# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002306pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002307 PatRange {
2308 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002309 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002310 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002311 }
2312}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002313# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002314pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002315 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002316 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002317 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002318 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002319 }
2320}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002321# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002322pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002323 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002324 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002325 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002326 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002327 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002328 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002329 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002330 }
2331}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002332# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002333pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002334 PatStruct {
2335 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002336 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002337 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002338 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002339 }
2340}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002341# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002342pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002343 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002344 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002345 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002346 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002347 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2348 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002349 }
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_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002353 PatTupleStruct {
2354 path: _visitor.fold_path(_i . path),
2355 pat: _visitor.fold_pat_tuple(_i . pat),
2356 }
2357}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002358# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002359pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002360 PatVerbatim {
2361 tts: _i . tts,
2362 }
2363}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002364# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002365pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002366 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002367 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002368 }
2369}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002370# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002371pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002372 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002373 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002374 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2375 }
2376}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002377# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002378pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002379 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002380 PathArguments::None => { PathArguments::None }
2381 PathArguments::AngleBracketed(_binding_0, ) => {
2382 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002383 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2384 )
2385 }
David Tolnay6702ade2017-12-30 23:38:15 -05002386 PathArguments::Parenthesized(_binding_0, ) => {
2387 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002388 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2389 )
2390 }
2391 }
2392}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002393# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002394pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002395 PathSegment {
Alex Crichtond261d092018-05-18 13:47:35 -07002396 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002397 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002398 }
2399}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002400# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002401pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002402 PredicateEq {
2403 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2404 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2405 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2406 }
2407}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002408# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002409pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002410 PredicateLifetime {
2411 lifetime: _visitor.fold_lifetime(_i . lifetime),
2412 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2413 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2414 }
2415}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002416# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002417pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002418 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002419 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002420 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2421 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2422 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2423 }
2424}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002425# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002426pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002427 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002428 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002429 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002430 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002431 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2432 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002433 }
2434}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002435# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002436pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002437 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002438 RangeLimits::HalfOpen(_binding_0, ) => {
2439 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002440 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002441 )
2442 }
David Tolnay6702ade2017-12-30 23:38:15 -05002443 RangeLimits::Closed(_binding_0, ) => {
2444 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002445 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
2448 }
2449}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002450# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002451pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002452 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002453 ReturnType::Default => { ReturnType::Default }
2454 ReturnType::Type(_binding_0, _binding_1, ) => {
2455 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002456 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2457 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002458 )
2459 }
2460 }
2461}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002462
David Tolnay4b4c4b62018-01-06 13:48:05 -08002463pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002464 _i
2465}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002466# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002467pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002468 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002469 Stmt::Local(_binding_0, ) => {
2470 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002471 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
David Tolnay6702ade2017-12-30 23:38:15 -05002474 Stmt::Item(_binding_0, ) => {
2475 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002476 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002477 )
2478 }
David Tolnay6702ade2017-12-30 23:38:15 -05002479 Stmt::Expr(_binding_0, ) => {
2480 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002481 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002482 )
2483 }
David Tolnay6702ade2017-12-30 23:38:15 -05002484 Stmt::Semi(_binding_0, _binding_1, ) => {
2485 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002486 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002487 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002488 )
2489 }
Nika Layzell27726662017-10-24 23:16:35 -04002490 }
2491}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002492# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002493pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002494 TraitBound {
David Tolnayc1f5d5d2018-03-31 22:17:56 +02002495 paren_token: (_i . paren_token).map(|it| { Paren(tokens_helper(_visitor, &(it).0)) }),
David Tolnay40fb8ce2018-01-02 10:53:46 -08002496 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2497 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2498 path: _visitor.fold_path(_i . path),
2499 }
2500}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002501# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002502pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002503 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002504 TraitBoundModifier::None => { TraitBoundModifier::None }
2505 TraitBoundModifier::Maybe(_binding_0, ) => {
2506 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002507 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002508 )
2509 }
2510 }
2511}
2512# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002513pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002514 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002515 TraitItem::Const(_binding_0, ) => {
2516 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002517 _visitor.fold_trait_item_const(_binding_0),
2518 )
2519 }
David Tolnay6702ade2017-12-30 23:38:15 -05002520 TraitItem::Method(_binding_0, ) => {
2521 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002522 _visitor.fold_trait_item_method(_binding_0),
2523 )
2524 }
David Tolnay6702ade2017-12-30 23:38:15 -05002525 TraitItem::Type(_binding_0, ) => {
2526 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002527 _visitor.fold_trait_item_type(_binding_0),
2528 )
2529 }
David Tolnay6702ade2017-12-30 23:38:15 -05002530 TraitItem::Macro(_binding_0, ) => {
2531 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002532 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002533 )
2534 }
David Tolnay6702ade2017-12-30 23:38:15 -05002535 TraitItem::Verbatim(_binding_0, ) => {
2536 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002537 _visitor.fold_trait_item_verbatim(_binding_0),
2538 )
2539 }
Nika Layzell27726662017-10-24 23:16:35 -04002540 }
2541}
2542# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002543pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002544 TraitItemConst {
2545 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002546 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002547 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002548 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002550 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002551 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002552 _visitor.fold_expr(( it ) . 1),
2553 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002554 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002555 }
2556}
2557# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002558pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002559 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002560 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002561 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002562 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002563 }
2564}
2565# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002566pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002567 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002568 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002569 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002570 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002571 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002572 }
2573}
2574# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002575pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002576 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002577 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002578 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002579 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002580 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002581 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002582 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002583 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002584 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002585 _visitor.fold_type(( it ) . 1),
2586 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002588 }
2589}
David Tolnay2ae520a2017-12-29 11:19:50 -05002590# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002591pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002592 TraitItemVerbatim {
2593 tts: _i . tts,
2594 }
2595}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002596# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002597pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002598 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002599 Type::Slice(_binding_0, ) => {
2600 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002601 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002602 )
2603 }
David Tolnay6702ade2017-12-30 23:38:15 -05002604 Type::Array(_binding_0, ) => {
2605 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002606 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002607 )
2608 }
David Tolnay6702ade2017-12-30 23:38:15 -05002609 Type::Ptr(_binding_0, ) => {
2610 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
David Tolnay6702ade2017-12-30 23:38:15 -05002614 Type::Reference(_binding_0, ) => {
2615 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002616 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002617 )
2618 }
David Tolnay6702ade2017-12-30 23:38:15 -05002619 Type::BareFn(_binding_0, ) => {
2620 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002621 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002622 )
2623 }
David Tolnay6702ade2017-12-30 23:38:15 -05002624 Type::Never(_binding_0, ) => {
2625 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002627 )
2628 }
David Tolnay6702ade2017-12-30 23:38:15 -05002629 Type::Tuple(_binding_0, ) => {
2630 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002631 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002632 )
2633 }
David Tolnay6702ade2017-12-30 23:38:15 -05002634 Type::Path(_binding_0, ) => {
2635 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002636 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002637 )
2638 }
David Tolnay6702ade2017-12-30 23:38:15 -05002639 Type::TraitObject(_binding_0, ) => {
2640 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002642 )
2643 }
David Tolnay6702ade2017-12-30 23:38:15 -05002644 Type::ImplTrait(_binding_0, ) => {
2645 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002646 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
David Tolnay6702ade2017-12-30 23:38:15 -05002649 Type::Paren(_binding_0, ) => {
2650 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002651 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002652 )
2653 }
David Tolnay6702ade2017-12-30 23:38:15 -05002654 Type::Group(_binding_0, ) => {
2655 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002656 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002657 )
2658 }
David Tolnay6702ade2017-12-30 23:38:15 -05002659 Type::Infer(_binding_0, ) => {
2660 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002661 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002662 )
2663 }
David Tolnay6702ade2017-12-30 23:38:15 -05002664 Type::Macro(_binding_0, ) => {
2665 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002666 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002667 )
2668 }
David Tolnay6702ade2017-12-30 23:38:15 -05002669 Type::Verbatim(_binding_0, ) => {
2670 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002671 _visitor.fold_type_verbatim(_binding_0),
2672 )
2673 }
Nika Layzell27726662017-10-24 23:16:35 -04002674 }
2675}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002676# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002677pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002678 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002679 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002680 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002681 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002682 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002683 }
2684}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002685# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002686pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002687 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002688 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2689 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2690 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2691 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2692 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2693 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2694 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2695 output: _visitor.fold_return_type(_i . output),
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_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002700 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002701 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002702 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002703 }
2704}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002705# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002706pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002707 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002708 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002709 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002710 }
2711}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002712# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002713pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002714 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002715 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002716 }
2717}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002718# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002719pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002720 TypeMacro {
2721 mac: _visitor.fold_macro(_i . mac),
2722 }
2723}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002724# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002725pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002726 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002727 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002728 }
2729}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002730# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002731pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002732 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002733 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002734 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002735 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002736 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002737 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002738 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002739 }
2740}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002741# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002742pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002743 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002744 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002745 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002746 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002747 )
2748 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002749 TypeParamBound::Lifetime(_binding_0, ) => {
2750 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002751 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002752 )
2753 }
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_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002758 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002759 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002760 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002761 }
2762}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002763# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002764pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002765 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002766 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002767 path: _visitor.fold_path(_i . path),
2768 }
2769}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002770# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002771pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002772 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002773 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2774 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002775 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2776 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
2778}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002779# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002780pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002781 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002782 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002783 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002784 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2785 elem: Box::new(_visitor.fold_type(* _i . elem)),
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_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002790 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002791 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002792 elem: Box::new(_visitor.fold_type(* _i . elem)),
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_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002797 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002798 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002799 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002800 }
2801}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002802# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002803pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002804 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002805 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002806 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002807 }
2808}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002809# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002810pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002811 TypeVerbatim {
2812 tts: _i . tts,
2813 }
2814}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002815# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002816pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002817 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002818 UnOp::Deref(_binding_0, ) => {
2819 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002820 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002821 )
2822 }
David Tolnay6702ade2017-12-30 23:38:15 -05002823 UnOp::Not(_binding_0, ) => {
2824 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002825 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002826 )
2827 }
David Tolnay6702ade2017-12-30 23:38:15 -05002828 UnOp::Neg(_binding_0, ) => {
2829 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002830 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002831 )
2832 }
2833 }
2834}
David Tolnay5f332a92017-12-26 00:42:45 -05002835# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002836pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002837 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002838 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002839 }
2840}
2841# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002842pub fn fold_use_group<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGroup) -> UseGroup {
2843 UseGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002844 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002845 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2846 }
2847}
2848# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002849pub fn fold_use_name<V: Fold + ?Sized>(_visitor: &mut V, _i: UseName) -> UseName {
2850 UseName {
Alex Crichtond261d092018-05-18 13:47:35 -07002851 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002852 }
2853}
2854# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002855pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002856 UsePath {
Alex Crichtond261d092018-05-18 13:47:35 -07002857 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002858 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2859 tree: Box::new(_visitor.fold_use_tree(* _i . tree)),
2860 }
2861}
2862# [ cfg ( feature = "full" ) ]
2863pub fn fold_use_rename<V: Fold + ?Sized>(_visitor: &mut V, _i: UseRename) -> UseRename {
2864 UseRename {
Alex Crichtond261d092018-05-18 13:47:35 -07002865 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002866 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002867 rename: _visitor.fold_ident(_i . rename),
David Tolnay5f332a92017-12-26 00:42:45 -05002868 }
2869}
2870# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002871pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002872 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002873 UseTree::Path(_binding_0, ) => {
2874 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002875 _visitor.fold_use_path(_binding_0),
2876 )
2877 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002878 UseTree::Name(_binding_0, ) => {
2879 UseTree::Name (
2880 _visitor.fold_use_name(_binding_0),
2881 )
2882 }
2883 UseTree::Rename(_binding_0, ) => {
2884 UseTree::Rename (
2885 _visitor.fold_use_rename(_binding_0),
2886 )
2887 }
David Tolnay6702ade2017-12-30 23:38:15 -05002888 UseTree::Glob(_binding_0, ) => {
2889 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002890 _visitor.fold_use_glob(_binding_0),
2891 )
2892 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002893 UseTree::Group(_binding_0, ) => {
2894 UseTree::Group (
2895 _visitor.fold_use_group(_binding_0),
David Tolnay5f332a92017-12-26 00:42:45 -05002896 )
2897 }
2898 }
2899}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002900# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002901pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002902 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002903 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002904 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002905 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002906 discriminant: (_i . discriminant).map(|it| { (
2907 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2908 _visitor.fold_expr(( it ) . 1),
2909 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002910 }
2911}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002912# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002913pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002914 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002915 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
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_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002920 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002921 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002922 }
2923}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002924# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002925pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002926 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002927 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002928 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002929 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002930 path: Box::new(_visitor.fold_path(* _i . path)),
2931 }
2932}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002933# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002934pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002935 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002936 Visibility::Public(_binding_0, ) => {
2937 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002938 _visitor.fold_vis_public(_binding_0),
2939 )
2940 }
David Tolnay6702ade2017-12-30 23:38:15 -05002941 Visibility::Crate(_binding_0, ) => {
2942 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002943 _visitor.fold_vis_crate(_binding_0),
2944 )
2945 }
David Tolnay6702ade2017-12-30 23:38:15 -05002946 Visibility::Restricted(_binding_0, ) => {
2947 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002948 _visitor.fold_vis_restricted(_binding_0),
2949 )
2950 }
David Tolnay6702ade2017-12-30 23:38:15 -05002951 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002952 }
2953}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002954# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002955pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002956 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002957 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002958 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2959 }
2960}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002961# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002962pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002963 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002964 WherePredicate::Type(_binding_0, ) => {
2965 WherePredicate::Type (
2966 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002967 )
2968 }
David Tolnayd4add852018-01-01 20:13:24 -08002969 WherePredicate::Lifetime(_binding_0, ) => {
2970 WherePredicate::Lifetime (
2971 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002972 )
2973 }
David Tolnayd4add852018-01-01 20:13:24 -08002974 WherePredicate::Eq(_binding_0, ) => {
2975 WherePredicate::Eq (
2976 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002977 )
2978 }
2979 }
2980}
2981