blob: 0607e92599b471a54fe7a5347dafe671e8ace6aa [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 Tolnay360efd22018-01-04 23:35:26 -0800423macro_rules! fold_span_only {
424 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800425 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
Alex Crichton9a4dca22018-03-28 06:32:19 -0700426 let span = _visitor.fold_span(_i.span());
427 _i.set_span(span);
David Tolnay360efd22018-01-04 23:35:26 -0800428 _i
429 }
430 }
David Tolnayd0adf522017-12-29 01:30:07 -0500431}
432
David Tolnay360efd22018-01-04 23:35:26 -0800433#[cfg(any(feature = "full", feature = "derive"))]
434fold_span_only!(fold_lit_byte: LitByte);
435#[cfg(any(feature = "full", feature = "derive"))]
436fold_span_only!(fold_lit_byte_str: LitByteStr);
437#[cfg(any(feature = "full", feature = "derive"))]
438fold_span_only!(fold_lit_char: LitChar);
439#[cfg(any(feature = "full", feature = "derive"))]
440fold_span_only!(fold_lit_float: LitFloat);
441#[cfg(any(feature = "full", feature = "derive"))]
442fold_span_only!(fold_lit_int: LitInt);
443#[cfg(any(feature = "full", feature = "derive"))]
444fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500445
David Tolnay3cfd1d32018-01-03 00:22:08 -0800446# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800447pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400448 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500449 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayc2749802018-01-06 23:40:41 -0800450 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400451 }
452}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800453# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800454pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500455 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500456 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500457 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500458 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500459 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400460 }
461}
462# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800463pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400464 ArgCaptured {
465 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500466 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800467 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400468 }
469}
470# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800471pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400472 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500473 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400475 }
476}
477# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800478pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400479 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500480 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500481 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500482 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500483 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400484 }
485}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800486# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800487pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400488 Arm {
489 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay18cc4d42018-03-31 18:47:20 +0200490 leading_vert: (_i . leading_vert).map(|it| { Token ! [ | ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400491 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500492 guard: (_i . guard).map(|it| { (
493 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
494 Box::new(_visitor.fold_expr(* ( it ) . 1)),
495 ) }),
David Tolnaydfb91432018-03-31 19:19:44 +0200496 fat_arrow_token: Token ! [ => ](tokens_helper(_visitor, &(_i . fat_arrow_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400497 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500498 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400499 }
500}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800501# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800502pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400503 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500504 AttrStyle::Outer => { AttrStyle::Outer }
505 AttrStyle::Inner(_binding_0, ) => {
506 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800512# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800513pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400514 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500515 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500516 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500517 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400518 path: _visitor.fold_path(_i . path),
519 tts: _i . tts,
520 is_sugared_doc: _i . is_sugared_doc,
521 }
522}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800523# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800524pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400525 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500526 name: (_i . name).map(|it| { (
527 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500528 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500529 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800530 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400531 }
532}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800533# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800534pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400535 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500536 BareFnArgName::Named(_binding_0, ) => {
537 BareFnArgName::Named (
Alex Crichtond261d092018-05-18 13:47:35 -0700538 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400539 )
540 }
David Tolnay6702ade2017-12-30 23:38:15 -0500541 BareFnArgName::Wild(_binding_0, ) => {
542 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500543 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400544 )
545 }
546 }
547}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800548# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800549pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400550 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500551 BinOp::Add(_binding_0, ) => {
552 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
David Tolnay6702ade2017-12-30 23:38:15 -0500556 BinOp::Sub(_binding_0, ) => {
557 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
David Tolnay6702ade2017-12-30 23:38:15 -0500561 BinOp::Mul(_binding_0, ) => {
562 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
David Tolnay6702ade2017-12-30 23:38:15 -0500566 BinOp::Div(_binding_0, ) => {
567 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
David Tolnay6702ade2017-12-30 23:38:15 -0500571 BinOp::Rem(_binding_0, ) => {
572 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
David Tolnay6702ade2017-12-30 23:38:15 -0500576 BinOp::And(_binding_0, ) => {
577 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
David Tolnay6702ade2017-12-30 23:38:15 -0500581 BinOp::Or(_binding_0, ) => {
582 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
David Tolnay6702ade2017-12-30 23:38:15 -0500586 BinOp::BitXor(_binding_0, ) => {
587 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
David Tolnay6702ade2017-12-30 23:38:15 -0500591 BinOp::BitAnd(_binding_0, ) => {
592 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
David Tolnay6702ade2017-12-30 23:38:15 -0500596 BinOp::BitOr(_binding_0, ) => {
597 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
David Tolnay6702ade2017-12-30 23:38:15 -0500601 BinOp::Shl(_binding_0, ) => {
602 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
David Tolnay6702ade2017-12-30 23:38:15 -0500606 BinOp::Shr(_binding_0, ) => {
607 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
David Tolnay6702ade2017-12-30 23:38:15 -0500611 BinOp::Eq(_binding_0, ) => {
612 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
David Tolnay6702ade2017-12-30 23:38:15 -0500616 BinOp::Lt(_binding_0, ) => {
617 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
David Tolnay6702ade2017-12-30 23:38:15 -0500621 BinOp::Le(_binding_0, ) => {
622 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
David Tolnay6702ade2017-12-30 23:38:15 -0500626 BinOp::Ne(_binding_0, ) => {
627 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
David Tolnay6702ade2017-12-30 23:38:15 -0500631 BinOp::Ge(_binding_0, ) => {
632 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
David Tolnay6702ade2017-12-30 23:38:15 -0500636 BinOp::Gt(_binding_0, ) => {
637 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
David Tolnay6702ade2017-12-30 23:38:15 -0500641 BinOp::AddEq(_binding_0, ) => {
642 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
David Tolnay6702ade2017-12-30 23:38:15 -0500646 BinOp::SubEq(_binding_0, ) => {
647 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
David Tolnay6702ade2017-12-30 23:38:15 -0500651 BinOp::MulEq(_binding_0, ) => {
652 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
David Tolnay6702ade2017-12-30 23:38:15 -0500656 BinOp::DivEq(_binding_0, ) => {
657 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500658 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400659 )
660 }
David Tolnay6702ade2017-12-30 23:38:15 -0500661 BinOp::RemEq(_binding_0, ) => {
662 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500663 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400664 )
665 }
David Tolnay6702ade2017-12-30 23:38:15 -0500666 BinOp::BitXorEq(_binding_0, ) => {
667 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500668 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400669 )
670 }
David Tolnay6702ade2017-12-30 23:38:15 -0500671 BinOp::BitAndEq(_binding_0, ) => {
672 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500673 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400674 )
675 }
David Tolnay6702ade2017-12-30 23:38:15 -0500676 BinOp::BitOrEq(_binding_0, ) => {
677 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500678 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400679 )
680 }
David Tolnay6702ade2017-12-30 23:38:15 -0500681 BinOp::ShlEq(_binding_0, ) => {
682 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500683 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400684 )
685 }
David Tolnay6702ade2017-12-30 23:38:15 -0500686 BinOp::ShrEq(_binding_0, ) => {
687 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500688 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400689 )
690 }
691 }
692}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800693# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800694pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500695 Binding {
Alex Crichtond261d092018-05-18 13:47:35 -0700696 ident: _visitor.fold_ident(_i . ident),
David Tolnay506e43a2017-12-29 11:34:36 -0500697 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
698 ty: _visitor.fold_type(_i . ty),
699 }
700}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800701# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800702pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400703 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500704 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400705 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
706 }
707}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800708# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800709pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400710 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500711 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
712 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400713 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400715 }
716}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800717# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800718pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500719 ConstParam {
720 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500721 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -0700722 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500724 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500726 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
727 }
728}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800729# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800730pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500731 match _i {
732 Data::Struct(_binding_0, ) => {
733 Data::Struct (
734 _visitor.fold_data_struct(_binding_0),
735 )
736 }
737 Data::Enum(_binding_0, ) => {
738 Data::Enum (
739 _visitor.fold_data_enum(_binding_0),
740 )
741 }
742 Data::Union(_binding_0, ) => {
743 Data::Union (
744 _visitor.fold_data_union(_binding_0),
745 )
746 }
747 }
748}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800749# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800750pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500751 DataEnum {
752 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
753 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
754 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
755 }
756}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800757# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800758pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500759 DataStruct {
760 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
761 fields: _visitor.fold_fields(_i . fields),
762 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
763 }
764}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800765# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800766pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500767 DataUnion {
768 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
769 fields: _visitor.fold_fields_named(_i . fields),
770 }
771}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800772# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800773pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400774 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400775 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500776 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -0700777 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400778 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500779 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400780 }
781}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800782# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800783pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400784 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500785 Expr::Box(_binding_0, ) => {
786 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400787 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400788 )
789 }
David Tolnay6702ade2017-12-30 23:38:15 -0500790 Expr::InPlace(_binding_0, ) => {
791 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400792 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400793 )
794 }
David Tolnay6702ade2017-12-30 23:38:15 -0500795 Expr::Array(_binding_0, ) => {
796 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400797 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400798 )
799 }
David Tolnay6702ade2017-12-30 23:38:15 -0500800 Expr::Call(_binding_0, ) => {
801 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400802 _visitor.fold_expr_call(_binding_0),
803 )
804 }
David Tolnay6702ade2017-12-30 23:38:15 -0500805 Expr::MethodCall(_binding_0, ) => {
806 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400807 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400808 )
809 }
David Tolnay6702ade2017-12-30 23:38:15 -0500810 Expr::Tuple(_binding_0, ) => {
811 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500812 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400813 )
814 }
David Tolnay6702ade2017-12-30 23:38:15 -0500815 Expr::Binary(_binding_0, ) => {
816 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400817 _visitor.fold_expr_binary(_binding_0),
818 )
819 }
David Tolnay6702ade2017-12-30 23:38:15 -0500820 Expr::Unary(_binding_0, ) => {
821 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400822 _visitor.fold_expr_unary(_binding_0),
823 )
824 }
David Tolnay6702ade2017-12-30 23:38:15 -0500825 Expr::Lit(_binding_0, ) => {
826 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500827 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400828 )
829 }
David Tolnay6702ade2017-12-30 23:38:15 -0500830 Expr::Cast(_binding_0, ) => {
831 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400832 _visitor.fold_expr_cast(_binding_0),
833 )
834 }
David Tolnay6702ade2017-12-30 23:38:15 -0500835 Expr::Type(_binding_0, ) => {
836 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500837 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400838 )
839 }
David Tolnay6702ade2017-12-30 23:38:15 -0500840 Expr::If(_binding_0, ) => {
841 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400842 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400843 )
844 }
David Tolnay6702ade2017-12-30 23:38:15 -0500845 Expr::IfLet(_binding_0, ) => {
846 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400847 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400848 )
849 }
David Tolnay6702ade2017-12-30 23:38:15 -0500850 Expr::While(_binding_0, ) => {
851 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400852 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400853 )
854 }
David Tolnay6702ade2017-12-30 23:38:15 -0500855 Expr::WhileLet(_binding_0, ) => {
856 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400857 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400858 )
859 }
David Tolnay6702ade2017-12-30 23:38:15 -0500860 Expr::ForLoop(_binding_0, ) => {
861 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400862 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400863 )
864 }
David Tolnay6702ade2017-12-30 23:38:15 -0500865 Expr::Loop(_binding_0, ) => {
866 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400867 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400868 )
869 }
David Tolnay6702ade2017-12-30 23:38:15 -0500870 Expr::Match(_binding_0, ) => {
871 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400872 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400873 )
874 }
David Tolnay6702ade2017-12-30 23:38:15 -0500875 Expr::Closure(_binding_0, ) => {
876 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400877 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400878 )
879 }
David Tolnay6702ade2017-12-30 23:38:15 -0500880 Expr::Unsafe(_binding_0, ) => {
881 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500882 full!(_visitor.fold_expr_unsafe(_binding_0)),
883 )
884 }
David Tolnay6702ade2017-12-30 23:38:15 -0500885 Expr::Block(_binding_0, ) => {
886 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400887 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400888 )
889 }
David Tolnay6702ade2017-12-30 23:38:15 -0500890 Expr::Assign(_binding_0, ) => {
891 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400892 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400893 )
894 }
David Tolnay6702ade2017-12-30 23:38:15 -0500895 Expr::AssignOp(_binding_0, ) => {
896 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400897 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400898 )
899 }
David Tolnay6702ade2017-12-30 23:38:15 -0500900 Expr::Field(_binding_0, ) => {
901 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400902 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400903 )
904 }
David Tolnay6702ade2017-12-30 23:38:15 -0500905 Expr::Index(_binding_0, ) => {
906 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400907 _visitor.fold_expr_index(_binding_0),
908 )
909 }
David Tolnay6702ade2017-12-30 23:38:15 -0500910 Expr::Range(_binding_0, ) => {
911 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400912 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400913 )
914 }
David Tolnay6702ade2017-12-30 23:38:15 -0500915 Expr::Path(_binding_0, ) => {
916 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400917 _visitor.fold_expr_path(_binding_0),
918 )
919 }
David Tolnay00674ba2018-03-31 18:14:11 +0200920 Expr::Reference(_binding_0, ) => {
921 Expr::Reference (
922 full!(_visitor.fold_expr_reference(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400923 )
924 }
David Tolnay6702ade2017-12-30 23:38:15 -0500925 Expr::Break(_binding_0, ) => {
926 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400927 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 )
929 }
David Tolnay6702ade2017-12-30 23:38:15 -0500930 Expr::Continue(_binding_0, ) => {
931 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400932 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400933 )
934 }
David Tolnay6702ade2017-12-30 23:38:15 -0500935 Expr::Return(_binding_0, ) => {
936 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500937 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400938 )
939 }
David Tolnay6702ade2017-12-30 23:38:15 -0500940 Expr::Macro(_binding_0, ) => {
941 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500942 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400943 )
944 }
David Tolnay6702ade2017-12-30 23:38:15 -0500945 Expr::Struct(_binding_0, ) => {
946 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400947 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400948 )
949 }
David Tolnay6702ade2017-12-30 23:38:15 -0500950 Expr::Repeat(_binding_0, ) => {
951 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400952 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400953 )
954 }
David Tolnay6702ade2017-12-30 23:38:15 -0500955 Expr::Paren(_binding_0, ) => {
956 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800957 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400958 )
959 }
David Tolnay6702ade2017-12-30 23:38:15 -0500960 Expr::Group(_binding_0, ) => {
961 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500962 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400963 )
964 }
David Tolnay6702ade2017-12-30 23:38:15 -0500965 Expr::Try(_binding_0, ) => {
966 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400967 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400968 )
969 }
David Tolnay6702ade2017-12-30 23:38:15 -0500970 Expr::Catch(_binding_0, ) => {
971 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400972 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400973 )
974 }
David Tolnay6702ade2017-12-30 23:38:15 -0500975 Expr::Yield(_binding_0, ) => {
976 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400977 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400978 )
979 }
David Tolnay6702ade2017-12-30 23:38:15 -0500980 Expr::Verbatim(_binding_0, ) => {
981 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500982 _visitor.fold_expr_verbatim(_binding_0),
983 )
984 }
Nika Layzell27726662017-10-24 23:16:35 -0400985 }
986}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800987# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800988pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500989 ExprArray {
990 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
991 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500992 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500993 }
994}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800995# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800996pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -0500997 ExprAssign {
998 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
999 left: Box::new(_visitor.fold_expr(* _i . left)),
1000 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1001 right: Box::new(_visitor.fold_expr(* _i . right)),
1002 }
1003}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001004# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001005pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001006 ExprAssignOp {
1007 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1008 left: Box::new(_visitor.fold_expr(* _i . left)),
1009 op: _visitor.fold_bin_op(_i . op),
1010 right: Box::new(_visitor.fold_expr(* _i . right)),
1011 }
1012}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001013# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001014pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001015 ExprBinary {
1016 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1017 left: Box::new(_visitor.fold_expr(* _i . left)),
1018 op: _visitor.fold_bin_op(_i . op),
1019 right: Box::new(_visitor.fold_expr(* _i . right)),
1020 }
1021}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001022# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001023pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001024 ExprBlock {
1025 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1026 block: _visitor.fold_block(_i . block),
1027 }
1028}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001029# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001030pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001031 ExprBox {
1032 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1033 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1034 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1035 }
1036}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001037# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001038pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001039 ExprBreak {
1040 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1041 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1042 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1043 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1044 }
1045}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001046# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001047pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001048 ExprCall {
1049 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1050 func: Box::new(_visitor.fold_expr(* _i . func)),
1051 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1052 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1053 }
1054}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001055# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001056pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001057 ExprCast {
1058 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1059 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1060 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1061 ty: Box::new(_visitor.fold_type(* _i . ty)),
1062 }
1063}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001064# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001065pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001066 ExprCatch {
1067 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1068 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1069 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1070 block: _visitor.fold_block(_i . block),
1071 }
1072}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001073# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001074pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001075 ExprClosure {
1076 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay13d4c0e2018-03-31 20:53:59 +02001077 movability: (_i . movability).map(|it| { Token ! [ static ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001078 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001079 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1080 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1081 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1082 output: _visitor.fold_return_type(_i . output),
1083 body: Box::new(_visitor.fold_expr(* _i . body)),
1084 }
1085}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001086# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001087pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001088 ExprContinue {
1089 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1090 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1091 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1092 }
1093}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001094# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001095pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001096 ExprField {
1097 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1098 base: Box::new(_visitor.fold_expr(* _i . base)),
1099 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1100 member: _visitor.fold_member(_i . member),
1101 }
1102}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001103# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001104pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001105 ExprForLoop {
1106 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001107 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001108 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1109 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1110 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1111 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1112 body: _visitor.fold_block(_i . body),
1113 }
1114}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001115# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001116pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001117 ExprGroup {
1118 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1119 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1120 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1121 }
1122}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001123# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001124pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001125 ExprIf {
1126 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1127 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1128 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001129 then_branch: _visitor.fold_block(_i . then_branch),
1130 else_branch: (_i . else_branch).map(|it| { (
1131 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1132 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1133 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001134 }
1135}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001136# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001137pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001138 ExprIfLet {
1139 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1140 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1141 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001142 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001143 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1144 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001145 then_branch: _visitor.fold_block(_i . then_branch),
1146 else_branch: (_i . else_branch).map(|it| { (
1147 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1148 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1149 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001150 }
1151}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001152# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001153pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001154 ExprInPlace {
1155 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1156 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001157 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001158 value: Box::new(_visitor.fold_expr(* _i . value)),
1159 }
1160}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001161# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001162pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001163 ExprIndex {
1164 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1165 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1166 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1167 index: Box::new(_visitor.fold_expr(* _i . index)),
1168 }
1169}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001170# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001171pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001172 ExprLit {
1173 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1174 lit: _visitor.fold_lit(_i . lit),
1175 }
1176}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001177# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001178pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001179 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001180 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001181 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001182 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1183 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
1185}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001186# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001187pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001188 ExprMacro {
1189 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1190 mac: _visitor.fold_macro(_i . mac),
1191 }
1192}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001193# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001194pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001195 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001196 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001197 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001198 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001199 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001200 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1201 }
1202}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001203# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001204pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001207 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001208 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001209 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001210 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001211 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1212 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001213 }
1214}
David Tolnay81ab4f62018-01-27 19:02:51 -08001215# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001216pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001218 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001219 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001220 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
1222}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001223# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001224pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001225 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001226 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001227 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001228 path: _visitor.fold_path(_i . path),
1229 }
1230}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001231# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001232pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001233 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001234 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001235 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001237 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001240# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +02001241pub fn fold_expr_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReference) -> ExprReference {
1242 ExprReference {
1243 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1244 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1245 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1246 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1247 }
1248}
1249# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001250pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001251 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001252 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001253 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001254 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001255 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001256 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
1258}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001259# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001260pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001261 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001262 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001263 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001264 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001265 }
1266}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001267# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001268pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001269 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001270 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001271 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001272 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001273 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1274 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1275 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001276 }
1277}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001278# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001279pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001280 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001281 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001282 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001283 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
1285}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001286# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001287pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001288 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001289 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001290 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001291 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001292 }
1293}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001294# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001295pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001296 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001297 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001298 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001299 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001300 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001301 }
1302}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001303# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001304pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001305 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001306 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001307 op: _visitor.fold_un_op(_i . op),
1308 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1309 }
1310}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001311# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001312pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001313 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001314 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001315 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001316 block: _visitor.fold_block(_i . block),
1317 }
1318}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001319# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001320pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001321 ExprVerbatim {
1322 tts: _i . tts,
1323 }
1324}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001325# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001326pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001327 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001328 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001329 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001330 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001331 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1332 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001333 }
1334}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001335# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001336pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001337 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001338 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001339 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001340 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1341 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001342 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001343 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001344 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1345 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001346 }
1347}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001348# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001349pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001350 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001351 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001352 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001353 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001354 }
1355}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001356# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001357pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001358 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001359 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001360 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001361 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001362 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001363 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001364 }
1365}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001366# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001367pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001368 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001369 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001370 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001371 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001372 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001373 }
1374}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001375# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001376pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001377 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001378 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1379 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001380 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001381 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001382 }
1383}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001384# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001385pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001386 match _i {
1387 Fields::Named(_binding_0, ) => {
1388 Fields::Named (
1389 _visitor.fold_fields_named(_binding_0),
1390 )
1391 }
1392 Fields::Unnamed(_binding_0, ) => {
1393 Fields::Unnamed (
1394 _visitor.fold_fields_unnamed(_binding_0),
1395 )
1396 }
1397 Fields::Unit => { Fields::Unit }
1398 }
1399}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001400# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001401pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001402 FieldsNamed {
1403 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001404 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001405 }
1406}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001407# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001408pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001409 FieldsUnnamed {
1410 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001411 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001412 }
1413}
Nika Layzell27726662017-10-24 23:16:35 -04001414# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001415pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001416 File {
1417 shebang: _i . shebang,
1418 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1419 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1420 }
1421}
1422# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001423pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001424 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001425 FnArg::SelfRef(_binding_0, ) => {
1426 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001427 _visitor.fold_arg_self_ref(_binding_0),
1428 )
1429 }
David Tolnay6702ade2017-12-30 23:38:15 -05001430 FnArg::SelfValue(_binding_0, ) => {
1431 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001432 _visitor.fold_arg_self(_binding_0),
1433 )
1434 }
David Tolnay6702ade2017-12-30 23:38:15 -05001435 FnArg::Captured(_binding_0, ) => {
1436 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001437 _visitor.fold_arg_captured(_binding_0),
1438 )
1439 }
David Tolnay6702ade2017-12-30 23:38:15 -05001440 FnArg::Inferred(_binding_0, ) => {
1441 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001442 _visitor.fold_pat(_binding_0),
1443 )
1444 }
David Tolnay6702ade2017-12-30 23:38:15 -05001445 FnArg::Ignored(_binding_0, ) => {
1446 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001447 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001448 )
1449 }
1450 }
1451}
1452# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001453pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001454 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001455 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001456 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001457 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001458 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001459 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001460 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001461 }
1462}
1463# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001464pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001465 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001466 ForeignItem::Fn(_binding_0, ) => {
1467 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001468 _visitor.fold_foreign_item_fn(_binding_0),
1469 )
1470 }
David Tolnay6702ade2017-12-30 23:38:15 -05001471 ForeignItem::Static(_binding_0, ) => {
1472 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001473 _visitor.fold_foreign_item_static(_binding_0),
1474 )
1475 }
David Tolnay6702ade2017-12-30 23:38:15 -05001476 ForeignItem::Type(_binding_0, ) => {
1477 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001478 _visitor.fold_foreign_item_type(_binding_0),
1479 )
1480 }
David Tolnay6702ade2017-12-30 23:38:15 -05001481 ForeignItem::Verbatim(_binding_0, ) => {
1482 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001483 _visitor.fold_foreign_item_verbatim(_binding_0),
1484 )
1485 }
Nika Layzell27726662017-10-24 23:16:35 -04001486 }
1487}
1488# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001489pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001490 ForeignItemFn {
1491 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1492 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001493 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001494 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001495 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001496 }
1497}
1498# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001499pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001500 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001501 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1502 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001503 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001504 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001505 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001506 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001507 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001508 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001509 }
1510}
David Tolnay199bcbb2017-11-12 10:33:52 -08001511# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001512pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001513 ForeignItemType {
1514 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1515 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001516 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001517 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001518 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001519 }
1520}
David Tolnay2ae520a2017-12-29 11:19:50 -05001521# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001522pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001523 ForeignItemVerbatim {
1524 tts: _i . tts,
1525 }
1526}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001527# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001528pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001529 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001530 GenericArgument::Lifetime(_binding_0, ) => {
1531 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001532 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001533 )
1534 }
David Tolnay6702ade2017-12-30 23:38:15 -05001535 GenericArgument::Type(_binding_0, ) => {
1536 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001537 _visitor.fold_type(_binding_0),
1538 )
1539 }
David Tolnay6702ade2017-12-30 23:38:15 -05001540 GenericArgument::Binding(_binding_0, ) => {
1541 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001542 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001543 )
1544 }
David Tolnay6702ade2017-12-30 23:38:15 -05001545 GenericArgument::Const(_binding_0, ) => {
1546 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001547 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001548 )
1549 }
Nika Layzell357885a2017-12-04 15:47:07 -05001550 }
1551}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001552# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001553pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001554 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001555 GenericMethodArgument::Type(_binding_0, ) => {
1556 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001557 _visitor.fold_type(_binding_0),
1558 )
1559 }
David Tolnay6702ade2017-12-30 23:38:15 -05001560 GenericMethodArgument::Const(_binding_0, ) => {
1561 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001562 _visitor.fold_expr(_binding_0),
1563 )
1564 }
1565 }
1566}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001567# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001568pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001569 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001570 GenericParam::Type(_binding_0, ) => {
1571 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001572 _visitor.fold_type_param(_binding_0),
1573 )
1574 }
David Tolnay517f3692018-01-01 20:17:23 -08001575 GenericParam::Lifetime(_binding_0, ) => {
1576 GenericParam::Lifetime (
1577 _visitor.fold_lifetime_def(_binding_0),
1578 )
1579 }
David Tolnay6702ade2017-12-30 23:38:15 -05001580 GenericParam::Const(_binding_0, ) => {
1581 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001582 _visitor.fold_const_param(_binding_0),
1583 )
1584 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001585 }
1586}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001587# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001588pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001589 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001590 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001591 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001592 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001593 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001594 }
1595}
Alex Crichtond261d092018-05-18 13:47:35 -07001596
1597pub fn fold_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay18837692018-05-20 20:17:20 -07001598 Ident::new(&_i.to_string(), _visitor.fold_span(_i.span()))
Alex Crichtond261d092018-05-18 13:47:35 -07001599}
Nika Layzell27726662017-10-24 23:16:35 -04001600# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001601pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001602 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001603 ImplItem::Const(_binding_0, ) => {
1604 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001605 _visitor.fold_impl_item_const(_binding_0),
1606 )
1607 }
David Tolnay6702ade2017-12-30 23:38:15 -05001608 ImplItem::Method(_binding_0, ) => {
1609 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001610 _visitor.fold_impl_item_method(_binding_0),
1611 )
1612 }
David Tolnay6702ade2017-12-30 23:38:15 -05001613 ImplItem::Type(_binding_0, ) => {
1614 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001615 _visitor.fold_impl_item_type(_binding_0),
1616 )
1617 }
David Tolnay6702ade2017-12-30 23:38:15 -05001618 ImplItem::Macro(_binding_0, ) => {
1619 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001620 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001621 )
1622 }
David Tolnay6702ade2017-12-30 23:38:15 -05001623 ImplItem::Verbatim(_binding_0, ) => {
1624 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001625 _visitor.fold_impl_item_verbatim(_binding_0),
1626 )
1627 }
Nika Layzell27726662017-10-24 23:16:35 -04001628 }
1629}
1630# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001631pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001632 ImplItemConst {
1633 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1634 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001635 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001636 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001637 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001638 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001639 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001640 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001641 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001642 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001643 }
1644}
1645# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001646pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001647 ImplItemMacro {
1648 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1649 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001650 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001651 }
1652}
1653# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001654pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001655 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001656 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001657 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001658 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001659 sig: _visitor.fold_method_sig(_i . sig),
1660 block: _visitor.fold_block(_i . block),
1661 }
1662}
1663# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001664pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001665 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001666 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001667 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001668 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001669 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001670 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001671 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001672 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001673 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001674 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001675 }
1676}
David Tolnay2ae520a2017-12-29 11:19:50 -05001677# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001678pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001679 ImplItemVerbatim {
1680 tts: _i . tts,
1681 }
1682}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001683# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001684pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001685 Index {
1686 index: _i . index,
1687 span: _visitor.fold_span(_i . span),
1688 }
1689}
1690# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001691pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001692 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001693 Item::ExternCrate(_binding_0, ) => {
1694 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001695 _visitor.fold_item_extern_crate(_binding_0),
1696 )
1697 }
David Tolnay6702ade2017-12-30 23:38:15 -05001698 Item::Use(_binding_0, ) => {
1699 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001700 _visitor.fold_item_use(_binding_0),
1701 )
1702 }
David Tolnay6702ade2017-12-30 23:38:15 -05001703 Item::Static(_binding_0, ) => {
1704 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001705 _visitor.fold_item_static(_binding_0),
1706 )
1707 }
David Tolnay6702ade2017-12-30 23:38:15 -05001708 Item::Const(_binding_0, ) => {
1709 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001710 _visitor.fold_item_const(_binding_0),
1711 )
1712 }
David Tolnay6702ade2017-12-30 23:38:15 -05001713 Item::Fn(_binding_0, ) => {
1714 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001715 _visitor.fold_item_fn(_binding_0),
1716 )
1717 }
David Tolnay6702ade2017-12-30 23:38:15 -05001718 Item::Mod(_binding_0, ) => {
1719 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001720 _visitor.fold_item_mod(_binding_0),
1721 )
1722 }
David Tolnay6702ade2017-12-30 23:38:15 -05001723 Item::ForeignMod(_binding_0, ) => {
1724 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001725 _visitor.fold_item_foreign_mod(_binding_0),
1726 )
1727 }
David Tolnay6702ade2017-12-30 23:38:15 -05001728 Item::Type(_binding_0, ) => {
1729 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001730 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001731 )
1732 }
David Tolnay6702ade2017-12-30 23:38:15 -05001733 Item::Struct(_binding_0, ) => {
1734 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001735 _visitor.fold_item_struct(_binding_0),
1736 )
1737 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001738 Item::Enum(_binding_0, ) => {
1739 Item::Enum (
1740 _visitor.fold_item_enum(_binding_0),
1741 )
1742 }
David Tolnay6702ade2017-12-30 23:38:15 -05001743 Item::Union(_binding_0, ) => {
1744 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001745 _visitor.fold_item_union(_binding_0),
1746 )
1747 }
David Tolnay6702ade2017-12-30 23:38:15 -05001748 Item::Trait(_binding_0, ) => {
1749 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001750 _visitor.fold_item_trait(_binding_0),
1751 )
1752 }
David Tolnay6702ade2017-12-30 23:38:15 -05001753 Item::Impl(_binding_0, ) => {
1754 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001755 _visitor.fold_item_impl(_binding_0),
1756 )
1757 }
David Tolnay6702ade2017-12-30 23:38:15 -05001758 Item::Macro(_binding_0, ) => {
1759 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001760 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001761 )
1762 }
David Tolnay6702ade2017-12-30 23:38:15 -05001763 Item::Macro2(_binding_0, ) => {
1764 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001765 _visitor.fold_item_macro2(_binding_0),
1766 )
1767 }
David Tolnay6702ade2017-12-30 23:38:15 -05001768 Item::Verbatim(_binding_0, ) => {
1769 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001770 _visitor.fold_item_verbatim(_binding_0),
1771 )
1772 }
Nika Layzell27726662017-10-24 23:16:35 -04001773 }
1774}
1775# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001776pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 ItemConst {
1778 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1779 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001781 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001782 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001783 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001786 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001787 }
1788}
1789# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001790pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 ItemEnum {
1792 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1793 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001794 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001795 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001797 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001798 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1799 }
1800}
1801# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001802pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001803 ItemExternCrate {
1804 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1805 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1807 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001808 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001809 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001811 _visitor.fold_ident(( it ) . 1),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001812 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001813 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001814 }
1815}
1816# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001817pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001818 ItemFn {
1819 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1820 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001821 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001822 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001823 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001824 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001825 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001826 block: Box::new(_visitor.fold_block(* _i . block)),
1827 }
1828}
1829# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001830pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001831 ItemForeignMod {
1832 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1833 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001834 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1836 }
1837}
1838# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001839pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001840 ItemImpl {
1841 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001842 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001843 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001844 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001845 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001846 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001847 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001848 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001849 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001850 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001851 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001852 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1854 }
1855}
1856# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001857pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001858 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001859 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001860 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001861 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001862 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001863 }
1864}
1865# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001866pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001867 ItemMacro2 {
1868 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1869 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001870 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001871 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001872 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001873 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001874 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001875 body: _i . body,
1876 }
1877}
1878# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001879pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001880 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001881 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001882 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001884 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001885 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001886 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001887 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1888 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 }
1891}
1892# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001893pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001894 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001895 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001896 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001897 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001898 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001899 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001900 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001901 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001903 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001904 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001905 }
1906}
1907# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001908pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001909 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001910 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001911 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001912 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001913 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001914 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001915 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001917 }
1918}
1919# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001920pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001921 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001922 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001923 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001924 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001925 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1926 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001927 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001928 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001929 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001930 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001931 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001932 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1933 }
1934}
1935# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001936pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001937 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001938 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001939 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001940 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001941 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001942 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001943 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001944 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001945 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001946 }
1947}
1948# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001949pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001950 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001951 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001952 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001953 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001954 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001955 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001956 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001957 }
1958}
1959# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001960pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001961 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001962 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001963 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001964 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1965 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001966 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001967 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001968 }
1969}
David Tolnay2ae520a2017-12-29 11:19:50 -05001970# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001971pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001972 ItemVerbatim {
1973 tts: _i . tts,
1974 }
1975}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001976# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001977pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001978 Label {
1979 name: _visitor.fold_lifetime(_i . name),
1980 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1981 }
1982}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001983# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Alex Crichton131308c2018-05-18 14:00:24 -07001984pub fn fold_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1985 Lifetime {
1986 apostrophe: _i . apostrophe,
1987 ident: _visitor.fold_ident(_i . ident),
1988 }
1989}
1990# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001991pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001992 LifetimeDef {
1993 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001994 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001995 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001996 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1997 }
1998}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001999# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002000pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08002001 match _i {
2002 Lit::Str(_binding_0, ) => {
2003 Lit::Str (
2004 _visitor.fold_lit_str(_binding_0),
2005 )
2006 }
2007 Lit::ByteStr(_binding_0, ) => {
2008 Lit::ByteStr (
2009 _visitor.fold_lit_byte_str(_binding_0),
2010 )
2011 }
2012 Lit::Byte(_binding_0, ) => {
2013 Lit::Byte (
2014 _visitor.fold_lit_byte(_binding_0),
2015 )
2016 }
2017 Lit::Char(_binding_0, ) => {
2018 Lit::Char (
2019 _visitor.fold_lit_char(_binding_0),
2020 )
2021 }
2022 Lit::Int(_binding_0, ) => {
2023 Lit::Int (
2024 _visitor.fold_lit_int(_binding_0),
2025 )
2026 }
2027 Lit::Float(_binding_0, ) => {
2028 Lit::Float (
2029 _visitor.fold_lit_float(_binding_0),
2030 )
2031 }
2032 Lit::Bool(_binding_0, ) => {
2033 Lit::Bool (
2034 _visitor.fold_lit_bool(_binding_0),
2035 )
2036 }
2037 Lit::Verbatim(_binding_0, ) => {
2038 Lit::Verbatim (
2039 _visitor.fold_lit_verbatim(_binding_0),
2040 )
2041 }
2042 }
2043}
2044# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002045pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002046 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002047 value: _i . value,
2048 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002049 }
2050}
David Tolnay360efd22018-01-04 23:35:26 -08002051# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002052pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002053 LitVerbatim {
2054 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002055 }
2056}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002057# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002058pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002059 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002060 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002061 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02002062 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -05002063 ty: (_i . ty).map(|it| { (
2064 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2065 Box::new(_visitor.fold_type(* ( it ) . 1)),
2066 ) }),
2067 init: (_i . init).map(|it| { (
2068 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2069 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2070 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002071 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002072 }
2073}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002074# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002075pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002076 Macro {
2077 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002078 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002079 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2080 tts: _i . tts,
2081 }
2082}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002083# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002084pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002085 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002086 MacroDelimiter::Paren(_binding_0, ) => {
2087 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002088 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2089 )
2090 }
David Tolnay6702ade2017-12-30 23:38:15 -05002091 MacroDelimiter::Brace(_binding_0, ) => {
2092 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002093 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2094 )
2095 }
David Tolnay6702ade2017-12-30 23:38:15 -05002096 MacroDelimiter::Bracket(_binding_0, ) => {
2097 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002098 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2099 )
2100 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002101 }
2102}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002103# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002104pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002105 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002106 Member::Named(_binding_0, ) => {
2107 Member::Named (
Alex Crichtond261d092018-05-18 13:47:35 -07002108 _visitor.fold_ident(_binding_0),
David Tolnay85b69a42017-12-27 20:43:10 -05002109 )
2110 }
David Tolnay6702ade2017-12-30 23:38:15 -05002111 Member::Unnamed(_binding_0, ) => {
2112 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002113 _visitor.fold_index(_binding_0),
2114 )
2115 }
2116 }
2117}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002118# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002119pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002120 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002121 Meta::Word(_binding_0, ) => {
2122 Meta::Word (
Alex Crichtond261d092018-05-18 13:47:35 -07002123 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002124 )
2125 }
David Tolnayaaadd782018-01-06 22:58:13 -08002126 Meta::List(_binding_0, ) => {
2127 Meta::List (
2128 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002129 )
2130 }
David Tolnayaaadd782018-01-06 22:58:13 -08002131 Meta::NameValue(_binding_0, ) => {
2132 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002133 _visitor.fold_meta_name_value(_binding_0),
2134 )
2135 }
2136 }
2137}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002138# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002139pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2140 MetaList {
Alex Crichtond261d092018-05-18 13:47:35 -07002141 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002142 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002143 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002144 }
2145}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002146# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002147pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002148 MetaNameValue {
Alex Crichtond261d092018-05-18 13:47:35 -07002149 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002150 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002151 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002152 }
2153}
2154# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002155pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002156 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002157 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002158 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002159 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002160 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002161 decl: _visitor.fold_fn_decl(_i . decl),
2162 }
2163}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002164# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002165pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002166 MethodTurbofish {
2167 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2168 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2169 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2170 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2171 }
2172}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002173# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002174pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002175 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002176 NestedMeta::Meta(_binding_0, ) => {
2177 NestedMeta::Meta (
2178 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002179 )
2180 }
David Tolnayaaadd782018-01-06 22:58:13 -08002181 NestedMeta::Literal(_binding_0, ) => {
2182 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002183 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002184 )
2185 }
2186 }
2187}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002188# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002189pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002190 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002191 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002192 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002193 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002194 }
2195}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002196# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002197pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002198 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002199 Pat::Wild(_binding_0, ) => {
2200 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002201 _visitor.fold_pat_wild(_binding_0),
2202 )
2203 }
David Tolnay6702ade2017-12-30 23:38:15 -05002204 Pat::Ident(_binding_0, ) => {
2205 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002206 _visitor.fold_pat_ident(_binding_0),
2207 )
2208 }
David Tolnay6702ade2017-12-30 23:38:15 -05002209 Pat::Struct(_binding_0, ) => {
2210 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002211 _visitor.fold_pat_struct(_binding_0),
2212 )
2213 }
David Tolnay6702ade2017-12-30 23:38:15 -05002214 Pat::TupleStruct(_binding_0, ) => {
2215 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002216 _visitor.fold_pat_tuple_struct(_binding_0),
2217 )
2218 }
David Tolnay6702ade2017-12-30 23:38:15 -05002219 Pat::Path(_binding_0, ) => {
2220 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002221 _visitor.fold_pat_path(_binding_0),
2222 )
2223 }
David Tolnay6702ade2017-12-30 23:38:15 -05002224 Pat::Tuple(_binding_0, ) => {
2225 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002226 _visitor.fold_pat_tuple(_binding_0),
2227 )
2228 }
David Tolnay6702ade2017-12-30 23:38:15 -05002229 Pat::Box(_binding_0, ) => {
2230 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002231 _visitor.fold_pat_box(_binding_0),
2232 )
2233 }
David Tolnay6702ade2017-12-30 23:38:15 -05002234 Pat::Ref(_binding_0, ) => {
2235 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002236 _visitor.fold_pat_ref(_binding_0),
2237 )
2238 }
David Tolnay6702ade2017-12-30 23:38:15 -05002239 Pat::Lit(_binding_0, ) => {
2240 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002241 _visitor.fold_pat_lit(_binding_0),
2242 )
2243 }
David Tolnay6702ade2017-12-30 23:38:15 -05002244 Pat::Range(_binding_0, ) => {
2245 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002246 _visitor.fold_pat_range(_binding_0),
2247 )
2248 }
David Tolnay6702ade2017-12-30 23:38:15 -05002249 Pat::Slice(_binding_0, ) => {
2250 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002251 _visitor.fold_pat_slice(_binding_0),
2252 )
2253 }
David Tolnay6702ade2017-12-30 23:38:15 -05002254 Pat::Macro(_binding_0, ) => {
2255 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002256 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002257 )
2258 }
David Tolnay6702ade2017-12-30 23:38:15 -05002259 Pat::Verbatim(_binding_0, ) => {
2260 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002261 _visitor.fold_pat_verbatim(_binding_0),
2262 )
2263 }
Nika Layzell27726662017-10-24 23:16:35 -04002264 }
2265}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002266# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002267pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002268 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002269 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002270 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002271 }
2272}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002273# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002274pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002275 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002276 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2277 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002278 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002279 subpat: (_i . subpat).map(|it| { (
2280 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2281 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2282 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002283 }
2284}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002285# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002286pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002287 PatLit {
2288 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2289 }
2290}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002291# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002292pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002293 PatMacro {
2294 mac: _visitor.fold_macro(_i . mac),
2295 }
2296}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002297# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002298pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002299 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002300 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002301 path: _visitor.fold_path(_i . path),
2302 }
2303}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002305pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002306 PatRange {
2307 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002308 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002309 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002310 }
2311}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002312# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002313pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002314 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002315 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002316 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002317 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002318 }
2319}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002321pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002322 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002323 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002324 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002325 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002326 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002327 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002328 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002329 }
2330}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002331# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002332pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002333 PatStruct {
2334 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002335 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002336 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002337 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002338 }
2339}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002340# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002341pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002342 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002343 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002344 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002345 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002346 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2347 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002348 }
2349}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002350# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002351pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002352 PatTupleStruct {
2353 path: _visitor.fold_path(_i . path),
2354 pat: _visitor.fold_pat_tuple(_i . pat),
2355 }
2356}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002357# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002358pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002359 PatVerbatim {
2360 tts: _i . tts,
2361 }
2362}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002363# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002364pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002365 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002366 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002367 }
2368}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002369# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002370pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002371 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002372 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002373 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2374 }
2375}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002376# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002377pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002378 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002379 PathArguments::None => { PathArguments::None }
2380 PathArguments::AngleBracketed(_binding_0, ) => {
2381 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002382 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2383 )
2384 }
David Tolnay6702ade2017-12-30 23:38:15 -05002385 PathArguments::Parenthesized(_binding_0, ) => {
2386 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002387 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2388 )
2389 }
2390 }
2391}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002392# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002393pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002394 PathSegment {
Alex Crichtond261d092018-05-18 13:47:35 -07002395 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002396 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002397 }
2398}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002399# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002400pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002401 PredicateEq {
2402 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2403 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2404 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2405 }
2406}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002407# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002408pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002409 PredicateLifetime {
2410 lifetime: _visitor.fold_lifetime(_i . lifetime),
2411 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2412 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2413 }
2414}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002415# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002416pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002417 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002418 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002419 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2420 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2421 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2422 }
2423}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002424# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002425pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002426 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002428 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002429 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002430 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2431 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002432 }
2433}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002434# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002435pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002436 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002437 RangeLimits::HalfOpen(_binding_0, ) => {
2438 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002439 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
David Tolnay6702ade2017-12-30 23:38:15 -05002442 RangeLimits::Closed(_binding_0, ) => {
2443 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002444 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002445 )
2446 }
2447 }
2448}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002449# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002450pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002451 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002452 ReturnType::Default => { ReturnType::Default }
2453 ReturnType::Type(_binding_0, _binding_1, ) => {
2454 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002455 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2456 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002457 )
2458 }
2459 }
2460}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002461
David Tolnay4b4c4b62018-01-06 13:48:05 -08002462pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002463 _i
2464}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002465# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002466pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002467 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002468 Stmt::Local(_binding_0, ) => {
2469 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002470 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002471 )
2472 }
David Tolnay6702ade2017-12-30 23:38:15 -05002473 Stmt::Item(_binding_0, ) => {
2474 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002475 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
David Tolnay6702ade2017-12-30 23:38:15 -05002478 Stmt::Expr(_binding_0, ) => {
2479 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002480 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
David Tolnay6702ade2017-12-30 23:38:15 -05002483 Stmt::Semi(_binding_0, _binding_1, ) => {
2484 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002485 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002486 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002487 )
2488 }
Nika Layzell27726662017-10-24 23:16:35 -04002489 }
2490}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002491# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002492pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002493 TraitBound {
David Tolnayc1f5d5d2018-03-31 22:17:56 +02002494 paren_token: (_i . paren_token).map(|it| { Paren(tokens_helper(_visitor, &(it).0)) }),
David Tolnay40fb8ce2018-01-02 10:53:46 -08002495 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2496 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2497 path: _visitor.fold_path(_i . path),
2498 }
2499}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002500# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002501pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002502 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002503 TraitBoundModifier::None => { TraitBoundModifier::None }
2504 TraitBoundModifier::Maybe(_binding_0, ) => {
2505 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002506 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002507 )
2508 }
2509 }
2510}
2511# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002512pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002513 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002514 TraitItem::Const(_binding_0, ) => {
2515 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002516 _visitor.fold_trait_item_const(_binding_0),
2517 )
2518 }
David Tolnay6702ade2017-12-30 23:38:15 -05002519 TraitItem::Method(_binding_0, ) => {
2520 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002521 _visitor.fold_trait_item_method(_binding_0),
2522 )
2523 }
David Tolnay6702ade2017-12-30 23:38:15 -05002524 TraitItem::Type(_binding_0, ) => {
2525 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002526 _visitor.fold_trait_item_type(_binding_0),
2527 )
2528 }
David Tolnay6702ade2017-12-30 23:38:15 -05002529 TraitItem::Macro(_binding_0, ) => {
2530 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002531 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002532 )
2533 }
David Tolnay6702ade2017-12-30 23:38:15 -05002534 TraitItem::Verbatim(_binding_0, ) => {
2535 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002536 _visitor.fold_trait_item_verbatim(_binding_0),
2537 )
2538 }
Nika Layzell27726662017-10-24 23:16:35 -04002539 }
2540}
2541# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002542pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002543 TraitItemConst {
2544 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002545 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002546 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002548 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002549 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002550 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002551 _visitor.fold_expr(( it ) . 1),
2552 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002553 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002554 }
2555}
2556# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002557pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002558 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002559 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002560 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002562 }
2563}
2564# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002565pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002566 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002569 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002570 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002571 }
2572}
2573# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002574pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002575 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002576 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002577 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002578 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002579 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002580 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002581 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002582 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002583 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002584 _visitor.fold_type(( it ) . 1),
2585 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002586 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002587 }
2588}
David Tolnay2ae520a2017-12-29 11:19:50 -05002589# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002590pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002591 TraitItemVerbatim {
2592 tts: _i . tts,
2593 }
2594}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002595# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002596pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002597 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002598 Type::Slice(_binding_0, ) => {
2599 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002600 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002601 )
2602 }
David Tolnay6702ade2017-12-30 23:38:15 -05002603 Type::Array(_binding_0, ) => {
2604 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002605 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002606 )
2607 }
David Tolnay6702ade2017-12-30 23:38:15 -05002608 Type::Ptr(_binding_0, ) => {
2609 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002610 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002611 )
2612 }
David Tolnay6702ade2017-12-30 23:38:15 -05002613 Type::Reference(_binding_0, ) => {
2614 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002615 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002616 )
2617 }
David Tolnay6702ade2017-12-30 23:38:15 -05002618 Type::BareFn(_binding_0, ) => {
2619 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002620 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002621 )
2622 }
David Tolnay6702ade2017-12-30 23:38:15 -05002623 Type::Never(_binding_0, ) => {
2624 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002625 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002626 )
2627 }
David Tolnay6702ade2017-12-30 23:38:15 -05002628 Type::Tuple(_binding_0, ) => {
2629 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002630 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002631 )
2632 }
David Tolnay6702ade2017-12-30 23:38:15 -05002633 Type::Path(_binding_0, ) => {
2634 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002635 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002636 )
2637 }
David Tolnay6702ade2017-12-30 23:38:15 -05002638 Type::TraitObject(_binding_0, ) => {
2639 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002640 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002641 )
2642 }
David Tolnay6702ade2017-12-30 23:38:15 -05002643 Type::ImplTrait(_binding_0, ) => {
2644 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002645 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002646 )
2647 }
David Tolnay6702ade2017-12-30 23:38:15 -05002648 Type::Paren(_binding_0, ) => {
2649 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002650 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002651 )
2652 }
David Tolnay6702ade2017-12-30 23:38:15 -05002653 Type::Group(_binding_0, ) => {
2654 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002655 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002656 )
2657 }
David Tolnay6702ade2017-12-30 23:38:15 -05002658 Type::Infer(_binding_0, ) => {
2659 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002660 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002661 )
2662 }
David Tolnay6702ade2017-12-30 23:38:15 -05002663 Type::Macro(_binding_0, ) => {
2664 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002665 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002666 )
2667 }
David Tolnay6702ade2017-12-30 23:38:15 -05002668 Type::Verbatim(_binding_0, ) => {
2669 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002670 _visitor.fold_type_verbatim(_binding_0),
2671 )
2672 }
Nika Layzell27726662017-10-24 23:16:35 -04002673 }
2674}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002675# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002676pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002677 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002678 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002679 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002680 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002681 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002682 }
2683}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002684# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002685pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002686 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002687 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2688 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2689 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2690 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2691 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2692 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2693 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2694 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002695 }
2696}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002697# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002698pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002699 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002700 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002701 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002702 }
2703}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002704# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002705pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002706 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002707 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002708 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002709 }
2710}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002711# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002712pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002713 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002714 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002715 }
2716}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002717# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002718pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002719 TypeMacro {
2720 mac: _visitor.fold_macro(_i . mac),
2721 }
2722}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002723# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002724pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002725 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002726 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002727 }
2728}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002729# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002730pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002731 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002732 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002733 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002734 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002735 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002736 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002737 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002738 }
2739}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002740# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002741pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002742 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002743 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002744 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002745 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002746 )
2747 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002748 TypeParamBound::Lifetime(_binding_0, ) => {
2749 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002750 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002751 )
2752 }
2753 }
2754}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002755# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002756pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002757 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002758 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002759 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002760 }
2761}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002762# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002763pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002764 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002765 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002766 path: _visitor.fold_path(_i . path),
2767 }
2768}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002769# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002770pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002771 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002772 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2773 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002774 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2775 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002776 }
2777}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002778# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002779pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002780 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002781 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002782 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002783 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2784 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002785 }
2786}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002787# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002788pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002789 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002790 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002791 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002792 }
2793}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002794# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002795pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002796 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002797 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002798 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002799 }
2800}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002801# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002802pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002803 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002804 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002805 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002806 }
2807}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002808# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002809pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002810 TypeVerbatim {
2811 tts: _i . tts,
2812 }
2813}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002814# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002815pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002816 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002817 UnOp::Deref(_binding_0, ) => {
2818 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002819 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002820 )
2821 }
David Tolnay6702ade2017-12-30 23:38:15 -05002822 UnOp::Not(_binding_0, ) => {
2823 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002824 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002825 )
2826 }
David Tolnay6702ade2017-12-30 23:38:15 -05002827 UnOp::Neg(_binding_0, ) => {
2828 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002829 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002830 )
2831 }
2832 }
2833}
David Tolnay5f332a92017-12-26 00:42:45 -05002834# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002835pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002836 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002837 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002838 }
2839}
2840# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002841pub fn fold_use_group<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGroup) -> UseGroup {
2842 UseGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002843 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002844 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2845 }
2846}
2847# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002848pub fn fold_use_name<V: Fold + ?Sized>(_visitor: &mut V, _i: UseName) -> UseName {
2849 UseName {
Alex Crichtond261d092018-05-18 13:47:35 -07002850 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002851 }
2852}
2853# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002854pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002855 UsePath {
Alex Crichtond261d092018-05-18 13:47:35 -07002856 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002857 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2858 tree: Box::new(_visitor.fold_use_tree(* _i . tree)),
2859 }
2860}
2861# [ cfg ( feature = "full" ) ]
2862pub fn fold_use_rename<V: Fold + ?Sized>(_visitor: &mut V, _i: UseRename) -> UseRename {
2863 UseRename {
Alex Crichtond261d092018-05-18 13:47:35 -07002864 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002865 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002866 rename: _visitor.fold_ident(_i . rename),
David Tolnay5f332a92017-12-26 00:42:45 -05002867 }
2868}
2869# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002870pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002871 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002872 UseTree::Path(_binding_0, ) => {
2873 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002874 _visitor.fold_use_path(_binding_0),
2875 )
2876 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002877 UseTree::Name(_binding_0, ) => {
2878 UseTree::Name (
2879 _visitor.fold_use_name(_binding_0),
2880 )
2881 }
2882 UseTree::Rename(_binding_0, ) => {
2883 UseTree::Rename (
2884 _visitor.fold_use_rename(_binding_0),
2885 )
2886 }
David Tolnay6702ade2017-12-30 23:38:15 -05002887 UseTree::Glob(_binding_0, ) => {
2888 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002889 _visitor.fold_use_glob(_binding_0),
2890 )
2891 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002892 UseTree::Group(_binding_0, ) => {
2893 UseTree::Group (
2894 _visitor.fold_use_group(_binding_0),
David Tolnay5f332a92017-12-26 00:42:45 -05002895 )
2896 }
2897 }
2898}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002899# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002900pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002901 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002902 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002903 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002904 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002905 discriminant: (_i . discriminant).map(|it| { (
2906 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2907 _visitor.fold_expr(( it ) . 1),
2908 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002909 }
2910}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002911# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002912pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002913 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002914 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002915 }
2916}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002917# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002918pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002919 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002920 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002921 }
2922}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002923# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002924pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002925 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002926 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002927 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002928 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002929 path: Box::new(_visitor.fold_path(* _i . path)),
2930 }
2931}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002932# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002933pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002934 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002935 Visibility::Public(_binding_0, ) => {
2936 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002937 _visitor.fold_vis_public(_binding_0),
2938 )
2939 }
David Tolnay6702ade2017-12-30 23:38:15 -05002940 Visibility::Crate(_binding_0, ) => {
2941 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002942 _visitor.fold_vis_crate(_binding_0),
2943 )
2944 }
David Tolnay6702ade2017-12-30 23:38:15 -05002945 Visibility::Restricted(_binding_0, ) => {
2946 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002947 _visitor.fold_vis_restricted(_binding_0),
2948 )
2949 }
David Tolnay6702ade2017-12-30 23:38:15 -05002950 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002951 }
2952}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002953# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002954pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002955 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002956 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002957 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2958 }
2959}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002960# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002961pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002962 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002963 WherePredicate::Type(_binding_0, ) => {
2964 WherePredicate::Type (
2965 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002966 )
2967 }
David Tolnayd4add852018-01-01 20:13:24 -08002968 WherePredicate::Lifetime(_binding_0, ) => {
2969 WherePredicate::Lifetime (
2970 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002971 )
2972 }
David Tolnayd4add852018-01-01 20:13:24 -08002973 WherePredicate::Eq(_binding_0, ) => {
2974 WherePredicate::Eq (
2975 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002976 )
2977 }
2978 }
2979}
2980