blob: 99ec4a2b5fc6031080c87e6c2eaccca44dbd5cd6 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
David Tolnay0afc9b32017-12-27 13:38:24 -05003#![cfg_attr(rustfmt, rustfmt_skip)]
4
Nika Layzell27726662017-10-24 23:16:35 -04005// Unreachable code is generated sometimes without the full feature.
6#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -05007#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -04008
Alex Crichton715862b2018-05-17 12:31:49 -07009#[cfg(any(feature = "full", feature = "derive"))]
Nika Layzella6f46c42017-10-26 15:26:16 -040010use *;
David Tolnay0a0d78c2018-01-05 15:24:01 -080011#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay1e01f9c2017-12-28 20:16:19 -050012use token::{Brace, Bracket, Paren, Group};
Alex Crichtona74a1c82018-05-16 10:20:44 -070013use proc_macro2::{Span, Ident};
David Tolnay0a0d78c2018-01-05 15:24:01 -080014#[cfg(any(feature = "full", feature = "derive"))]
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
David Tolnay0a0d78c2018-01-05 15:24:01 -080023#[cfg(all(feature = "derive", not(feature = "full")))]
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040024macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
David Tolnayded2d682018-01-06 18:53:53 -080029/// Syntax tree traversal to transform the nodes of an owned syntax tree.
Nika Layzell27726662017-10-24 23:16:35 -040030///
David Tolnayded2d682018-01-06 18:53:53 -080031/// See the [module documentation] for details.
Nika Layzell27726662017-10-24 23:16:35 -040032///
David Tolnayded2d682018-01-06 18:53:53 -080033/// [module documentation]: index.html
David Tolnay12374262018-01-07 12:38:34 -080034///
35/// *This trait is available if Syn is built with the `"fold"` feature.*
David Tolnay4b4c4b62018-01-06 13:48:05 -080036pub trait Fold {
David Tolnay3cfd1d32018-01-03 00:22:08 -080037# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040038fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080039# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -050040fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040041# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040042fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040043# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040044fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040045# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040046fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080047# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040048fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080049# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040050fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080051# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040052fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080053# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040054fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080055# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040056fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080057# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040058fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080059# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay506e43a2017-12-29 11:34:36 -050060fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080061# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040062fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080063# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040064fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080065# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050066fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080067# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050068fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080069# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050070fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080071# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050072fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080073# [ cfg ( feature = "derive" ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -050074fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
David Tolnay0a0d78c2018-01-05 15:24:01 -080075# [ cfg ( feature = "derive" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040076fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080077# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040078fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080079# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040080fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080081# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040082fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080083# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040084fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080085# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040086fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080087# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040088fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080089# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040090fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080091# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040092fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080093# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040094fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080095# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040096fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080097# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040098fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -080099# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400100fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800101# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400102fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800103# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400104fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800105# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400106fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800107# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400108fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800109# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400110fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800111# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400112fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800113# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400114fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800115# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400116fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800117# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500118fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800119# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400120fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800121# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500122fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800123# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400124fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800125# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400126fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnay81ab4f62018-01-27 19:02:51 -0800127# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400128fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800129# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400130fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800131# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400132fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800133# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +0200134fn fold_expr_reference(&mut self, i: ExprReference) -> ExprReference { fold_expr_reference(self, i) }
135# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400136fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800137# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500138fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800139# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400140fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800141# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400142fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800143# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500144fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800145# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400146fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800147# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400148fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800149# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500150fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800151# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500152fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800153# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400154fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800155# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400156fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800157# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400158fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800159# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400160fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800161# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400162fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800163# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400164fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800165# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500166fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800167# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500168fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800169# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaye3d41b72017-12-31 15:24:00 -0500170fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400171# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400172fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400174fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400175# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400176fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400177# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400178fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400180fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400181# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400182fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800183# [ cfg ( feature = "full" ) ]
184fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500185# [ cfg ( feature = "full" ) ]
186fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800187# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500188fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800189# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500190fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800191# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayc2f1aba2017-11-12 20:29:22 -0800192fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800193# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400194fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Alex Crichtond261d092018-05-18 13:47:35 -0700195
196fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400198fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400199# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400200fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400201# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800202fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400204fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400206fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500207# [ cfg ( feature = "full" ) ]
208fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800209# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500210fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400212fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400213# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400214fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400216fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400218fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400219# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400220fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400222fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400223# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400224fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400225# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800226fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400227# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800228fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400230fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400232fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400234fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400235# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400236fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400237# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800238fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400240fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400241# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400242fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500243# [ cfg ( feature = "full" ) ]
244fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800245# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -0500246fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800247# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500248fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800249# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400250fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800251# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500252fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
David Tolnay360efd22018-01-04 23:35:26 -0800253# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
254fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
255# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
256fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
257# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
258fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
259# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
260fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
261# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
262fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
263# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
264fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
265# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
266fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
267# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
268fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800269# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400270fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800271# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800272fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800273# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -0500274fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800275# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500276fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800277# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800278fn fold_meta(&mut self, i: Meta) -> Meta { fold_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800279# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800280fn fold_meta_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800281# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400282fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400283# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400284fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800285# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500286fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800287# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800288fn fold_nested_meta(&mut self, i: NestedMeta) -> NestedMeta { fold_nested_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800289# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500290fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800291# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400292fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800293# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400294fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800295# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400296fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800297# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400298fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800299# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500300fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800301# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400302fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800303# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400304fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800305# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400306fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800307# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400308fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800309# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400310fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800311# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400312fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800313# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400314fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800315# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500316fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800317# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400318fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800319# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400320fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800321# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500322fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800323# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400324fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800325# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800326fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800327# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800328fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800329# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800330fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800331# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400332fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800333# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400334fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800335# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -0800336fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500337
338fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800339# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400340fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800341# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -0800342fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800343# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400344fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400345# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400346fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400347# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400348fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400349# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800350fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400351# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400352fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400353# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400354fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500355# [ cfg ( feature = "full" ) ]
356fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800357# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800358fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800359# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800361# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800362fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800363# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800364fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800365# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800366fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800367# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800368fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800369# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500370fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800371# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800372fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800373# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800374fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800375# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800376fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800377# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800378fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800379# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800380fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800381# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800382fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800383# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -0800384fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800385# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800386fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800387# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800388fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800389# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500390fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800391# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500392fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800393# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400394fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500395# [ cfg ( feature = "full" ) ]
396fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
397# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200398fn fold_use_group(&mut self, i: UseGroup) -> UseGroup { fold_use_group(self, i) }
399# [ cfg ( feature = "full" ) ]
400fn fold_use_name(&mut self, i: UseName) -> UseName { fold_use_name(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500401# [ cfg ( feature = "full" ) ]
402fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
403# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200404fn fold_use_rename(&mut self, i: UseRename) -> UseRename { fold_use_rename(self, i) }
405# [ cfg ( feature = "full" ) ]
David Tolnay5f332a92017-12-26 00:42:45 -0500406fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800407# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400408fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800409# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400410fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800411# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400412fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800413# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400414fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800415# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400416fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800417# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400418fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800419# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400420fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400421
Nika Layzell27726662017-10-24 23:16:35 -0400422}
423
David Tolnay360efd22018-01-04 23:35:26 -0800424macro_rules! fold_span_only {
425 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800426 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
Alex Crichton9a4dca22018-03-28 06:32:19 -0700427 let span = _visitor.fold_span(_i.span());
428 _i.set_span(span);
David Tolnay360efd22018-01-04 23:35:26 -0800429 _i
430 }
431 }
David Tolnayd0adf522017-12-29 01:30:07 -0500432}
433
David Tolnay360efd22018-01-04 23:35:26 -0800434fold_span_only!(fold_ident: Ident);
David Tolnay0a0d78c2018-01-05 15:24:01 -0800435#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay360efd22018-01-04 23:35:26 -0800436fold_span_only!(fold_lifetime: Lifetime);
437#[cfg(any(feature = "full", feature = "derive"))]
438fold_span_only!(fold_lit_byte: LitByte);
439#[cfg(any(feature = "full", feature = "derive"))]
440fold_span_only!(fold_lit_byte_str: LitByteStr);
441#[cfg(any(feature = "full", feature = "derive"))]
442fold_span_only!(fold_lit_char: LitChar);
443#[cfg(any(feature = "full", feature = "derive"))]
444fold_span_only!(fold_lit_float: LitFloat);
445#[cfg(any(feature = "full", feature = "derive"))]
446fold_span_only!(fold_lit_int: LitInt);
447#[cfg(any(feature = "full", feature = "derive"))]
448fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500449
David Tolnay3cfd1d32018-01-03 00:22:08 -0800450# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800451pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400452 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500453 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayc2749802018-01-06 23:40:41 -0800454 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400455 }
456}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800457# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800458pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500459 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500460 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500461 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500462 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500463 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400464 }
465}
466# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800467pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400468 ArgCaptured {
469 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800471 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400472 }
473}
474# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800475pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400476 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500477 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400479 }
480}
481# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800482pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400483 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500484 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500485 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500486 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500487 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400488 }
489}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800490# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800491pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400492 Arm {
493 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay18cc4d42018-03-31 18:47:20 +0200494 leading_vert: (_i . leading_vert).map(|it| { Token ! [ | ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400495 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500496 guard: (_i . guard).map(|it| { (
497 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
498 Box::new(_visitor.fold_expr(* ( it ) . 1)),
499 ) }),
David Tolnaydfb91432018-03-31 19:19:44 +0200500 fat_arrow_token: Token ! [ => ](tokens_helper(_visitor, &(_i . fat_arrow_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400501 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500502 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400503 }
504}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800505# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800506pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400507 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500508 AttrStyle::Outer => { AttrStyle::Outer }
509 AttrStyle::Inner(_binding_0, ) => {
510 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500511 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400512 )
513 }
514 }
515}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800516# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800517pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400518 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500520 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500521 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400522 path: _visitor.fold_path(_i . path),
523 tts: _i . tts,
524 is_sugared_doc: _i . is_sugared_doc,
525 }
526}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800527# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800528pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400529 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500530 name: (_i . name).map(|it| { (
531 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500532 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500533 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800534 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400535 }
536}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800537# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800538pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400539 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500540 BareFnArgName::Named(_binding_0, ) => {
541 BareFnArgName::Named (
Alex Crichtond261d092018-05-18 13:47:35 -0700542 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400543 )
544 }
David Tolnay6702ade2017-12-30 23:38:15 -0500545 BareFnArgName::Wild(_binding_0, ) => {
546 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500547 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400548 )
549 }
550 }
551}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800552# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800553pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400554 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500555 BinOp::Add(_binding_0, ) => {
556 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500557 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400558 )
559 }
David Tolnay6702ade2017-12-30 23:38:15 -0500560 BinOp::Sub(_binding_0, ) => {
561 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500562 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400563 )
564 }
David Tolnay6702ade2017-12-30 23:38:15 -0500565 BinOp::Mul(_binding_0, ) => {
566 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500567 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400568 )
569 }
David Tolnay6702ade2017-12-30 23:38:15 -0500570 BinOp::Div(_binding_0, ) => {
571 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500572 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400573 )
574 }
David Tolnay6702ade2017-12-30 23:38:15 -0500575 BinOp::Rem(_binding_0, ) => {
576 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500577 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400578 )
579 }
David Tolnay6702ade2017-12-30 23:38:15 -0500580 BinOp::And(_binding_0, ) => {
581 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500582 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400583 )
584 }
David Tolnay6702ade2017-12-30 23:38:15 -0500585 BinOp::Or(_binding_0, ) => {
586 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500587 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400588 )
589 }
David Tolnay6702ade2017-12-30 23:38:15 -0500590 BinOp::BitXor(_binding_0, ) => {
591 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500592 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400593 )
594 }
David Tolnay6702ade2017-12-30 23:38:15 -0500595 BinOp::BitAnd(_binding_0, ) => {
596 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500597 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400598 )
599 }
David Tolnay6702ade2017-12-30 23:38:15 -0500600 BinOp::BitOr(_binding_0, ) => {
601 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500602 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400603 )
604 }
David Tolnay6702ade2017-12-30 23:38:15 -0500605 BinOp::Shl(_binding_0, ) => {
606 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500607 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400608 )
609 }
David Tolnay6702ade2017-12-30 23:38:15 -0500610 BinOp::Shr(_binding_0, ) => {
611 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500612 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400613 )
614 }
David Tolnay6702ade2017-12-30 23:38:15 -0500615 BinOp::Eq(_binding_0, ) => {
616 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500617 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400618 )
619 }
David Tolnay6702ade2017-12-30 23:38:15 -0500620 BinOp::Lt(_binding_0, ) => {
621 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500622 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400623 )
624 }
David Tolnay6702ade2017-12-30 23:38:15 -0500625 BinOp::Le(_binding_0, ) => {
626 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500627 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400628 )
629 }
David Tolnay6702ade2017-12-30 23:38:15 -0500630 BinOp::Ne(_binding_0, ) => {
631 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500632 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400633 )
634 }
David Tolnay6702ade2017-12-30 23:38:15 -0500635 BinOp::Ge(_binding_0, ) => {
636 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500637 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400638 )
639 }
David Tolnay6702ade2017-12-30 23:38:15 -0500640 BinOp::Gt(_binding_0, ) => {
641 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500642 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400643 )
644 }
David Tolnay6702ade2017-12-30 23:38:15 -0500645 BinOp::AddEq(_binding_0, ) => {
646 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500647 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400648 )
649 }
David Tolnay6702ade2017-12-30 23:38:15 -0500650 BinOp::SubEq(_binding_0, ) => {
651 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500652 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400653 )
654 }
David Tolnay6702ade2017-12-30 23:38:15 -0500655 BinOp::MulEq(_binding_0, ) => {
656 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500657 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400658 )
659 }
David Tolnay6702ade2017-12-30 23:38:15 -0500660 BinOp::DivEq(_binding_0, ) => {
661 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500662 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400663 )
664 }
David Tolnay6702ade2017-12-30 23:38:15 -0500665 BinOp::RemEq(_binding_0, ) => {
666 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500667 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400668 )
669 }
David Tolnay6702ade2017-12-30 23:38:15 -0500670 BinOp::BitXorEq(_binding_0, ) => {
671 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500672 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400673 )
674 }
David Tolnay6702ade2017-12-30 23:38:15 -0500675 BinOp::BitAndEq(_binding_0, ) => {
676 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500677 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400678 )
679 }
David Tolnay6702ade2017-12-30 23:38:15 -0500680 BinOp::BitOrEq(_binding_0, ) => {
681 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500682 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400683 )
684 }
David Tolnay6702ade2017-12-30 23:38:15 -0500685 BinOp::ShlEq(_binding_0, ) => {
686 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500687 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400688 )
689 }
David Tolnay6702ade2017-12-30 23:38:15 -0500690 BinOp::ShrEq(_binding_0, ) => {
691 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500692 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400693 )
694 }
695 }
696}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800697# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800698pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500699 Binding {
Alex Crichtond261d092018-05-18 13:47:35 -0700700 ident: _visitor.fold_ident(_i . ident),
David Tolnay506e43a2017-12-29 11:34:36 -0500701 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
702 ty: _visitor.fold_type(_i . ty),
703 }
704}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800705# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800706pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400707 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500708 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400709 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
710 }
711}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800712# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800713pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400714 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500715 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
716 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400719 }
720}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800721# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800722pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500723 ConstParam {
724 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -0700726 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500728 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500729 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500730 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
731 }
732}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800733# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800734pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500735 match _i {
736 Data::Struct(_binding_0, ) => {
737 Data::Struct (
738 _visitor.fold_data_struct(_binding_0),
739 )
740 }
741 Data::Enum(_binding_0, ) => {
742 Data::Enum (
743 _visitor.fold_data_enum(_binding_0),
744 )
745 }
746 Data::Union(_binding_0, ) => {
747 Data::Union (
748 _visitor.fold_data_union(_binding_0),
749 )
750 }
751 }
752}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800753# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800754pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500755 DataEnum {
756 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
757 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
758 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
759 }
760}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800761# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800762pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500763 DataStruct {
764 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
765 fields: _visitor.fold_fields(_i . fields),
766 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
767 }
768}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800769# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800770pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500771 DataUnion {
772 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
773 fields: _visitor.fold_fields_named(_i . fields),
774 }
775}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800776# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800777pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400778 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400779 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500780 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -0700781 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400782 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500783 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400784 }
785}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800786# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800787pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400788 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500789 Expr::Box(_binding_0, ) => {
790 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400791 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400792 )
793 }
David Tolnay6702ade2017-12-30 23:38:15 -0500794 Expr::InPlace(_binding_0, ) => {
795 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400796 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400797 )
798 }
David Tolnay6702ade2017-12-30 23:38:15 -0500799 Expr::Array(_binding_0, ) => {
800 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400801 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400802 )
803 }
David Tolnay6702ade2017-12-30 23:38:15 -0500804 Expr::Call(_binding_0, ) => {
805 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400806 _visitor.fold_expr_call(_binding_0),
807 )
808 }
David Tolnay6702ade2017-12-30 23:38:15 -0500809 Expr::MethodCall(_binding_0, ) => {
810 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400811 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400812 )
813 }
David Tolnay6702ade2017-12-30 23:38:15 -0500814 Expr::Tuple(_binding_0, ) => {
815 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500816 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400817 )
818 }
David Tolnay6702ade2017-12-30 23:38:15 -0500819 Expr::Binary(_binding_0, ) => {
820 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400821 _visitor.fold_expr_binary(_binding_0),
822 )
823 }
David Tolnay6702ade2017-12-30 23:38:15 -0500824 Expr::Unary(_binding_0, ) => {
825 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400826 _visitor.fold_expr_unary(_binding_0),
827 )
828 }
David Tolnay6702ade2017-12-30 23:38:15 -0500829 Expr::Lit(_binding_0, ) => {
830 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500831 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400832 )
833 }
David Tolnay6702ade2017-12-30 23:38:15 -0500834 Expr::Cast(_binding_0, ) => {
835 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400836 _visitor.fold_expr_cast(_binding_0),
837 )
838 }
David Tolnay6702ade2017-12-30 23:38:15 -0500839 Expr::Type(_binding_0, ) => {
840 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500841 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400842 )
843 }
David Tolnay6702ade2017-12-30 23:38:15 -0500844 Expr::If(_binding_0, ) => {
845 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400846 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400847 )
848 }
David Tolnay6702ade2017-12-30 23:38:15 -0500849 Expr::IfLet(_binding_0, ) => {
850 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
David Tolnay6702ade2017-12-30 23:38:15 -0500854 Expr::While(_binding_0, ) => {
855 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
David Tolnay6702ade2017-12-30 23:38:15 -0500859 Expr::WhileLet(_binding_0, ) => {
860 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400861 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400862 )
863 }
David Tolnay6702ade2017-12-30 23:38:15 -0500864 Expr::ForLoop(_binding_0, ) => {
865 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400866 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 )
868 }
David Tolnay6702ade2017-12-30 23:38:15 -0500869 Expr::Loop(_binding_0, ) => {
870 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400871 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400872 )
873 }
David Tolnay6702ade2017-12-30 23:38:15 -0500874 Expr::Match(_binding_0, ) => {
875 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400876 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400877 )
878 }
David Tolnay6702ade2017-12-30 23:38:15 -0500879 Expr::Closure(_binding_0, ) => {
880 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400881 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 )
883 }
David Tolnay6702ade2017-12-30 23:38:15 -0500884 Expr::Unsafe(_binding_0, ) => {
885 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500886 full!(_visitor.fold_expr_unsafe(_binding_0)),
887 )
888 }
David Tolnay6702ade2017-12-30 23:38:15 -0500889 Expr::Block(_binding_0, ) => {
890 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400891 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
David Tolnay6702ade2017-12-30 23:38:15 -0500894 Expr::Assign(_binding_0, ) => {
895 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400896 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
David Tolnay6702ade2017-12-30 23:38:15 -0500899 Expr::AssignOp(_binding_0, ) => {
900 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400901 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400902 )
903 }
David Tolnay6702ade2017-12-30 23:38:15 -0500904 Expr::Field(_binding_0, ) => {
905 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400906 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400907 )
908 }
David Tolnay6702ade2017-12-30 23:38:15 -0500909 Expr::Index(_binding_0, ) => {
910 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400911 _visitor.fold_expr_index(_binding_0),
912 )
913 }
David Tolnay6702ade2017-12-30 23:38:15 -0500914 Expr::Range(_binding_0, ) => {
915 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400916 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400917 )
918 }
David Tolnay6702ade2017-12-30 23:38:15 -0500919 Expr::Path(_binding_0, ) => {
920 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400921 _visitor.fold_expr_path(_binding_0),
922 )
923 }
David Tolnay00674ba2018-03-31 18:14:11 +0200924 Expr::Reference(_binding_0, ) => {
925 Expr::Reference (
926 full!(_visitor.fold_expr_reference(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400927 )
928 }
David Tolnay6702ade2017-12-30 23:38:15 -0500929 Expr::Break(_binding_0, ) => {
930 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400931 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400932 )
933 }
David Tolnay6702ade2017-12-30 23:38:15 -0500934 Expr::Continue(_binding_0, ) => {
935 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400936 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400937 )
938 }
David Tolnay6702ade2017-12-30 23:38:15 -0500939 Expr::Return(_binding_0, ) => {
940 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500941 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400942 )
943 }
David Tolnay6702ade2017-12-30 23:38:15 -0500944 Expr::Macro(_binding_0, ) => {
945 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500946 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400947 )
948 }
David Tolnay6702ade2017-12-30 23:38:15 -0500949 Expr::Struct(_binding_0, ) => {
950 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400951 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400952 )
953 }
David Tolnay6702ade2017-12-30 23:38:15 -0500954 Expr::Repeat(_binding_0, ) => {
955 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400956 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400957 )
958 }
David Tolnay6702ade2017-12-30 23:38:15 -0500959 Expr::Paren(_binding_0, ) => {
960 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800961 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400962 )
963 }
David Tolnay6702ade2017-12-30 23:38:15 -0500964 Expr::Group(_binding_0, ) => {
965 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500966 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400967 )
968 }
David Tolnay6702ade2017-12-30 23:38:15 -0500969 Expr::Try(_binding_0, ) => {
970 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400971 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400972 )
973 }
David Tolnay6702ade2017-12-30 23:38:15 -0500974 Expr::Catch(_binding_0, ) => {
975 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400976 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400977 )
978 }
David Tolnay6702ade2017-12-30 23:38:15 -0500979 Expr::Yield(_binding_0, ) => {
980 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400981 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400982 )
983 }
David Tolnay6702ade2017-12-30 23:38:15 -0500984 Expr::Verbatim(_binding_0, ) => {
985 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500986 _visitor.fold_expr_verbatim(_binding_0),
987 )
988 }
Nika Layzell27726662017-10-24 23:16:35 -0400989 }
990}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800991# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800992pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500993 ExprArray {
994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
995 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500996 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500997 }
998}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800999# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001000pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -05001001 ExprAssign {
1002 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1003 left: Box::new(_visitor.fold_expr(* _i . left)),
1004 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1005 right: Box::new(_visitor.fold_expr(* _i . right)),
1006 }
1007}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001008# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001009pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001010 ExprAssignOp {
1011 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1012 left: Box::new(_visitor.fold_expr(* _i . left)),
1013 op: _visitor.fold_bin_op(_i . op),
1014 right: Box::new(_visitor.fold_expr(* _i . right)),
1015 }
1016}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001017# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001018pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001019 ExprBinary {
1020 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1021 left: Box::new(_visitor.fold_expr(* _i . left)),
1022 op: _visitor.fold_bin_op(_i . op),
1023 right: Box::new(_visitor.fold_expr(* _i . right)),
1024 }
1025}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001026# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001027pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001028 ExprBlock {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 block: _visitor.fold_block(_i . block),
1031 }
1032}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001033# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001034pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001035 ExprBox {
1036 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1037 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1038 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1039 }
1040}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001041# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001042pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001043 ExprBreak {
1044 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1045 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1046 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1047 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1048 }
1049}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001050# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001051pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001052 ExprCall {
1053 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1054 func: Box::new(_visitor.fold_expr(* _i . func)),
1055 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1056 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1057 }
1058}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001059# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001060pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001061 ExprCast {
1062 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1063 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1064 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1065 ty: Box::new(_visitor.fold_type(* _i . ty)),
1066 }
1067}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001068# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001069pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001070 ExprCatch {
1071 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1072 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1073 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1074 block: _visitor.fold_block(_i . block),
1075 }
1076}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001077# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001078pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001079 ExprClosure {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay13d4c0e2018-03-31 20:53:59 +02001081 movability: (_i . movability).map(|it| { Token ! [ static ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001082 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001083 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1084 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1085 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1086 output: _visitor.fold_return_type(_i . output),
1087 body: Box::new(_visitor.fold_expr(* _i . body)),
1088 }
1089}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001090# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001091pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001092 ExprContinue {
1093 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1094 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1095 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1096 }
1097}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001098# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001099pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001100 ExprField {
1101 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1102 base: Box::new(_visitor.fold_expr(* _i . base)),
1103 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1104 member: _visitor.fold_member(_i . member),
1105 }
1106}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001107# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001108pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001109 ExprForLoop {
1110 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001111 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001112 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1113 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1114 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1115 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1116 body: _visitor.fold_block(_i . body),
1117 }
1118}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001119# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001120pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001121 ExprGroup {
1122 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1123 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1124 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1125 }
1126}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001127# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001128pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001129 ExprIf {
1130 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1131 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1132 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001133 then_branch: _visitor.fold_block(_i . then_branch),
1134 else_branch: (_i . else_branch).map(|it| { (
1135 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1136 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1137 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001138 }
1139}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001140# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001141pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001142 ExprIfLet {
1143 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1144 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1145 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001146 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001147 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1148 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001149 then_branch: _visitor.fold_block(_i . then_branch),
1150 else_branch: (_i . else_branch).map(|it| { (
1151 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1152 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1153 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001154 }
1155}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001156# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001157pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001158 ExprInPlace {
1159 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1160 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001161 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001162 value: Box::new(_visitor.fold_expr(* _i . value)),
1163 }
1164}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001165# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001166pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001167 ExprIndex {
1168 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1169 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1170 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1171 index: Box::new(_visitor.fold_expr(* _i . index)),
1172 }
1173}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001174# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001175pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001176 ExprLit {
1177 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1178 lit: _visitor.fold_lit(_i . lit),
1179 }
1180}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001181# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001182pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001183 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001184 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001185 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001186 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1187 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
1189}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001190# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001191pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001192 ExprMacro {
1193 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1194 mac: _visitor.fold_macro(_i . mac),
1195 }
1196}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001197# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001198pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001199 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001200 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001201 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001202 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001203 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001204 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1205 }
1206}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001207# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001208pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001209 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001210 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001211 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001212 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001213 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001214 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001215 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1216 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001217 }
1218}
David Tolnay81ab4f62018-01-27 19:02:51 -08001219# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001220pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001221 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001222 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001223 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001224 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001225 }
1226}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001227# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001228pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001229 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001230 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001231 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001232 path: _visitor.fold_path(_i . path),
1233 }
1234}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001235# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001236pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001237 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001238 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001239 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001240 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001241 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
1243}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001244# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +02001245pub fn fold_expr_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReference) -> ExprReference {
1246 ExprReference {
1247 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1248 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1249 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1250 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1251 }
1252}
1253# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001254pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001255 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001256 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001257 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001258 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001259 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001260 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001261 }
1262}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001263# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001264pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001265 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001266 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001267 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001268 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001269 }
1270}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001271# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001272pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001273 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001274 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001275 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001276 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001277 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1278 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1279 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001280 }
1281}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001282# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001283pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001284 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001285 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001286 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001287 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
1289}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001290# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001291pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001292 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001293 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001294 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001295 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001296 }
1297}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001298# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001299pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001300 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001301 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001302 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001303 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001304 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001305 }
1306}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001307# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001308pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001309 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001310 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001311 op: _visitor.fold_un_op(_i . op),
1312 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1313 }
1314}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001315# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001316pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001317 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001318 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001319 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001320 block: _visitor.fold_block(_i . block),
1321 }
1322}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001323# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001324pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001325 ExprVerbatim {
1326 tts: _i . tts,
1327 }
1328}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001329# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001330pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001331 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001332 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001333 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001334 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001335 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1336 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001337 }
1338}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001339# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001340pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001341 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001342 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001343 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001344 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1345 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001346 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001347 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001348 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1349 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001350 }
1351}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001352# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001353pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001354 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001355 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001356 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001357 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001358 }
1359}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001360# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001361pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001362 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001363 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001364 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001365 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001366 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001367 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001368 }
1369}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001370# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001371pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001372 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001373 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001374 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001375 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001376 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001377 }
1378}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001379# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001380pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001381 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001382 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1383 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001384 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001385 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001386 }
1387}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001388# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001389pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001390 match _i {
1391 Fields::Named(_binding_0, ) => {
1392 Fields::Named (
1393 _visitor.fold_fields_named(_binding_0),
1394 )
1395 }
1396 Fields::Unnamed(_binding_0, ) => {
1397 Fields::Unnamed (
1398 _visitor.fold_fields_unnamed(_binding_0),
1399 )
1400 }
1401 Fields::Unit => { Fields::Unit }
1402 }
1403}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001404# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001405pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001406 FieldsNamed {
1407 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001408 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001409 }
1410}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001411# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001412pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001413 FieldsUnnamed {
1414 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001415 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001416 }
1417}
Nika Layzell27726662017-10-24 23:16:35 -04001418# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001419pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001420 File {
1421 shebang: _i . shebang,
1422 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1423 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1424 }
1425}
1426# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001427pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001428 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001429 FnArg::SelfRef(_binding_0, ) => {
1430 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001431 _visitor.fold_arg_self_ref(_binding_0),
1432 )
1433 }
David Tolnay6702ade2017-12-30 23:38:15 -05001434 FnArg::SelfValue(_binding_0, ) => {
1435 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001436 _visitor.fold_arg_self(_binding_0),
1437 )
1438 }
David Tolnay6702ade2017-12-30 23:38:15 -05001439 FnArg::Captured(_binding_0, ) => {
1440 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001441 _visitor.fold_arg_captured(_binding_0),
1442 )
1443 }
David Tolnay6702ade2017-12-30 23:38:15 -05001444 FnArg::Inferred(_binding_0, ) => {
1445 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001446 _visitor.fold_pat(_binding_0),
1447 )
1448 }
David Tolnay6702ade2017-12-30 23:38:15 -05001449 FnArg::Ignored(_binding_0, ) => {
1450 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001451 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001452 )
1453 }
1454 }
1455}
1456# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001457pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001458 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001459 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001460 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001461 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001462 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001463 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001464 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001465 }
1466}
1467# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001468pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001469 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001470 ForeignItem::Fn(_binding_0, ) => {
1471 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001472 _visitor.fold_foreign_item_fn(_binding_0),
1473 )
1474 }
David Tolnay6702ade2017-12-30 23:38:15 -05001475 ForeignItem::Static(_binding_0, ) => {
1476 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001477 _visitor.fold_foreign_item_static(_binding_0),
1478 )
1479 }
David Tolnay6702ade2017-12-30 23:38:15 -05001480 ForeignItem::Type(_binding_0, ) => {
1481 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001482 _visitor.fold_foreign_item_type(_binding_0),
1483 )
1484 }
David Tolnay6702ade2017-12-30 23:38:15 -05001485 ForeignItem::Verbatim(_binding_0, ) => {
1486 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001487 _visitor.fold_foreign_item_verbatim(_binding_0),
1488 )
1489 }
Nika Layzell27726662017-10-24 23:16:35 -04001490 }
1491}
1492# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001493pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001494 ForeignItemFn {
1495 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1496 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtond261d092018-05-18 13:47:35 -07001497 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001498 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001499 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001500 }
1501}
1502# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001503pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001504 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001505 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1506 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001507 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001508 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001509 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001510 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001511 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001512 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001513 }
1514}
David Tolnay199bcbb2017-11-12 10:33:52 -08001515# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001516pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001517 ForeignItemType {
1518 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1519 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001520 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001521 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001522 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001523 }
1524}
David Tolnay2ae520a2017-12-29 11:19:50 -05001525# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001526pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001527 ForeignItemVerbatim {
1528 tts: _i . tts,
1529 }
1530}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001531# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001532pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001533 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001534 GenericArgument::Lifetime(_binding_0, ) => {
1535 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001536 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001537 )
1538 }
David Tolnay6702ade2017-12-30 23:38:15 -05001539 GenericArgument::Type(_binding_0, ) => {
1540 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001541 _visitor.fold_type(_binding_0),
1542 )
1543 }
David Tolnay6702ade2017-12-30 23:38:15 -05001544 GenericArgument::Binding(_binding_0, ) => {
1545 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001546 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001547 )
1548 }
David Tolnay6702ade2017-12-30 23:38:15 -05001549 GenericArgument::Const(_binding_0, ) => {
1550 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001551 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001552 )
1553 }
Nika Layzell357885a2017-12-04 15:47:07 -05001554 }
1555}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001556# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001557pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001558 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001559 GenericMethodArgument::Type(_binding_0, ) => {
1560 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001561 _visitor.fold_type(_binding_0),
1562 )
1563 }
David Tolnay6702ade2017-12-30 23:38:15 -05001564 GenericMethodArgument::Const(_binding_0, ) => {
1565 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001566 _visitor.fold_expr(_binding_0),
1567 )
1568 }
1569 }
1570}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001571# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001572pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001573 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001574 GenericParam::Type(_binding_0, ) => {
1575 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001576 _visitor.fold_type_param(_binding_0),
1577 )
1578 }
David Tolnay517f3692018-01-01 20:17:23 -08001579 GenericParam::Lifetime(_binding_0, ) => {
1580 GenericParam::Lifetime (
1581 _visitor.fold_lifetime_def(_binding_0),
1582 )
1583 }
David Tolnay6702ade2017-12-30 23:38:15 -05001584 GenericParam::Const(_binding_0, ) => {
1585 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001586 _visitor.fold_const_param(_binding_0),
1587 )
1588 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001589 }
1590}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001591# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001592pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001593 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001594 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001595 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001596 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001597 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001598 }
1599}
Alex Crichtond261d092018-05-18 13:47:35 -07001600
1601pub fn fold_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
1602 _i
1603}
Nika Layzell27726662017-10-24 23:16:35 -04001604# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001605pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001606 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001607 ImplItem::Const(_binding_0, ) => {
1608 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001609 _visitor.fold_impl_item_const(_binding_0),
1610 )
1611 }
David Tolnay6702ade2017-12-30 23:38:15 -05001612 ImplItem::Method(_binding_0, ) => {
1613 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001614 _visitor.fold_impl_item_method(_binding_0),
1615 )
1616 }
David Tolnay6702ade2017-12-30 23:38:15 -05001617 ImplItem::Type(_binding_0, ) => {
1618 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001619 _visitor.fold_impl_item_type(_binding_0),
1620 )
1621 }
David Tolnay6702ade2017-12-30 23:38:15 -05001622 ImplItem::Macro(_binding_0, ) => {
1623 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001624 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001625 )
1626 }
David Tolnay6702ade2017-12-30 23:38:15 -05001627 ImplItem::Verbatim(_binding_0, ) => {
1628 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001629 _visitor.fold_impl_item_verbatim(_binding_0),
1630 )
1631 }
Nika Layzell27726662017-10-24 23:16:35 -04001632 }
1633}
1634# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001635pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001636 ImplItemConst {
1637 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1638 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001639 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001640 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001641 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001642 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001643 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001644 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001645 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001646 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001647 }
1648}
1649# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001650pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001651 ImplItemMacro {
1652 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1653 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001654 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001655 }
1656}
1657# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001658pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001659 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001660 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001661 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001662 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001663 sig: _visitor.fold_method_sig(_i . sig),
1664 block: _visitor.fold_block(_i . block),
1665 }
1666}
1667# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001668pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001669 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001670 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001671 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001672 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001673 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001674 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001675 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001676 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001677 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001678 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001679 }
1680}
David Tolnay2ae520a2017-12-29 11:19:50 -05001681# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001682pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001683 ImplItemVerbatim {
1684 tts: _i . tts,
1685 }
1686}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001687# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001688pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001689 Index {
1690 index: _i . index,
1691 span: _visitor.fold_span(_i . span),
1692 }
1693}
1694# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001695pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001696 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001697 Item::ExternCrate(_binding_0, ) => {
1698 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001699 _visitor.fold_item_extern_crate(_binding_0),
1700 )
1701 }
David Tolnay6702ade2017-12-30 23:38:15 -05001702 Item::Use(_binding_0, ) => {
1703 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001704 _visitor.fold_item_use(_binding_0),
1705 )
1706 }
David Tolnay6702ade2017-12-30 23:38:15 -05001707 Item::Static(_binding_0, ) => {
1708 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001709 _visitor.fold_item_static(_binding_0),
1710 )
1711 }
David Tolnay6702ade2017-12-30 23:38:15 -05001712 Item::Const(_binding_0, ) => {
1713 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001714 _visitor.fold_item_const(_binding_0),
1715 )
1716 }
David Tolnay6702ade2017-12-30 23:38:15 -05001717 Item::Fn(_binding_0, ) => {
1718 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001719 _visitor.fold_item_fn(_binding_0),
1720 )
1721 }
David Tolnay6702ade2017-12-30 23:38:15 -05001722 Item::Mod(_binding_0, ) => {
1723 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001724 _visitor.fold_item_mod(_binding_0),
1725 )
1726 }
David Tolnay6702ade2017-12-30 23:38:15 -05001727 Item::ForeignMod(_binding_0, ) => {
1728 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001729 _visitor.fold_item_foreign_mod(_binding_0),
1730 )
1731 }
David Tolnay6702ade2017-12-30 23:38:15 -05001732 Item::Type(_binding_0, ) => {
1733 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001734 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001735 )
1736 }
David Tolnay6702ade2017-12-30 23:38:15 -05001737 Item::Struct(_binding_0, ) => {
1738 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001739 _visitor.fold_item_struct(_binding_0),
1740 )
1741 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001742 Item::Enum(_binding_0, ) => {
1743 Item::Enum (
1744 _visitor.fold_item_enum(_binding_0),
1745 )
1746 }
David Tolnay6702ade2017-12-30 23:38:15 -05001747 Item::Union(_binding_0, ) => {
1748 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001749 _visitor.fold_item_union(_binding_0),
1750 )
1751 }
David Tolnay6702ade2017-12-30 23:38:15 -05001752 Item::Trait(_binding_0, ) => {
1753 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001754 _visitor.fold_item_trait(_binding_0),
1755 )
1756 }
David Tolnay6702ade2017-12-30 23:38:15 -05001757 Item::Impl(_binding_0, ) => {
1758 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001759 _visitor.fold_item_impl(_binding_0),
1760 )
1761 }
David Tolnay6702ade2017-12-30 23:38:15 -05001762 Item::Macro(_binding_0, ) => {
1763 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001764 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001765 )
1766 }
David Tolnay6702ade2017-12-30 23:38:15 -05001767 Item::Macro2(_binding_0, ) => {
1768 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001769 _visitor.fold_item_macro2(_binding_0),
1770 )
1771 }
David Tolnay6702ade2017-12-30 23:38:15 -05001772 Item::Verbatim(_binding_0, ) => {
1773 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001774 _visitor.fold_item_verbatim(_binding_0),
1775 )
1776 }
Nika Layzell27726662017-10-24 23:16:35 -04001777 }
1778}
1779# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001780pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 ItemConst {
1782 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1783 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001785 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001786 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001787 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001788 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001790 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 }
1792}
1793# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001794pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001795 ItemEnum {
1796 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1797 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001798 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001799 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001800 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001801 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001802 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1803 }
1804}
1805# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001806pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001807 ItemExternCrate {
1808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1809 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1811 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001812 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001813 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001814 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001815 _visitor.fold_ident(( it ) . 1),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001816 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001817 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001818 }
1819}
1820# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001821pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001822 ItemFn {
1823 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1824 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001825 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001826 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001827 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001828 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001829 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001830 block: Box::new(_visitor.fold_block(* _i . block)),
1831 }
1832}
1833# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001834pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 ItemForeignMod {
1836 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1837 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001838 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001839 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1840 }
1841}
1842# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001843pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001844 ItemImpl {
1845 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001846 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001847 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001848 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001850 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001851 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001852 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001853 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001854 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001855 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001856 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001857 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1858 }
1859}
1860# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001861pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001862 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001863 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001864 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001865 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001866 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001867 }
1868}
1869# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001870pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001871 ItemMacro2 {
1872 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1873 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001874 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001875 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001876 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001877 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001878 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001879 body: _i . body,
1880 }
1881}
1882# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001883pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001884 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001885 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001886 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001888 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001889 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001890 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001891 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1892 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001893 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001894 }
1895}
1896# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001897pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001898 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001899 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001900 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001901 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001902 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07001903 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001904 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001905 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001907 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001908 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001909 }
1910}
1911# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001912pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001913 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001915 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001917 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001918 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001919 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001920 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001921 }
1922}
1923# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001924pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001925 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001926 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001927 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001928 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001929 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1930 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001931 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001932 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001933 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001934 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001935 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001936 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1937 }
1938}
1939# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001940pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001941 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001942 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001943 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001944 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001945 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001946 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001947 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001948 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001949 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001950 }
1951}
1952# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001953pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001954 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001955 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001956 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001957 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07001958 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001959 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001960 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001961 }
1962}
1963# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001964pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001965 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001966 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001967 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001968 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1969 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001970 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001971 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001972 }
1973}
David Tolnay2ae520a2017-12-29 11:19:50 -05001974# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001975pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001976 ItemVerbatim {
1977 tts: _i . tts,
1978 }
1979}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001980# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001981pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001982 Label {
1983 name: _visitor.fold_lifetime(_i . name),
1984 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1985 }
1986}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001987# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001988pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001989 LifetimeDef {
1990 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001991 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001992 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001993 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1994 }
1995}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001996# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001997pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001998 match _i {
1999 Lit::Str(_binding_0, ) => {
2000 Lit::Str (
2001 _visitor.fold_lit_str(_binding_0),
2002 )
2003 }
2004 Lit::ByteStr(_binding_0, ) => {
2005 Lit::ByteStr (
2006 _visitor.fold_lit_byte_str(_binding_0),
2007 )
2008 }
2009 Lit::Byte(_binding_0, ) => {
2010 Lit::Byte (
2011 _visitor.fold_lit_byte(_binding_0),
2012 )
2013 }
2014 Lit::Char(_binding_0, ) => {
2015 Lit::Char (
2016 _visitor.fold_lit_char(_binding_0),
2017 )
2018 }
2019 Lit::Int(_binding_0, ) => {
2020 Lit::Int (
2021 _visitor.fold_lit_int(_binding_0),
2022 )
2023 }
2024 Lit::Float(_binding_0, ) => {
2025 Lit::Float (
2026 _visitor.fold_lit_float(_binding_0),
2027 )
2028 }
2029 Lit::Bool(_binding_0, ) => {
2030 Lit::Bool (
2031 _visitor.fold_lit_bool(_binding_0),
2032 )
2033 }
2034 Lit::Verbatim(_binding_0, ) => {
2035 Lit::Verbatim (
2036 _visitor.fold_lit_verbatim(_binding_0),
2037 )
2038 }
2039 }
2040}
2041# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002042pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002043 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002044 value: _i . value,
2045 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
2047}
David Tolnay360efd22018-01-04 23:35:26 -08002048# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002049pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002050 LitVerbatim {
2051 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002052 }
2053}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002054# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002055pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002056 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002057 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002058 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02002059 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -05002060 ty: (_i . ty).map(|it| { (
2061 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2062 Box::new(_visitor.fold_type(* ( it ) . 1)),
2063 ) }),
2064 init: (_i . init).map(|it| { (
2065 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2066 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2067 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002068 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002069 }
2070}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002071# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002072pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002073 Macro {
2074 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002075 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002076 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2077 tts: _i . tts,
2078 }
2079}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002080# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002081pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002082 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002083 MacroDelimiter::Paren(_binding_0, ) => {
2084 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002085 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2086 )
2087 }
David Tolnay6702ade2017-12-30 23:38:15 -05002088 MacroDelimiter::Brace(_binding_0, ) => {
2089 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002090 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2091 )
2092 }
David Tolnay6702ade2017-12-30 23:38:15 -05002093 MacroDelimiter::Bracket(_binding_0, ) => {
2094 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002095 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2096 )
2097 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002098 }
2099}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002100# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002101pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002102 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002103 Member::Named(_binding_0, ) => {
2104 Member::Named (
Alex Crichtond261d092018-05-18 13:47:35 -07002105 _visitor.fold_ident(_binding_0),
David Tolnay85b69a42017-12-27 20:43:10 -05002106 )
2107 }
David Tolnay6702ade2017-12-30 23:38:15 -05002108 Member::Unnamed(_binding_0, ) => {
2109 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002110 _visitor.fold_index(_binding_0),
2111 )
2112 }
2113 }
2114}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002115# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002116pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002117 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002118 Meta::Word(_binding_0, ) => {
2119 Meta::Word (
Alex Crichtond261d092018-05-18 13:47:35 -07002120 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002121 )
2122 }
David Tolnayaaadd782018-01-06 22:58:13 -08002123 Meta::List(_binding_0, ) => {
2124 Meta::List (
2125 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002126 )
2127 }
David Tolnayaaadd782018-01-06 22:58:13 -08002128 Meta::NameValue(_binding_0, ) => {
2129 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002130 _visitor.fold_meta_name_value(_binding_0),
2131 )
2132 }
2133 }
2134}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002135# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002136pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2137 MetaList {
Alex Crichtond261d092018-05-18 13:47:35 -07002138 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002139 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002140 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002141 }
2142}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002143# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002144pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002145 MetaNameValue {
Alex Crichtond261d092018-05-18 13:47:35 -07002146 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002147 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002148 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002149 }
2150}
2151# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002152pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002153 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002154 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002155 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002156 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002157 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002158 decl: _visitor.fold_fn_decl(_i . decl),
2159 }
2160}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002161# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002162pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002163 MethodTurbofish {
2164 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2165 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2166 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2167 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2168 }
2169}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002170# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002171pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002172 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002173 NestedMeta::Meta(_binding_0, ) => {
2174 NestedMeta::Meta (
2175 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002176 )
2177 }
David Tolnayaaadd782018-01-06 22:58:13 -08002178 NestedMeta::Literal(_binding_0, ) => {
2179 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002180 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002181 )
2182 }
2183 }
2184}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002185# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002186pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002187 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002188 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002189 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002190 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002191 }
2192}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002193# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002194pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002195 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002196 Pat::Wild(_binding_0, ) => {
2197 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002198 _visitor.fold_pat_wild(_binding_0),
2199 )
2200 }
David Tolnay6702ade2017-12-30 23:38:15 -05002201 Pat::Ident(_binding_0, ) => {
2202 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002203 _visitor.fold_pat_ident(_binding_0),
2204 )
2205 }
David Tolnay6702ade2017-12-30 23:38:15 -05002206 Pat::Struct(_binding_0, ) => {
2207 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002208 _visitor.fold_pat_struct(_binding_0),
2209 )
2210 }
David Tolnay6702ade2017-12-30 23:38:15 -05002211 Pat::TupleStruct(_binding_0, ) => {
2212 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002213 _visitor.fold_pat_tuple_struct(_binding_0),
2214 )
2215 }
David Tolnay6702ade2017-12-30 23:38:15 -05002216 Pat::Path(_binding_0, ) => {
2217 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002218 _visitor.fold_pat_path(_binding_0),
2219 )
2220 }
David Tolnay6702ade2017-12-30 23:38:15 -05002221 Pat::Tuple(_binding_0, ) => {
2222 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002223 _visitor.fold_pat_tuple(_binding_0),
2224 )
2225 }
David Tolnay6702ade2017-12-30 23:38:15 -05002226 Pat::Box(_binding_0, ) => {
2227 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002228 _visitor.fold_pat_box(_binding_0),
2229 )
2230 }
David Tolnay6702ade2017-12-30 23:38:15 -05002231 Pat::Ref(_binding_0, ) => {
2232 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002233 _visitor.fold_pat_ref(_binding_0),
2234 )
2235 }
David Tolnay6702ade2017-12-30 23:38:15 -05002236 Pat::Lit(_binding_0, ) => {
2237 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002238 _visitor.fold_pat_lit(_binding_0),
2239 )
2240 }
David Tolnay6702ade2017-12-30 23:38:15 -05002241 Pat::Range(_binding_0, ) => {
2242 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002243 _visitor.fold_pat_range(_binding_0),
2244 )
2245 }
David Tolnay6702ade2017-12-30 23:38:15 -05002246 Pat::Slice(_binding_0, ) => {
2247 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002248 _visitor.fold_pat_slice(_binding_0),
2249 )
2250 }
David Tolnay6702ade2017-12-30 23:38:15 -05002251 Pat::Macro(_binding_0, ) => {
2252 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002253 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002254 )
2255 }
David Tolnay6702ade2017-12-30 23:38:15 -05002256 Pat::Verbatim(_binding_0, ) => {
2257 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002258 _visitor.fold_pat_verbatim(_binding_0),
2259 )
2260 }
Nika Layzell27726662017-10-24 23:16:35 -04002261 }
2262}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002263# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002264pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002265 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002266 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002267 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002268 }
2269}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002270# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002271pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002272 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002273 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2274 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002275 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002276 subpat: (_i . subpat).map(|it| { (
2277 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2278 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2279 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002280 }
2281}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002282# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002283pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002284 PatLit {
2285 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2286 }
2287}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002288# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002289pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002290 PatMacro {
2291 mac: _visitor.fold_macro(_i . mac),
2292 }
2293}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002294# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002295pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002296 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002297 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002298 path: _visitor.fold_path(_i . path),
2299 }
2300}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002301# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002302pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002303 PatRange {
2304 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002305 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002306 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002307 }
2308}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002309# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002310pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002311 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002312 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002313 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002314 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002315 }
2316}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002317# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002318pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002319 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002320 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002321 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002322 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002323 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002324 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002325 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002326 }
2327}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002328# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002329pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002330 PatStruct {
2331 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002332 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002333 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002334 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002335 }
2336}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002337# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002338pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002339 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002340 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002341 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002342 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002343 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2344 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002345 }
2346}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002347# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002348pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002349 PatTupleStruct {
2350 path: _visitor.fold_path(_i . path),
2351 pat: _visitor.fold_pat_tuple(_i . pat),
2352 }
2353}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002354# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002355pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002356 PatVerbatim {
2357 tts: _i . tts,
2358 }
2359}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002360# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002361pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002362 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002363 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002364 }
2365}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002366# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002367pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002368 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002370 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2371 }
2372}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002373# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002374pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002375 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002376 PathArguments::None => { PathArguments::None }
2377 PathArguments::AngleBracketed(_binding_0, ) => {
2378 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002379 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2380 )
2381 }
David Tolnay6702ade2017-12-30 23:38:15 -05002382 PathArguments::Parenthesized(_binding_0, ) => {
2383 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002384 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2385 )
2386 }
2387 }
2388}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002389# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002390pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002391 PathSegment {
Alex Crichtond261d092018-05-18 13:47:35 -07002392 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002393 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002394 }
2395}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002396# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002397pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002398 PredicateEq {
2399 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2400 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2401 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2402 }
2403}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002404# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002405pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002406 PredicateLifetime {
2407 lifetime: _visitor.fold_lifetime(_i . lifetime),
2408 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2409 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2410 }
2411}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002412# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002413pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002414 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002415 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002416 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2417 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2418 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2419 }
2420}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002421# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002422pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002423 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002424 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002426 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2428 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002429 }
2430}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002431# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002432pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002433 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002434 RangeLimits::HalfOpen(_binding_0, ) => {
2435 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002436 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002437 )
2438 }
David Tolnay6702ade2017-12-30 23:38:15 -05002439 RangeLimits::Closed(_binding_0, ) => {
2440 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002441 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002442 )
2443 }
2444 }
2445}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002446# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002447pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002448 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002449 ReturnType::Default => { ReturnType::Default }
2450 ReturnType::Type(_binding_0, _binding_1, ) => {
2451 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002452 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2453 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002454 )
2455 }
2456 }
2457}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002458
David Tolnay4b4c4b62018-01-06 13:48:05 -08002459pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002460 _i
2461}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002462# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002463pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002464 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002465 Stmt::Local(_binding_0, ) => {
2466 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002467 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002468 )
2469 }
David Tolnay6702ade2017-12-30 23:38:15 -05002470 Stmt::Item(_binding_0, ) => {
2471 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002472 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002473 )
2474 }
David Tolnay6702ade2017-12-30 23:38:15 -05002475 Stmt::Expr(_binding_0, ) => {
2476 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002477 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002478 )
2479 }
David Tolnay6702ade2017-12-30 23:38:15 -05002480 Stmt::Semi(_binding_0, _binding_1, ) => {
2481 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002482 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002483 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002484 )
2485 }
Nika Layzell27726662017-10-24 23:16:35 -04002486 }
2487}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002488# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002489pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002490 TraitBound {
David Tolnayc1f5d5d2018-03-31 22:17:56 +02002491 paren_token: (_i . paren_token).map(|it| { Paren(tokens_helper(_visitor, &(it).0)) }),
David Tolnay40fb8ce2018-01-02 10:53:46 -08002492 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2493 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2494 path: _visitor.fold_path(_i . path),
2495 }
2496}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002497# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002498pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002499 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002500 TraitBoundModifier::None => { TraitBoundModifier::None }
2501 TraitBoundModifier::Maybe(_binding_0, ) => {
2502 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002503 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002504 )
2505 }
2506 }
2507}
2508# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002509pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002510 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002511 TraitItem::Const(_binding_0, ) => {
2512 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002513 _visitor.fold_trait_item_const(_binding_0),
2514 )
2515 }
David Tolnay6702ade2017-12-30 23:38:15 -05002516 TraitItem::Method(_binding_0, ) => {
2517 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002518 _visitor.fold_trait_item_method(_binding_0),
2519 )
2520 }
David Tolnay6702ade2017-12-30 23:38:15 -05002521 TraitItem::Type(_binding_0, ) => {
2522 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002523 _visitor.fold_trait_item_type(_binding_0),
2524 )
2525 }
David Tolnay6702ade2017-12-30 23:38:15 -05002526 TraitItem::Macro(_binding_0, ) => {
2527 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002528 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002529 )
2530 }
David Tolnay6702ade2017-12-30 23:38:15 -05002531 TraitItem::Verbatim(_binding_0, ) => {
2532 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002533 _visitor.fold_trait_item_verbatim(_binding_0),
2534 )
2535 }
Nika Layzell27726662017-10-24 23:16:35 -04002536 }
2537}
2538# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002539pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002540 TraitItemConst {
2541 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002542 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002543 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002544 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002545 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002546 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002548 _visitor.fold_expr(( it ) . 1),
2549 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002550 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002551 }
2552}
2553# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002554pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002555 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002556 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002557 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002558 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002559 }
2560}
2561# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002562pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002563 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002564 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002565 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002566 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002567 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002571pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002572 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002573 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002574 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002575 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002576 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002577 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002578 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002579 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002580 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002581 _visitor.fold_type(( it ) . 1),
2582 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002583 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002584 }
2585}
David Tolnay2ae520a2017-12-29 11:19:50 -05002586# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002587pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002588 TraitItemVerbatim {
2589 tts: _i . tts,
2590 }
2591}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002592# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002593pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002594 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002595 Type::Slice(_binding_0, ) => {
2596 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002598 )
2599 }
David Tolnay6702ade2017-12-30 23:38:15 -05002600 Type::Array(_binding_0, ) => {
2601 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002602 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002603 )
2604 }
David Tolnay6702ade2017-12-30 23:38:15 -05002605 Type::Ptr(_binding_0, ) => {
2606 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002607 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002608 )
2609 }
David Tolnay6702ade2017-12-30 23:38:15 -05002610 Type::Reference(_binding_0, ) => {
2611 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002612 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002613 )
2614 }
David Tolnay6702ade2017-12-30 23:38:15 -05002615 Type::BareFn(_binding_0, ) => {
2616 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002617 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002618 )
2619 }
David Tolnay6702ade2017-12-30 23:38:15 -05002620 Type::Never(_binding_0, ) => {
2621 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002623 )
2624 }
David Tolnay6702ade2017-12-30 23:38:15 -05002625 Type::Tuple(_binding_0, ) => {
2626 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002627 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002628 )
2629 }
David Tolnay6702ade2017-12-30 23:38:15 -05002630 Type::Path(_binding_0, ) => {
2631 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002632 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002633 )
2634 }
David Tolnay6702ade2017-12-30 23:38:15 -05002635 Type::TraitObject(_binding_0, ) => {
2636 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002638 )
2639 }
David Tolnay6702ade2017-12-30 23:38:15 -05002640 Type::ImplTrait(_binding_0, ) => {
2641 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002642 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002643 )
2644 }
David Tolnay6702ade2017-12-30 23:38:15 -05002645 Type::Paren(_binding_0, ) => {
2646 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002647 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002648 )
2649 }
David Tolnay6702ade2017-12-30 23:38:15 -05002650 Type::Group(_binding_0, ) => {
2651 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002652 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002653 )
2654 }
David Tolnay6702ade2017-12-30 23:38:15 -05002655 Type::Infer(_binding_0, ) => {
2656 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002657 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002658 )
2659 }
David Tolnay6702ade2017-12-30 23:38:15 -05002660 Type::Macro(_binding_0, ) => {
2661 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002662 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002663 )
2664 }
David Tolnay6702ade2017-12-30 23:38:15 -05002665 Type::Verbatim(_binding_0, ) => {
2666 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002667 _visitor.fold_type_verbatim(_binding_0),
2668 )
2669 }
Nika Layzell27726662017-10-24 23:16:35 -04002670 }
2671}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002672# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002673pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002674 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002675 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002676 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002677 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002678 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002679 }
2680}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002681# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002682pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002683 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002684 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2685 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2686 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2687 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2688 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2689 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2690 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2691 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002692 }
2693}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002694# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002695pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002696 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002697 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002698 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002699 }
2700}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002701# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002702pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002703 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002704 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002705 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002706 }
2707}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002708# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002709pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002710 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002711 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002712 }
2713}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002714# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002715pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002716 TypeMacro {
2717 mac: _visitor.fold_macro(_i . mac),
2718 }
2719}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002720# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002721pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002722 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002723 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002724 }
2725}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002726# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002727pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002728 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002729 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002730 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002731 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002732 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002733 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002734 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002735 }
2736}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002737# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002738pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002739 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002740 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002741 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002742 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002743 )
2744 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002745 TypeParamBound::Lifetime(_binding_0, ) => {
2746 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002747 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002748 )
2749 }
2750 }
2751}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002752# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002753pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002754 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002755 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002756 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002757 }
2758}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002759# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002760pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002761 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002762 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002763 path: _visitor.fold_path(_i . path),
2764 }
2765}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002766# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002767pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002768 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002769 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2770 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002771 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2772 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002773 }
2774}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002775# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002776pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002777 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002778 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002779 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002780 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2781 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002782 }
2783}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002784# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002785pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002786 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002787 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002788 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002789 }
2790}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002791# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002792pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002793 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002795 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002796 }
2797}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002798# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002799pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002800 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002801 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002802 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002803 }
2804}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002805# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002806pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002807 TypeVerbatim {
2808 tts: _i . tts,
2809 }
2810}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002811# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002812pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002813 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002814 UnOp::Deref(_binding_0, ) => {
2815 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002816 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002817 )
2818 }
David Tolnay6702ade2017-12-30 23:38:15 -05002819 UnOp::Not(_binding_0, ) => {
2820 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002821 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002822 )
2823 }
David Tolnay6702ade2017-12-30 23:38:15 -05002824 UnOp::Neg(_binding_0, ) => {
2825 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002826 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002827 )
2828 }
2829 }
2830}
David Tolnay5f332a92017-12-26 00:42:45 -05002831# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002832pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002833 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002834 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002835 }
2836}
2837# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002838pub fn fold_use_group<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGroup) -> UseGroup {
2839 UseGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002840 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002841 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2842 }
2843}
2844# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002845pub fn fold_use_name<V: Fold + ?Sized>(_visitor: &mut V, _i: UseName) -> UseName {
2846 UseName {
Alex Crichtond261d092018-05-18 13:47:35 -07002847 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002848 }
2849}
2850# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002851pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002852 UsePath {
Alex Crichtond261d092018-05-18 13:47:35 -07002853 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002854 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2855 tree: Box::new(_visitor.fold_use_tree(* _i . tree)),
2856 }
2857}
2858# [ cfg ( feature = "full" ) ]
2859pub fn fold_use_rename<V: Fold + ?Sized>(_visitor: &mut V, _i: UseRename) -> UseRename {
2860 UseRename {
Alex Crichtond261d092018-05-18 13:47:35 -07002861 ident: _visitor.fold_ident(_i . ident),
David Tolnayd97a7d22018-03-31 19:17:01 +02002862 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
Alex Crichtond261d092018-05-18 13:47:35 -07002863 rename: _visitor.fold_ident(_i . rename),
David Tolnay5f332a92017-12-26 00:42:45 -05002864 }
2865}
2866# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002867pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002868 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002869 UseTree::Path(_binding_0, ) => {
2870 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002871 _visitor.fold_use_path(_binding_0),
2872 )
2873 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002874 UseTree::Name(_binding_0, ) => {
2875 UseTree::Name (
2876 _visitor.fold_use_name(_binding_0),
2877 )
2878 }
2879 UseTree::Rename(_binding_0, ) => {
2880 UseTree::Rename (
2881 _visitor.fold_use_rename(_binding_0),
2882 )
2883 }
David Tolnay6702ade2017-12-30 23:38:15 -05002884 UseTree::Glob(_binding_0, ) => {
2885 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002886 _visitor.fold_use_glob(_binding_0),
2887 )
2888 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002889 UseTree::Group(_binding_0, ) => {
2890 UseTree::Group (
2891 _visitor.fold_use_group(_binding_0),
David Tolnay5f332a92017-12-26 00:42:45 -05002892 )
2893 }
2894 }
2895}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002896# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002897pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002898 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002899 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtond261d092018-05-18 13:47:35 -07002900 ident: _visitor.fold_ident(_i . ident),
David Tolnaye3d41b72017-12-31 15:24:00 -05002901 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002902 discriminant: (_i . discriminant).map(|it| { (
2903 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2904 _visitor.fold_expr(( it ) . 1),
2905 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002906 }
2907}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002908# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002909pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002910 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002911 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002912 }
2913}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002914# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002915pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002916 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002917 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002918 }
2919}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002920# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002921pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002922 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002923 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002924 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002925 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002926 path: Box::new(_visitor.fold_path(* _i . path)),
2927 }
2928}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002929# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002930pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002931 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002932 Visibility::Public(_binding_0, ) => {
2933 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002934 _visitor.fold_vis_public(_binding_0),
2935 )
2936 }
David Tolnay6702ade2017-12-30 23:38:15 -05002937 Visibility::Crate(_binding_0, ) => {
2938 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002939 _visitor.fold_vis_crate(_binding_0),
2940 )
2941 }
David Tolnay6702ade2017-12-30 23:38:15 -05002942 Visibility::Restricted(_binding_0, ) => {
2943 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002944 _visitor.fold_vis_restricted(_binding_0),
2945 )
2946 }
David Tolnay6702ade2017-12-30 23:38:15 -05002947 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002948 }
2949}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002950# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002951pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002952 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002953 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002954 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2955 }
2956}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002957# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002958pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002959 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002960 WherePredicate::Type(_binding_0, ) => {
2961 WherePredicate::Type (
2962 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002963 )
2964 }
David Tolnayd4add852018-01-01 20:13:24 -08002965 WherePredicate::Lifetime(_binding_0, ) => {
2966 WherePredicate::Lifetime (
2967 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002968 )
2969 }
David Tolnayd4add852018-01-01 20:13:24 -08002970 WherePredicate::Eq(_binding_0, ) => {
2971 WherePredicate::Eq (
2972 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002973 )
2974 }
2975 }
2976}
2977