blob: c9f349e0164e4930a7cb6d56c16fb5d2d0c70209 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
David Tolnay3cfd1d32018-01-03 00:22:08 -080042# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080044# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -050045fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080052# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(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_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(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_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080058# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080060# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(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_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080064# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay506e43a2017-12-29 11:34:36 -050065fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080066# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080068# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080070# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050071fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080072# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050073fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080074# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050075fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080076# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050077fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080078# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050079fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080080# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080082# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080084# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(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_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(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_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(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_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(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_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080094# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(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_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(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_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800100# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800102# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(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_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(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_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(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_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(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_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(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_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800114# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800116# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(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_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800120# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800122# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800124# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800126# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800128# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500129fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(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_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800132# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800134# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800136# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(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_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(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_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800142# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500143fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(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_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800146# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800148# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500149fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800150# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800152# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800154# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500155fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800156# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500157fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800158# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800160# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800162# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800164# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800166# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800168# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800170# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500171fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800172# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500173fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800174# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500175fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800188# [ cfg ( feature = "full" ) ]
189fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500190# [ cfg ( feature = "full" ) ]
191fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800192# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500193fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800194# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500195fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800196# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc2f1aba2017-11-12 20:29:22 -0800197fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800198# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500200
201fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800207fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500212# [ cfg ( feature = "full" ) ]
213fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800214# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500215fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800231fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800233fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800243fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500248# [ cfg ( feature = "full" ) ]
249fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800250# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -0500251fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800252# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500253fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800254# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800256# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500257fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
David Tolnay360efd22018-01-04 23:35:26 -0800258# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
259fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
260# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
261fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
262# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
263fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
264# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
265fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
266# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
267fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
268# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
269fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
270# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
271fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
272# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
273fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800274# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800276# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800277fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800278# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -0500279fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800280# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500281fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800282# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800284# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800286# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800290# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500291fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800292# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800294# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500295fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(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(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800298# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(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_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(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_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500305fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(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_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(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_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(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_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(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_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800314# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(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_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800318# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500321fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800322# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800324# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800326# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500327fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800328# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800330# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800331fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800332# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800333fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800334# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800335fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800336# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(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_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800340# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -0800341fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500342
343fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800344# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400345fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800346# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -0800347fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800348# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400349fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400351fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400353fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400354# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800355fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400356# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400357fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400358# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400359fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500360# [ cfg ( feature = "full" ) ]
361fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(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(&mut self, i: Type) -> Type { fold_type(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_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(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_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800368# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800369fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(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_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(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_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800374# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500375fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(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_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(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_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(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_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800382# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800383fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(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_path(&mut self, i: TypePath) -> TypePath { fold_type_path(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_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800388# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -0800389fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800390# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800391fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800392# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800393fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800394# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500395fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800396# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500397fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800398# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500400# [ cfg ( feature = "full" ) ]
401fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
402# [ cfg ( feature = "full" ) ]
403fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
404# [ cfg ( feature = "full" ) ]
405fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
406# [ cfg ( feature = "full" ) ]
407fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(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_variant(&mut self, i: Variant) -> Variant { fold_variant(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_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(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_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(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_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(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_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(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_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800420# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400421fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400422
Nika Layzell27726662017-10-24 23:16:35 -0400423}
424
David Tolnay360efd22018-01-04 23:35:26 -0800425macro_rules! fold_span_only {
426 ($f:ident : $t:ident) => {
427 pub fn $f<V: Folder + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
428 _i.span = _visitor.fold_span(_i.span);
429 _i
430 }
431 }
David Tolnayd0adf522017-12-29 01:30:07 -0500432}
433
David Tolnay360efd22018-01-04 23:35:26 -0800434fold_span_only!(fold_ident: Ident);
435fold_span_only!(fold_lifetime: Lifetime);
436#[cfg(any(feature = "full", feature = "derive"))]
437fold_span_only!(fold_lit_byte: LitByte);
438#[cfg(any(feature = "full", feature = "derive"))]
439fold_span_only!(fold_lit_byte_str: LitByteStr);
440#[cfg(any(feature = "full", feature = "derive"))]
441fold_span_only!(fold_lit_char: LitChar);
442#[cfg(any(feature = "full", feature = "derive"))]
443fold_span_only!(fold_lit_float: LitFloat);
444#[cfg(any(feature = "full", feature = "derive"))]
445fold_span_only!(fold_lit_int: LitInt);
446#[cfg(any(feature = "full", feature = "derive"))]
447fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500448
David Tolnay3cfd1d32018-01-03 00:22:08 -0800449# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400450pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400451 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500452 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500453 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400454 }
455}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800456# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500457pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
458 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500459 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500461 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400463 }
464}
465# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400466pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400467 ArgCaptured {
468 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500469 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800470 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400471 }
472}
473# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400475 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500476 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500477 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400478 }
479}
480# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400481pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400482 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500483 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500484 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500485 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500486 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400487 }
488}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800489# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400490pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400491 Arm {
492 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
493 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500494 guard: (_i . guard).map(|it| { (
495 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
496 Box::new(_visitor.fold_expr(* ( it ) . 1)),
497 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500498 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400499 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500500 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400501 }
502}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800503# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400504pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400505 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500506 AttrStyle::Outer => { AttrStyle::Outer }
507 AttrStyle::Inner(_binding_0, ) => {
508 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500509 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400510 )
511 }
512 }
513}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800514# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400515pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400516 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500518 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500519 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 path: _visitor.fold_path(_i . path),
521 tts: _i . tts,
522 is_sugared_doc: _i . is_sugared_doc,
523 }
524}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800525# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400526pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400527 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500528 name: (_i . name).map(|it| { (
529 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500530 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500531 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800532 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400533 }
534}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800535# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400536pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400537 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500538 BareFnArgName::Named(_binding_0, ) => {
539 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500540 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
David Tolnay6702ade2017-12-30 23:38:15 -0500543 BareFnArgName::Wild(_binding_0, ) => {
544 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 }
549}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800550# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400551pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400552 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500553 BinOp::Add(_binding_0, ) => {
554 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
David Tolnay6702ade2017-12-30 23:38:15 -0500558 BinOp::Sub(_binding_0, ) => {
559 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
David Tolnay6702ade2017-12-30 23:38:15 -0500563 BinOp::Mul(_binding_0, ) => {
564 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
David Tolnay6702ade2017-12-30 23:38:15 -0500568 BinOp::Div(_binding_0, ) => {
569 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
David Tolnay6702ade2017-12-30 23:38:15 -0500573 BinOp::Rem(_binding_0, ) => {
574 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
David Tolnay6702ade2017-12-30 23:38:15 -0500578 BinOp::And(_binding_0, ) => {
579 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
David Tolnay6702ade2017-12-30 23:38:15 -0500583 BinOp::Or(_binding_0, ) => {
584 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
David Tolnay6702ade2017-12-30 23:38:15 -0500588 BinOp::BitXor(_binding_0, ) => {
589 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
David Tolnay6702ade2017-12-30 23:38:15 -0500593 BinOp::BitAnd(_binding_0, ) => {
594 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
David Tolnay6702ade2017-12-30 23:38:15 -0500598 BinOp::BitOr(_binding_0, ) => {
599 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
David Tolnay6702ade2017-12-30 23:38:15 -0500603 BinOp::Shl(_binding_0, ) => {
604 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
David Tolnay6702ade2017-12-30 23:38:15 -0500608 BinOp::Shr(_binding_0, ) => {
609 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
David Tolnay6702ade2017-12-30 23:38:15 -0500613 BinOp::Eq(_binding_0, ) => {
614 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
David Tolnay6702ade2017-12-30 23:38:15 -0500618 BinOp::Lt(_binding_0, ) => {
619 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
David Tolnay6702ade2017-12-30 23:38:15 -0500623 BinOp::Le(_binding_0, ) => {
624 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
David Tolnay6702ade2017-12-30 23:38:15 -0500628 BinOp::Ne(_binding_0, ) => {
629 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
David Tolnay6702ade2017-12-30 23:38:15 -0500633 BinOp::Ge(_binding_0, ) => {
634 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
David Tolnay6702ade2017-12-30 23:38:15 -0500638 BinOp::Gt(_binding_0, ) => {
639 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
David Tolnay6702ade2017-12-30 23:38:15 -0500643 BinOp::AddEq(_binding_0, ) => {
644 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
David Tolnay6702ade2017-12-30 23:38:15 -0500648 BinOp::SubEq(_binding_0, ) => {
649 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
David Tolnay6702ade2017-12-30 23:38:15 -0500653 BinOp::MulEq(_binding_0, ) => {
654 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
David Tolnay6702ade2017-12-30 23:38:15 -0500658 BinOp::DivEq(_binding_0, ) => {
659 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500660 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400661 )
662 }
David Tolnay6702ade2017-12-30 23:38:15 -0500663 BinOp::RemEq(_binding_0, ) => {
664 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500665 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400666 )
667 }
David Tolnay6702ade2017-12-30 23:38:15 -0500668 BinOp::BitXorEq(_binding_0, ) => {
669 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500670 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400671 )
672 }
David Tolnay6702ade2017-12-30 23:38:15 -0500673 BinOp::BitAndEq(_binding_0, ) => {
674 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500675 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400676 )
677 }
David Tolnay6702ade2017-12-30 23:38:15 -0500678 BinOp::BitOrEq(_binding_0, ) => {
679 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500680 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400681 )
682 }
David Tolnay6702ade2017-12-30 23:38:15 -0500683 BinOp::ShlEq(_binding_0, ) => {
684 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500685 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400686 )
687 }
David Tolnay6702ade2017-12-30 23:38:15 -0500688 BinOp::ShrEq(_binding_0, ) => {
689 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500690 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400691 )
692 }
693 }
694}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800695# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay506e43a2017-12-29 11:34:36 -0500696pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
697 Binding {
698 ident: _visitor.fold_ident(_i . ident),
699 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
700 ty: _visitor.fold_type(_i . ty),
701 }
702}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800703# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400704pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400705 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500706 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400707 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
708 }
709}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800710# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400711pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400712 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500713 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
714 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400715 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 }
718}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800719# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500720pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
721 ConstParam {
722 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500724 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500726 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500728 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
729 }
730}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800731# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500732pub fn fold_data<V: Folder + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
733 match _i {
734 Data::Struct(_binding_0, ) => {
735 Data::Struct (
736 _visitor.fold_data_struct(_binding_0),
737 )
738 }
739 Data::Enum(_binding_0, ) => {
740 Data::Enum (
741 _visitor.fold_data_enum(_binding_0),
742 )
743 }
744 Data::Union(_binding_0, ) => {
745 Data::Union (
746 _visitor.fold_data_union(_binding_0),
747 )
748 }
749 }
750}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800751# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500752pub fn fold_data_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
753 DataEnum {
754 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
755 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
756 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
757 }
758}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800759# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500760pub fn fold_data_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
761 DataStruct {
762 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
763 fields: _visitor.fold_fields(_i . fields),
764 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
765 }
766}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800767# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500768pub fn fold_data_union<V: Folder + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
769 DataUnion {
770 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
771 fields: _visitor.fold_fields_named(_i . fields),
772 }
773}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800774# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400775pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400776 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400777 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500778 vis: _visitor.fold_visibility(_i . vis),
779 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400780 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500781 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400782 }
783}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800784# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400785pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400786 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500787 Expr::Box(_binding_0, ) => {
788 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400789 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400790 )
791 }
David Tolnay6702ade2017-12-30 23:38:15 -0500792 Expr::InPlace(_binding_0, ) => {
793 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400794 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400795 )
796 }
David Tolnay6702ade2017-12-30 23:38:15 -0500797 Expr::Array(_binding_0, ) => {
798 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400799 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
David Tolnay6702ade2017-12-30 23:38:15 -0500802 Expr::Call(_binding_0, ) => {
803 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400804 _visitor.fold_expr_call(_binding_0),
805 )
806 }
David Tolnay6702ade2017-12-30 23:38:15 -0500807 Expr::MethodCall(_binding_0, ) => {
808 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
David Tolnay6702ade2017-12-30 23:38:15 -0500812 Expr::Tuple(_binding_0, ) => {
813 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500814 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
David Tolnay6702ade2017-12-30 23:38:15 -0500817 Expr::Binary(_binding_0, ) => {
818 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400819 _visitor.fold_expr_binary(_binding_0),
820 )
821 }
David Tolnay6702ade2017-12-30 23:38:15 -0500822 Expr::Unary(_binding_0, ) => {
823 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400824 _visitor.fold_expr_unary(_binding_0),
825 )
826 }
David Tolnay6702ade2017-12-30 23:38:15 -0500827 Expr::Lit(_binding_0, ) => {
828 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500829 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
David Tolnay6702ade2017-12-30 23:38:15 -0500832 Expr::Cast(_binding_0, ) => {
833 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400834 _visitor.fold_expr_cast(_binding_0),
835 )
836 }
David Tolnay6702ade2017-12-30 23:38:15 -0500837 Expr::Type(_binding_0, ) => {
838 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500839 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
David Tolnay6702ade2017-12-30 23:38:15 -0500842 Expr::If(_binding_0, ) => {
843 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
David Tolnay6702ade2017-12-30 23:38:15 -0500847 Expr::IfLet(_binding_0, ) => {
848 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
David Tolnay6702ade2017-12-30 23:38:15 -0500852 Expr::While(_binding_0, ) => {
853 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400854 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
David Tolnay6702ade2017-12-30 23:38:15 -0500857 Expr::WhileLet(_binding_0, ) => {
858 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
David Tolnay6702ade2017-12-30 23:38:15 -0500862 Expr::ForLoop(_binding_0, ) => {
863 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
David Tolnay6702ade2017-12-30 23:38:15 -0500867 Expr::Loop(_binding_0, ) => {
868 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
David Tolnay6702ade2017-12-30 23:38:15 -0500872 Expr::Match(_binding_0, ) => {
873 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
David Tolnay6702ade2017-12-30 23:38:15 -0500877 Expr::Closure(_binding_0, ) => {
878 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
David Tolnay6702ade2017-12-30 23:38:15 -0500882 Expr::Unsafe(_binding_0, ) => {
883 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500884 full!(_visitor.fold_expr_unsafe(_binding_0)),
885 )
886 }
David Tolnay6702ade2017-12-30 23:38:15 -0500887 Expr::Block(_binding_0, ) => {
888 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
David Tolnay6702ade2017-12-30 23:38:15 -0500892 Expr::Assign(_binding_0, ) => {
893 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
David Tolnay6702ade2017-12-30 23:38:15 -0500897 Expr::AssignOp(_binding_0, ) => {
898 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400899 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
David Tolnay6702ade2017-12-30 23:38:15 -0500902 Expr::Field(_binding_0, ) => {
903 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
David Tolnay6702ade2017-12-30 23:38:15 -0500907 Expr::Index(_binding_0, ) => {
908 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400909 _visitor.fold_expr_index(_binding_0),
910 )
911 }
David Tolnay6702ade2017-12-30 23:38:15 -0500912 Expr::Range(_binding_0, ) => {
913 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
David Tolnay6702ade2017-12-30 23:38:15 -0500917 Expr::Path(_binding_0, ) => {
918 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400919 _visitor.fold_expr_path(_binding_0),
920 )
921 }
David Tolnay6702ade2017-12-30 23:38:15 -0500922 Expr::AddrOf(_binding_0, ) => {
923 Expr::AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
David Tolnay6702ade2017-12-30 23:38:15 -0500927 Expr::Break(_binding_0, ) => {
928 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
David Tolnay6702ade2017-12-30 23:38:15 -0500932 Expr::Continue(_binding_0, ) => {
933 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400934 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
David Tolnay6702ade2017-12-30 23:38:15 -0500937 Expr::Return(_binding_0, ) => {
938 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500939 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
David Tolnay6702ade2017-12-30 23:38:15 -0500942 Expr::Macro(_binding_0, ) => {
943 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500944 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400945 )
946 }
David Tolnay6702ade2017-12-30 23:38:15 -0500947 Expr::Struct(_binding_0, ) => {
948 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400949 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
David Tolnay6702ade2017-12-30 23:38:15 -0500952 Expr::Repeat(_binding_0, ) => {
953 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400954 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400955 )
956 }
David Tolnay6702ade2017-12-30 23:38:15 -0500957 Expr::Paren(_binding_0, ) => {
958 Expr::Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500959 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400960 )
961 }
David Tolnay6702ade2017-12-30 23:38:15 -0500962 Expr::Group(_binding_0, ) => {
963 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500964 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400965 )
966 }
David Tolnay6702ade2017-12-30 23:38:15 -0500967 Expr::Try(_binding_0, ) => {
968 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400969 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
David Tolnay6702ade2017-12-30 23:38:15 -0500972 Expr::Catch(_binding_0, ) => {
973 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400974 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400975 )
976 }
David Tolnay6702ade2017-12-30 23:38:15 -0500977 Expr::Yield(_binding_0, ) => {
978 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400979 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400980 )
981 }
David Tolnay6702ade2017-12-30 23:38:15 -0500982 Expr::Verbatim(_binding_0, ) => {
983 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500984 _visitor.fold_expr_verbatim(_binding_0),
985 )
986 }
Nika Layzell27726662017-10-24 23:16:35 -0400987 }
988}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800989# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500990pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
991 ExprAddrOf {
992 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
993 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500994 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500995 expr: Box::new(_visitor.fold_expr(* _i . expr)),
996 }
997}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800998# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500999pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
1000 ExprArray {
1001 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1002 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001003 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001004 }
1005}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001006# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001007pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1008 ExprAssign {
1009 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1010 left: Box::new(_visitor.fold_expr(* _i . left)),
1011 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1012 right: Box::new(_visitor.fold_expr(* _i . right)),
1013 }
1014}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001015# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001016pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1017 ExprAssignOp {
1018 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1019 left: Box::new(_visitor.fold_expr(* _i . left)),
1020 op: _visitor.fold_bin_op(_i . op),
1021 right: Box::new(_visitor.fold_expr(* _i . right)),
1022 }
1023}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001024# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001025pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1026 ExprBinary {
1027 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1028 left: Box::new(_visitor.fold_expr(* _i . left)),
1029 op: _visitor.fold_bin_op(_i . op),
1030 right: Box::new(_visitor.fold_expr(* _i . right)),
1031 }
1032}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001033# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001034pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1035 ExprBlock {
1036 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1037 block: _visitor.fold_block(_i . block),
1038 }
1039}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001040# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001041pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1042 ExprBox {
1043 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1044 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1045 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1046 }
1047}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001048# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001049pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1050 ExprBreak {
1051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1052 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1053 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1054 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1055 }
1056}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001057# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001058pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1059 ExprCall {
1060 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1061 func: Box::new(_visitor.fold_expr(* _i . func)),
1062 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1063 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1064 }
1065}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001066# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001067pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1068 ExprCast {
1069 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1070 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1071 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1072 ty: Box::new(_visitor.fold_type(* _i . ty)),
1073 }
1074}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001075# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001076pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1077 ExprCatch {
1078 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1079 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1080 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1081 block: _visitor.fold_block(_i . block),
1082 }
1083}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001084# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001085pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1086 ExprClosure {
1087 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001088 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001089 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1090 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1091 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1092 output: _visitor.fold_return_type(_i . output),
1093 body: Box::new(_visitor.fold_expr(* _i . body)),
1094 }
1095}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001096# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001097pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1098 ExprContinue {
1099 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1100 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1101 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1102 }
1103}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001104# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001105pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1106 ExprField {
1107 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1108 base: Box::new(_visitor.fold_expr(* _i . base)),
1109 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1110 member: _visitor.fold_member(_i . member),
1111 }
1112}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001113# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001114pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1115 ExprForLoop {
1116 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001117 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001118 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1119 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1120 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1121 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1122 body: _visitor.fold_block(_i . body),
1123 }
1124}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001125# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001126pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1127 ExprGroup {
1128 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1129 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1130 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1131 }
1132}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001133# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001134pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1135 ExprIf {
1136 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1137 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1138 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001139 then_branch: _visitor.fold_block(_i . then_branch),
1140 else_branch: (_i . else_branch).map(|it| { (
1141 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1142 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1143 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001144 }
1145}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001146# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001147pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1148 ExprIfLet {
1149 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1150 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1151 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1152 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1153 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1154 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001155 then_branch: _visitor.fold_block(_i . then_branch),
1156 else_branch: (_i . else_branch).map(|it| { (
1157 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1158 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1159 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001160 }
1161}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001162# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001163pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1164 ExprInPlace {
1165 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1166 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001167 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001168 value: Box::new(_visitor.fold_expr(* _i . value)),
1169 }
1170}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001171# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001172pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1173 ExprIndex {
1174 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1175 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1176 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1177 index: Box::new(_visitor.fold_expr(* _i . index)),
1178 }
1179}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001180# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001181pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1182 ExprLit {
1183 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1184 lit: _visitor.fold_lit(_i . lit),
1185 }
1186}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001187# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001188pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001189 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001190 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001191 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001192 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1193 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001194 }
1195}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001196# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001197pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1198 ExprMacro {
1199 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1200 mac: _visitor.fold_macro(_i . mac),
1201 }
1202}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001203# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001207 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001208 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001209 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1211 }
1212}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001213# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001214pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001215 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001216 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001217 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001218 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001219 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001220 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001221 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1222 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
1224}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001225# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001226pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001229 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001230 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001231 }
1232}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001233# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001234pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001236 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001237 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 path: _visitor.fold_path(_i . path),
1239 }
1240}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001241# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001242pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001243 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001244 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001245 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001246 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001247 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
1249}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001250# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001254 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001256 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001257 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1258 }
1259}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001260# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001261pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1262 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001263 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001264 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001265 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
1267}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001268# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001269pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001270 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001271 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001272 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001273 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001274 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1275 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1276 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001277 }
1278}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001279# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001280pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001281 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001282 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001283 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001284 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001285 }
1286}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001287# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -05001288pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1289 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001290 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001291 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001292 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001293 }
1294}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001295# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001296pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001297 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001298 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001299 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001300 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001301 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001302 }
1303}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001305pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001307 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001308 op: _visitor.fold_un_op(_i . op),
1309 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1310 }
1311}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001312# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001313pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1314 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001315 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001316 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001317 block: _visitor.fold_block(_i . block),
1318 }
1319}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001320# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05001321pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1322 ExprVerbatim {
1323 tts: _i . tts,
1324 }
1325}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001326# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001327pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001328 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001329 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001330 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001331 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001332 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1333 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001334 }
1335}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001336# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001337pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001338 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001339 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001340 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001341 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1342 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001343 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001344 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001345 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1346 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001347 }
1348}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001349# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001350pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001351 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001352 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001353 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001354 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001355 }
1356}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001357# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001358pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001359 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001360 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001361 vis: _visitor.fold_visibility(_i . vis),
1362 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001363 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001364 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001365 }
1366}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001367# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001368pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001369 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001370 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001371 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001372 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001373 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001374 }
1375}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001376# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001377pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001378 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001379 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1380 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001381 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001382 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001383 }
1384}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001385# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -05001386pub fn fold_fields<V: Folder + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
1387 match _i {
1388 Fields::Named(_binding_0, ) => {
1389 Fields::Named (
1390 _visitor.fold_fields_named(_binding_0),
1391 )
1392 }
1393 Fields::Unnamed(_binding_0, ) => {
1394 Fields::Unnamed (
1395 _visitor.fold_fields_unnamed(_binding_0),
1396 )
1397 }
1398 Fields::Unit => { Fields::Unit }
1399 }
1400}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001401# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -05001402pub fn fold_fields_named<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
1403 FieldsNamed {
1404 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001405 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001406 }
1407}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001408# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -05001409pub fn fold_fields_unnamed<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
1410 FieldsUnnamed {
1411 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001412 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001413 }
1414}
Nika Layzell27726662017-10-24 23:16:35 -04001415# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001416pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001417 File {
1418 shebang: _i . shebang,
1419 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1420 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1421 }
1422}
1423# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001424pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001425 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001426 FnArg::SelfRef(_binding_0, ) => {
1427 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001428 _visitor.fold_arg_self_ref(_binding_0),
1429 )
1430 }
David Tolnay6702ade2017-12-30 23:38:15 -05001431 FnArg::SelfValue(_binding_0, ) => {
1432 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001433 _visitor.fold_arg_self(_binding_0),
1434 )
1435 }
David Tolnay6702ade2017-12-30 23:38:15 -05001436 FnArg::Captured(_binding_0, ) => {
1437 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001438 _visitor.fold_arg_captured(_binding_0),
1439 )
1440 }
David Tolnay6702ade2017-12-30 23:38:15 -05001441 FnArg::Inferred(_binding_0, ) => {
1442 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001443 _visitor.fold_pat(_binding_0),
1444 )
1445 }
David Tolnay6702ade2017-12-30 23:38:15 -05001446 FnArg::Ignored(_binding_0, ) => {
1447 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001448 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001449 )
1450 }
1451 }
1452}
1453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001454pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001455 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001456 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001457 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001458 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001459 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001460 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001461 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001462 }
1463}
1464# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001465pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001466 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001467 ForeignItem::Fn(_binding_0, ) => {
1468 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001469 _visitor.fold_foreign_item_fn(_binding_0),
1470 )
1471 }
David Tolnay6702ade2017-12-30 23:38:15 -05001472 ForeignItem::Static(_binding_0, ) => {
1473 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001474 _visitor.fold_foreign_item_static(_binding_0),
1475 )
1476 }
David Tolnay6702ade2017-12-30 23:38:15 -05001477 ForeignItem::Type(_binding_0, ) => {
1478 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001479 _visitor.fold_foreign_item_type(_binding_0),
1480 )
1481 }
David Tolnay6702ade2017-12-30 23:38:15 -05001482 ForeignItem::Verbatim(_binding_0, ) => {
1483 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001484 _visitor.fold_foreign_item_verbatim(_binding_0),
1485 )
1486 }
Nika Layzell27726662017-10-24 23:16:35 -04001487 }
1488}
1489# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001490pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1491 ForeignItemFn {
1492 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1493 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001494 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001495 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001496 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001497 }
1498}
1499# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001500pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001501 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001502 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1503 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001505 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001506 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001507 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001508 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001509 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001510 }
1511}
David Tolnay199bcbb2017-11-12 10:33:52 -08001512# [ cfg ( feature = "full" ) ]
1513pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1514 ForeignItemType {
1515 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1516 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001517 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001518 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001519 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001520 }
1521}
David Tolnay2ae520a2017-12-29 11:19:50 -05001522# [ cfg ( feature = "full" ) ]
1523pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1524 ForeignItemVerbatim {
1525 tts: _i . tts,
1526 }
1527}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001528# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -05001529pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001530 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001531 GenericArgument::Lifetime(_binding_0, ) => {
1532 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001533 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001534 )
1535 }
David Tolnay6702ade2017-12-30 23:38:15 -05001536 GenericArgument::Type(_binding_0, ) => {
1537 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001538 _visitor.fold_type(_binding_0),
1539 )
1540 }
David Tolnay6702ade2017-12-30 23:38:15 -05001541 GenericArgument::Binding(_binding_0, ) => {
1542 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001543 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001544 )
1545 }
David Tolnay6702ade2017-12-30 23:38:15 -05001546 GenericArgument::Const(_binding_0, ) => {
1547 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001548 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001549 )
1550 }
Nika Layzell357885a2017-12-04 15:47:07 -05001551 }
1552}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001553# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -05001554pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001555 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001556 GenericMethodArgument::Type(_binding_0, ) => {
1557 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001558 _visitor.fold_type(_binding_0),
1559 )
1560 }
David Tolnay6702ade2017-12-30 23:38:15 -05001561 GenericMethodArgument::Const(_binding_0, ) => {
1562 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001563 _visitor.fold_expr(_binding_0),
1564 )
1565 }
1566 }
1567}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001568# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc2f1aba2017-11-12 20:29:22 -08001569pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001570 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001571 GenericParam::Type(_binding_0, ) => {
1572 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001573 _visitor.fold_type_param(_binding_0),
1574 )
1575 }
David Tolnay517f3692018-01-01 20:17:23 -08001576 GenericParam::Lifetime(_binding_0, ) => {
1577 GenericParam::Lifetime (
1578 _visitor.fold_lifetime_def(_binding_0),
1579 )
1580 }
David Tolnay6702ade2017-12-30 23:38:15 -05001581 GenericParam::Const(_binding_0, ) => {
1582 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001583 _visitor.fold_const_param(_binding_0),
1584 )
1585 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001586 }
1587}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001588# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001589pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001590 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001592 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001594 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001595 }
1596}
1597# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001598pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001599 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001600 ImplItem::Const(_binding_0, ) => {
1601 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001602 _visitor.fold_impl_item_const(_binding_0),
1603 )
1604 }
David Tolnay6702ade2017-12-30 23:38:15 -05001605 ImplItem::Method(_binding_0, ) => {
1606 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001607 _visitor.fold_impl_item_method(_binding_0),
1608 )
1609 }
David Tolnay6702ade2017-12-30 23:38:15 -05001610 ImplItem::Type(_binding_0, ) => {
1611 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001612 _visitor.fold_impl_item_type(_binding_0),
1613 )
1614 }
David Tolnay6702ade2017-12-30 23:38:15 -05001615 ImplItem::Macro(_binding_0, ) => {
1616 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001617 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001618 )
1619 }
David Tolnay6702ade2017-12-30 23:38:15 -05001620 ImplItem::Verbatim(_binding_0, ) => {
1621 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001622 _visitor.fold_impl_item_verbatim(_binding_0),
1623 )
1624 }
Nika Layzell27726662017-10-24 23:16:35 -04001625 }
1626}
1627# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001628pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1629 ImplItemConst {
1630 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1631 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001632 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001633 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001634 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001635 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001636 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001637 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001638 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001639 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001640 }
1641}
1642# [ cfg ( feature = "full" ) ]
1643pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1644 ImplItemMacro {
1645 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1646 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001647 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001648 }
1649}
1650# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001651pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001652 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001653 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001654 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001655 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001656 sig: _visitor.fold_method_sig(_i . sig),
1657 block: _visitor.fold_block(_i . block),
1658 }
1659}
1660# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001661pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001662 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001663 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001664 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001665 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001666 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001667 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001668 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001669 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001670 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001671 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001672 }
1673}
David Tolnay2ae520a2017-12-29 11:19:50 -05001674# [ cfg ( feature = "full" ) ]
1675pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1676 ImplItemVerbatim {
1677 tts: _i . tts,
1678 }
1679}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001680# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001681pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1682 Index {
1683 index: _i . index,
1684 span: _visitor.fold_span(_i . span),
1685 }
1686}
1687# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001688pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001689 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001690 Item::ExternCrate(_binding_0, ) => {
1691 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001692 _visitor.fold_item_extern_crate(_binding_0),
1693 )
1694 }
David Tolnay6702ade2017-12-30 23:38:15 -05001695 Item::Use(_binding_0, ) => {
1696 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001697 _visitor.fold_item_use(_binding_0),
1698 )
1699 }
David Tolnay6702ade2017-12-30 23:38:15 -05001700 Item::Static(_binding_0, ) => {
1701 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001702 _visitor.fold_item_static(_binding_0),
1703 )
1704 }
David Tolnay6702ade2017-12-30 23:38:15 -05001705 Item::Const(_binding_0, ) => {
1706 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001707 _visitor.fold_item_const(_binding_0),
1708 )
1709 }
David Tolnay6702ade2017-12-30 23:38:15 -05001710 Item::Fn(_binding_0, ) => {
1711 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001712 _visitor.fold_item_fn(_binding_0),
1713 )
1714 }
David Tolnay6702ade2017-12-30 23:38:15 -05001715 Item::Mod(_binding_0, ) => {
1716 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001717 _visitor.fold_item_mod(_binding_0),
1718 )
1719 }
David Tolnay6702ade2017-12-30 23:38:15 -05001720 Item::ForeignMod(_binding_0, ) => {
1721 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001722 _visitor.fold_item_foreign_mod(_binding_0),
1723 )
1724 }
David Tolnay6702ade2017-12-30 23:38:15 -05001725 Item::Type(_binding_0, ) => {
1726 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001727 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001728 )
1729 }
David Tolnay6702ade2017-12-30 23:38:15 -05001730 Item::Struct(_binding_0, ) => {
1731 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001732 _visitor.fold_item_struct(_binding_0),
1733 )
1734 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001735 Item::Enum(_binding_0, ) => {
1736 Item::Enum (
1737 _visitor.fold_item_enum(_binding_0),
1738 )
1739 }
David Tolnay6702ade2017-12-30 23:38:15 -05001740 Item::Union(_binding_0, ) => {
1741 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001742 _visitor.fold_item_union(_binding_0),
1743 )
1744 }
David Tolnay6702ade2017-12-30 23:38:15 -05001745 Item::Trait(_binding_0, ) => {
1746 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001747 _visitor.fold_item_trait(_binding_0),
1748 )
1749 }
David Tolnay6702ade2017-12-30 23:38:15 -05001750 Item::Impl(_binding_0, ) => {
1751 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001752 _visitor.fold_item_impl(_binding_0),
1753 )
1754 }
David Tolnay6702ade2017-12-30 23:38:15 -05001755 Item::Macro(_binding_0, ) => {
1756 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001757 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001758 )
1759 }
David Tolnay6702ade2017-12-30 23:38:15 -05001760 Item::Macro2(_binding_0, ) => {
1761 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001762 _visitor.fold_item_macro2(_binding_0),
1763 )
1764 }
David Tolnay6702ade2017-12-30 23:38:15 -05001765 Item::Verbatim(_binding_0, ) => {
1766 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001767 _visitor.fold_item_verbatim(_binding_0),
1768 )
1769 }
Nika Layzell27726662017-10-24 23:16:35 -04001770 }
1771}
1772# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001773pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1774 ItemConst {
1775 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1776 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001777 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001778 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001779 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001780 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001781 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001782 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001783 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001784 }
1785}
1786# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001787pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1788 ItemEnum {
1789 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1790 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001791 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001792 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001794 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001795 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1796 }
1797}
1798# [ cfg ( feature = "full" ) ]
1799pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1800 ItemExternCrate {
1801 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1802 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1804 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001805 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001806 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001807 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001808 _visitor.fold_ident(( it ) . 1),
1809 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001811 }
1812}
1813# [ cfg ( feature = "full" ) ]
1814pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1815 ItemFn {
1816 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1817 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001818 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001819 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001821 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001822 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001823 block: Box::new(_visitor.fold_block(* _i . block)),
1824 }
1825}
1826# [ cfg ( feature = "full" ) ]
1827pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1828 ItemForeignMod {
1829 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1830 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001831 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001832 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1833 }
1834}
1835# [ cfg ( feature = "full" ) ]
1836pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1837 ItemImpl {
1838 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001839 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001840 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001841 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001842 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001843 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001844 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001845 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001847 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001848 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001849 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001850 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1851 }
1852}
1853# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001854pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1855 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001856 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001857 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001858 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001860 }
1861}
1862# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001863pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1864 ItemMacro2 {
1865 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1866 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001868 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001869 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001870 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001871 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001872 body: _i . body,
1873 }
1874}
1875# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001876pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001877 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001878 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001879 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001880 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001881 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001882 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001883 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001884 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1885 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001886 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001887 }
1888}
1889# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001890pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001891 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001892 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001893 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001894 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001895 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001896 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001897 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001898 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001899 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001900 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001901 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001902 }
1903}
1904# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001905pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001906 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001907 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001908 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001909 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001910 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001911 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001912 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001913 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001914 }
1915}
1916# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001917pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001918 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001919 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001920 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001921 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001922 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1923 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001924 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001925 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001926 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001927 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001928 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001929 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1930 }
1931}
1932# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001933pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1934 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001935 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001936 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001937 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001938 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001939 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001940 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001941 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001942 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001943 }
1944}
1945# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001946pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001947 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001948 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001949 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001950 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001951 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001952 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001953 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001954 }
1955}
1956# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001957pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001958 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001959 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001960 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001961 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1962 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001963 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1964 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001965 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001966 }
1967}
David Tolnay2ae520a2017-12-29 11:19:50 -05001968# [ cfg ( feature = "full" ) ]
1969pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1970 ItemVerbatim {
1971 tts: _i . tts,
1972 }
1973}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001974# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -05001975pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1976 Label {
1977 name: _visitor.fold_lifetime(_i . name),
1978 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1979 }
1980}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001981# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001982pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001983 LifetimeDef {
1984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001985 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001986 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001987 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1988 }
1989}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001990# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -05001991pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001992 match _i {
1993 Lit::Str(_binding_0, ) => {
1994 Lit::Str (
1995 _visitor.fold_lit_str(_binding_0),
1996 )
1997 }
1998 Lit::ByteStr(_binding_0, ) => {
1999 Lit::ByteStr (
2000 _visitor.fold_lit_byte_str(_binding_0),
2001 )
2002 }
2003 Lit::Byte(_binding_0, ) => {
2004 Lit::Byte (
2005 _visitor.fold_lit_byte(_binding_0),
2006 )
2007 }
2008 Lit::Char(_binding_0, ) => {
2009 Lit::Char (
2010 _visitor.fold_lit_char(_binding_0),
2011 )
2012 }
2013 Lit::Int(_binding_0, ) => {
2014 Lit::Int (
2015 _visitor.fold_lit_int(_binding_0),
2016 )
2017 }
2018 Lit::Float(_binding_0, ) => {
2019 Lit::Float (
2020 _visitor.fold_lit_float(_binding_0),
2021 )
2022 }
2023 Lit::Bool(_binding_0, ) => {
2024 Lit::Bool (
2025 _visitor.fold_lit_bool(_binding_0),
2026 )
2027 }
2028 Lit::Verbatim(_binding_0, ) => {
2029 Lit::Verbatim (
2030 _visitor.fold_lit_verbatim(_binding_0),
2031 )
2032 }
2033 }
2034}
2035# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2036pub fn fold_lit_bool<V: Folder + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
2037 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002038 value: _i . value,
2039 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002040 }
2041}
David Tolnay360efd22018-01-04 23:35:26 -08002042# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2043pub fn fold_lit_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
2044 LitVerbatim {
2045 token: _i . token,
2046 span: _visitor.fold_span(_i . span),
2047 }
2048}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002049# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002050pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002051 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002052 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002053 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
2054 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05002055 ty: (_i . ty).map(|it| { (
2056 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2057 Box::new(_visitor.fold_type(* ( it ) . 1)),
2058 ) }),
2059 init: (_i . init).map(|it| { (
2060 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2061 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2062 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002063 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002064 }
2065}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002066# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002067pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
2068 Macro {
2069 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002070 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002071 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2072 tts: _i . tts,
2073 }
2074}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002075# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -05002076pub fn fold_macro_delimiter<V: Folder + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002077 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002078 MacroDelimiter::Paren(_binding_0, ) => {
2079 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002080 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2081 )
2082 }
David Tolnay6702ade2017-12-30 23:38:15 -05002083 MacroDelimiter::Brace(_binding_0, ) => {
2084 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002085 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2086 )
2087 }
David Tolnay6702ade2017-12-30 23:38:15 -05002088 MacroDelimiter::Bracket(_binding_0, ) => {
2089 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002090 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2091 )
2092 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002093 }
2094}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002095# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05002096pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002097 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002098 Member::Named(_binding_0, ) => {
2099 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05002100 _visitor.fold_ident(_binding_0),
2101 )
2102 }
David Tolnay6702ade2017-12-30 23:38:15 -05002103 Member::Unnamed(_binding_0, ) => {
2104 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002105 _visitor.fold_index(_binding_0),
2106 )
2107 }
2108 }
2109}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002110# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002111pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002112 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002113 MetaItem::Term(_binding_0, ) => {
2114 MetaItem::Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002115 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002116 )
2117 }
David Tolnay6702ade2017-12-30 23:38:15 -05002118 MetaItem::List(_binding_0, ) => {
2119 MetaItem::List (
Nika Layzell27726662017-10-24 23:16:35 -04002120 _visitor.fold_meta_item_list(_binding_0),
2121 )
2122 }
David Tolnay6702ade2017-12-30 23:38:15 -05002123 MetaItem::NameValue(_binding_0, ) => {
2124 MetaItem::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002125 _visitor.fold_meta_name_value(_binding_0),
2126 )
2127 }
2128 }
2129}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002130# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002132 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002133 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002134 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002135 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2136 }
2137}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002138# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002140 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002141 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002142 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002143 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002144 }
2145}
2146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002147pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002148 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002149 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002150 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002151 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002152 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002153 decl: _visitor.fold_fn_decl(_i . decl),
2154 }
2155}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002156# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -05002157pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2158 MethodTurbofish {
2159 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2160 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2161 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2162 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2163 }
2164}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002165# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002166pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002167 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002168 NestedMetaItem::MetaItem(_binding_0, ) => {
2169 NestedMetaItem::MetaItem (
Nika Layzell27726662017-10-24 23:16:35 -04002170 _visitor.fold_meta_item(_binding_0),
2171 )
2172 }
David Tolnay6702ade2017-12-30 23:38:15 -05002173 NestedMetaItem::Literal(_binding_0, ) => {
2174 NestedMetaItem::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002175 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002176 )
2177 }
2178 }
2179}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002180# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -05002181pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2182 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002183 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002184 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002185 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002186 }
2187}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002188# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002189pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002190 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002191 Pat::Wild(_binding_0, ) => {
2192 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002193 _visitor.fold_pat_wild(_binding_0),
2194 )
2195 }
David Tolnay6702ade2017-12-30 23:38:15 -05002196 Pat::Ident(_binding_0, ) => {
2197 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002198 _visitor.fold_pat_ident(_binding_0),
2199 )
2200 }
David Tolnay6702ade2017-12-30 23:38:15 -05002201 Pat::Struct(_binding_0, ) => {
2202 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002203 _visitor.fold_pat_struct(_binding_0),
2204 )
2205 }
David Tolnay6702ade2017-12-30 23:38:15 -05002206 Pat::TupleStruct(_binding_0, ) => {
2207 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002208 _visitor.fold_pat_tuple_struct(_binding_0),
2209 )
2210 }
David Tolnay6702ade2017-12-30 23:38:15 -05002211 Pat::Path(_binding_0, ) => {
2212 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002213 _visitor.fold_pat_path(_binding_0),
2214 )
2215 }
David Tolnay6702ade2017-12-30 23:38:15 -05002216 Pat::Tuple(_binding_0, ) => {
2217 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002218 _visitor.fold_pat_tuple(_binding_0),
2219 )
2220 }
David Tolnay6702ade2017-12-30 23:38:15 -05002221 Pat::Box(_binding_0, ) => {
2222 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002223 _visitor.fold_pat_box(_binding_0),
2224 )
2225 }
David Tolnay6702ade2017-12-30 23:38:15 -05002226 Pat::Ref(_binding_0, ) => {
2227 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002228 _visitor.fold_pat_ref(_binding_0),
2229 )
2230 }
David Tolnay6702ade2017-12-30 23:38:15 -05002231 Pat::Lit(_binding_0, ) => {
2232 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002233 _visitor.fold_pat_lit(_binding_0),
2234 )
2235 }
David Tolnay6702ade2017-12-30 23:38:15 -05002236 Pat::Range(_binding_0, ) => {
2237 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002238 _visitor.fold_pat_range(_binding_0),
2239 )
2240 }
David Tolnay6702ade2017-12-30 23:38:15 -05002241 Pat::Slice(_binding_0, ) => {
2242 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002243 _visitor.fold_pat_slice(_binding_0),
2244 )
2245 }
David Tolnay6702ade2017-12-30 23:38:15 -05002246 Pat::Macro(_binding_0, ) => {
2247 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002248 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002249 )
2250 }
David Tolnay6702ade2017-12-30 23:38:15 -05002251 Pat::Verbatim(_binding_0, ) => {
2252 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002253 _visitor.fold_pat_verbatim(_binding_0),
2254 )
2255 }
Nika Layzell27726662017-10-24 23:16:35 -04002256 }
2257}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002258# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002259pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002260 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002261 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002262 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002263 }
2264}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002265# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002266pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002267 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002268 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2269 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002270 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002271 subpat: (_i . subpat).map(|it| { (
2272 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2273 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2274 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002275 }
2276}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002277# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002278pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002279 PatLit {
2280 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2281 }
2282}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002283# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002284pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2285 PatMacro {
2286 mac: _visitor.fold_macro(_i . mac),
2287 }
2288}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002289# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002290pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002291 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002292 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002293 path: _visitor.fold_path(_i . path),
2294 }
2295}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002296# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002297pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002298 PatRange {
2299 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002300 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002301 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002302 }
2303}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002304# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002305pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002306 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002307 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002308 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002309 pat: Box::new(_visitor.fold_pat(* _i . pat)),
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" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002313pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002314 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002315 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002316 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002317 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002318 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002319 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002320 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002321 }
2322}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002323# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002324pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002325 PatStruct {
2326 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002327 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002328 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002329 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002330 }
2331}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002332# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002333pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002334 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002335 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002336 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002337 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002338 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2339 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002340 }
2341}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002342# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002343pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002344 PatTupleStruct {
2345 path: _visitor.fold_path(_i . path),
2346 pat: _visitor.fold_pat_tuple(_i . pat),
2347 }
2348}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002349# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002350pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2351 PatVerbatim {
2352 tts: _i . tts,
2353 }
2354}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002355# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002356pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002357 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002358 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002359 }
2360}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002361# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002362pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002363 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002364 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002365 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2366 }
2367}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002368# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -05002369pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002370 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002371 PathArguments::None => { PathArguments::None }
2372 PathArguments::AngleBracketed(_binding_0, ) => {
2373 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002374 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2375 )
2376 }
David Tolnay6702ade2017-12-30 23:38:15 -05002377 PathArguments::Parenthesized(_binding_0, ) => {
2378 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002379 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2380 )
2381 }
2382 }
2383}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002384# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002385pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002386 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002387 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002388 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002389 }
2390}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002391# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -08002392pub fn fold_predicate_eq<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
2393 PredicateEq {
2394 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2395 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2396 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2397 }
2398}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002399# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -08002400pub fn fold_predicate_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
2401 PredicateLifetime {
2402 lifetime: _visitor.fold_lifetime(_i . lifetime),
2403 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2404 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2405 }
2406}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002407# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -08002408pub fn fold_predicate_type<V: Folder + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
2409 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002410 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002411 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2412 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2413 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2414 }
2415}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002416# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002417pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002418 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002419 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002420 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002421 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002422 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2423 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002424 }
2425}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002426# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002427pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002428 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002429 RangeLimits::HalfOpen(_binding_0, ) => {
2430 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002431 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002432 )
2433 }
David Tolnay6702ade2017-12-30 23:38:15 -05002434 RangeLimits::Closed(_binding_0, ) => {
2435 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002436 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002437 )
2438 }
2439 }
2440}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002441# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -08002442pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002443 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002444 ReturnType::Default => { ReturnType::Default }
2445 ReturnType::Type(_binding_0, _binding_1, ) => {
2446 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002447 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2448 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002449 )
2450 }
2451 }
2452}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002453
2454pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2455 _i
2456}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002457# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002458pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002459 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002460 Stmt::Local(_binding_0, ) => {
2461 Stmt::Local (
Nika Layzell27726662017-10-24 23:16:35 -04002462 Box::new(_visitor.fold_local(* _binding_0)),
2463 )
2464 }
David Tolnay6702ade2017-12-30 23:38:15 -05002465 Stmt::Item(_binding_0, ) => {
2466 Stmt::Item (
Nika Layzell27726662017-10-24 23:16:35 -04002467 Box::new(_visitor.fold_item(* _binding_0)),
2468 )
2469 }
David Tolnay6702ade2017-12-30 23:38:15 -05002470 Stmt::Expr(_binding_0, ) => {
2471 Stmt::Expr (
Nika Layzell27726662017-10-24 23:16:35 -04002472 Box::new(_visitor.fold_expr(* _binding_0)),
2473 )
2474 }
David Tolnay6702ade2017-12-30 23:38:15 -05002475 Stmt::Semi(_binding_0, _binding_1, ) => {
2476 Stmt::Semi (
Nika Layzell27726662017-10-24 23:16:35 -04002477 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002478 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002479 )
2480 }
Nika Layzell27726662017-10-24 23:16:35 -04002481 }
2482}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002483# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -08002484pub fn fold_trait_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
2485 TraitBound {
2486 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2487 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2488 path: _visitor.fold_path(_i . path),
2489 }
2490}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002491# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002492pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002493 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002494 TraitBoundModifier::None => { TraitBoundModifier::None }
2495 TraitBoundModifier::Maybe(_binding_0, ) => {
2496 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002497 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002498 )
2499 }
2500 }
2501}
2502# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002503pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002504 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002505 TraitItem::Const(_binding_0, ) => {
2506 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002507 _visitor.fold_trait_item_const(_binding_0),
2508 )
2509 }
David Tolnay6702ade2017-12-30 23:38:15 -05002510 TraitItem::Method(_binding_0, ) => {
2511 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002512 _visitor.fold_trait_item_method(_binding_0),
2513 )
2514 }
David Tolnay6702ade2017-12-30 23:38:15 -05002515 TraitItem::Type(_binding_0, ) => {
2516 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002517 _visitor.fold_trait_item_type(_binding_0),
2518 )
2519 }
David Tolnay6702ade2017-12-30 23:38:15 -05002520 TraitItem::Macro(_binding_0, ) => {
2521 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002522 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002523 )
2524 }
David Tolnay6702ade2017-12-30 23:38:15 -05002525 TraitItem::Verbatim(_binding_0, ) => {
2526 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002527 _visitor.fold_trait_item_verbatim(_binding_0),
2528 )
2529 }
Nika Layzell27726662017-10-24 23:16:35 -04002530 }
2531}
2532# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002533pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2534 TraitItemConst {
2535 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002536 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002537 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002538 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002539 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002540 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002541 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002542 _visitor.fold_expr(( it ) . 1),
2543 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002544 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002545 }
2546}
2547# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002548pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2549 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002550 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002551 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002552 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002553 }
2554}
2555# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002556pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002557 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002558 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002559 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002560 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002562 }
2563}
2564# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002565pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002566 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002568 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002569 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002570 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002571 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002573 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002574 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002575 _visitor.fold_type(( it ) . 1),
2576 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002577 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002578 }
2579}
David Tolnay2ae520a2017-12-29 11:19:50 -05002580# [ cfg ( feature = "full" ) ]
2581pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2582 TraitItemVerbatim {
2583 tts: _i . tts,
2584 }
2585}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002586# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002587pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002588 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002589 Type::Slice(_binding_0, ) => {
2590 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002592 )
2593 }
David Tolnay6702ade2017-12-30 23:38:15 -05002594 Type::Array(_binding_0, ) => {
2595 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002597 )
2598 }
David Tolnay6702ade2017-12-30 23:38:15 -05002599 Type::Ptr(_binding_0, ) => {
2600 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002601 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002602 )
2603 }
David Tolnay6702ade2017-12-30 23:38:15 -05002604 Type::Reference(_binding_0, ) => {
2605 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002606 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002607 )
2608 }
David Tolnay6702ade2017-12-30 23:38:15 -05002609 Type::BareFn(_binding_0, ) => {
2610 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
David Tolnay6702ade2017-12-30 23:38:15 -05002614 Type::Never(_binding_0, ) => {
2615 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002616 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002617 )
2618 }
David Tolnay6702ade2017-12-30 23:38:15 -05002619 Type::Tuple(_binding_0, ) => {
2620 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002621 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002622 )
2623 }
David Tolnay6702ade2017-12-30 23:38:15 -05002624 Type::Path(_binding_0, ) => {
2625 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002627 )
2628 }
David Tolnay6702ade2017-12-30 23:38:15 -05002629 Type::TraitObject(_binding_0, ) => {
2630 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002632 )
2633 }
David Tolnay6702ade2017-12-30 23:38:15 -05002634 Type::ImplTrait(_binding_0, ) => {
2635 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002636 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002637 )
2638 }
David Tolnay6702ade2017-12-30 23:38:15 -05002639 Type::Paren(_binding_0, ) => {
2640 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002642 )
2643 }
David Tolnay6702ade2017-12-30 23:38:15 -05002644 Type::Group(_binding_0, ) => {
2645 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002646 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
David Tolnay6702ade2017-12-30 23:38:15 -05002649 Type::Infer(_binding_0, ) => {
2650 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002651 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002652 )
2653 }
David Tolnay6702ade2017-12-30 23:38:15 -05002654 Type::Macro(_binding_0, ) => {
2655 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002656 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002657 )
2658 }
David Tolnay6702ade2017-12-30 23:38:15 -05002659 Type::Verbatim(_binding_0, ) => {
2660 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002661 _visitor.fold_type_verbatim(_binding_0),
2662 )
2663 }
Nika Layzell27726662017-10-24 23:16:35 -04002664 }
2665}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002666# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002667pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2668 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002669 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002670 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002671 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002672 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002673 }
2674}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002675# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002676pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2677 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002678 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2679 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2680 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2681 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2682 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2683 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2684 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2685 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002686 }
2687}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002688# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002689pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2690 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002691 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002692 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002693 }
2694}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002695# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002696pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2697 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002698 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002699 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002700 }
2701}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002702# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002703pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2704 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002705 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002706 }
2707}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002708# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002709pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2710 TypeMacro {
2711 mac: _visitor.fold_macro(_i . mac),
2712 }
2713}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002714# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002715pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2716 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002717 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002718 }
2719}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002720# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002721pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2722 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002723 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002724 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002725 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002726 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002727 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002728 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002729 }
2730}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002731# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002732pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002733 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002734 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002735 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002736 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002737 )
2738 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002739 TypeParamBound::Lifetime(_binding_0, ) => {
2740 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002741 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002742 )
2743 }
2744 }
2745}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002746# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002747pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2748 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002749 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002750 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002751 }
2752}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002753# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002754pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2755 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002756 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002757 path: _visitor.fold_path(_i . path),
2758 }
2759}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002760# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002761pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2762 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002763 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2764 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002765 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2766 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002767 }
2768}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002769# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -08002770pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2771 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002772 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002773 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
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 Tolnayfd6bf5c2017-11-12 09:41:14 -08002779pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2780 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002781 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002782 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002785# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002786pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2787 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002789 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002790 }
2791}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002792# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -05002793pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2794 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002795 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002796 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002797 }
2798}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002799# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002800pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2801 TypeVerbatim {
2802 tts: _i . tts,
2803 }
2804}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002805# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002806pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002807 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002808 UnOp::Deref(_binding_0, ) => {
2809 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002810 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002811 )
2812 }
David Tolnay6702ade2017-12-30 23:38:15 -05002813 UnOp::Not(_binding_0, ) => {
2814 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002815 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002816 )
2817 }
David Tolnay6702ade2017-12-30 23:38:15 -05002818 UnOp::Neg(_binding_0, ) => {
2819 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002820 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002821 )
2822 }
2823 }
2824}
David Tolnay5f332a92017-12-26 00:42:45 -05002825# [ cfg ( feature = "full" ) ]
2826pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2827 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002828 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002829 }
2830}
2831# [ cfg ( feature = "full" ) ]
2832pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2833 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002834 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002835 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2836 }
2837}
2838# [ cfg ( feature = "full" ) ]
2839pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2840 UsePath {
2841 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002842 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002843 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002844 _visitor.fold_ident(( it ) . 1),
2845 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002846 }
2847}
2848# [ cfg ( feature = "full" ) ]
2849pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002850 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002851 UseTree::Path(_binding_0, ) => {
2852 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002853 _visitor.fold_use_path(_binding_0),
2854 )
2855 }
David Tolnay6702ade2017-12-30 23:38:15 -05002856 UseTree::Glob(_binding_0, ) => {
2857 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002858 _visitor.fold_use_glob(_binding_0),
2859 )
2860 }
David Tolnay6702ade2017-12-30 23:38:15 -05002861 UseTree::List(_binding_0, ) => {
2862 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002863 _visitor.fold_use_list(_binding_0),
2864 )
2865 }
2866 }
2867}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002868# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002869pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002870 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002871 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002872 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002873 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002874 discriminant: (_i . discriminant).map(|it| { (
2875 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2876 _visitor.fold_expr(( it ) . 1),
2877 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002878 }
2879}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002880# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002881pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002882 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002883 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002884 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002885 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002886 }
2887}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002888# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002889pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002890 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002891 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002892 }
2893}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002894# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002895pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002896 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002897 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002898 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002899 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002900 path: Box::new(_visitor.fold_path(* _i . path)),
2901 }
2902}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002903# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002904pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002905 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002906 Visibility::Public(_binding_0, ) => {
2907 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002908 _visitor.fold_vis_public(_binding_0),
2909 )
2910 }
David Tolnay6702ade2017-12-30 23:38:15 -05002911 Visibility::Crate(_binding_0, ) => {
2912 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002913 _visitor.fold_vis_crate(_binding_0),
2914 )
2915 }
David Tolnay6702ade2017-12-30 23:38:15 -05002916 Visibility::Restricted(_binding_0, ) => {
2917 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002918 _visitor.fold_vis_restricted(_binding_0),
2919 )
2920 }
David Tolnay6702ade2017-12-30 23:38:15 -05002921 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002922 }
2923}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002924# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002925pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002926 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002927 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002928 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2929 }
2930}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002931# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002932pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002933 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002934 WherePredicate::Type(_binding_0, ) => {
2935 WherePredicate::Type (
2936 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002937 )
2938 }
David Tolnayd4add852018-01-01 20:13:24 -08002939 WherePredicate::Lifetime(_binding_0, ) => {
2940 WherePredicate::Lifetime (
2941 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002942 )
2943 }
David Tolnayd4add852018-01-01 20:13:24 -08002944 WherePredicate::Eq(_binding_0, ) => {
2945 WherePredicate::Eq (
2946 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002947 )
2948 }
2949 }
2950}
2951