blob: 1d0b39daced0abfcf1bdda9c3208a7b30c9bc783 [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) }
Nika Layzell27726662017-10-24 23:16:35 -0400195# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400196fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400198fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400199# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800200fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400201# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400202fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400204fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500205# [ cfg ( feature = "full" ) ]
206fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800207# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500208fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
209# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400210fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400212fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400213# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400214fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400216fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400218fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400219# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400220fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400222fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400223# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800224fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400225# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800226fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
227# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400228fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400230fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400232fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400234fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400235# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800236fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400237# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400238fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400240fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500241# [ cfg ( feature = "full" ) ]
242fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800243# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnaybcd498f2017-12-29 12:02:33 -0500244fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800245# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500246fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800247# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400248fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800249# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4ba63a02017-12-28 15:53:05 -0500250fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
David Tolnay360efd22018-01-04 23:35:26 -0800251# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
252fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
253# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
254fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
255# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
256fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
257# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
258fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
259# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
260fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
261# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
262fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
263# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
264fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
265# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
266fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800267# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400268fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800269# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800270fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800271# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayab919512017-12-30 23:31:51 -0500272fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800273# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500274fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800275# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800276fn fold_meta(&mut self, i: Meta) -> Meta { fold_meta(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_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800279# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400280fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400281# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400282fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800283# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnayd60cfec2017-12-29 00:21:38 -0500284fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800285# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -0800286fn fold_nested_meta(&mut self, i: NestedMeta) -> NestedMeta { fold_nested_meta(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800287# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500288fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800289# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400290fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(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_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(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_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(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_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800297# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500298fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800299# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400300fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(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_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(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_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(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_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(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_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(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_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(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_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800313# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500314fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800315# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400316fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800317# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400318fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800319# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzellc08227a2017-12-04 16:30:17 -0500320fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800321# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400322fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800323# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayd4add852018-01-01 20:13:24 -0800324fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(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_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(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_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800329# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400330fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800331# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400332fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800333# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayf93b90d2017-11-11 19:21:26 -0800334fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500335
336fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800337# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400338fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800339# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay40fb8ce2018-01-02 10:53:46 -0800340fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800341# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400342fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400343# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400344fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400345# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400346fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400347# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800348fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400349# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400350fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400351# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400352fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500353# [ cfg ( feature = "full" ) ]
354fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800355# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800356fn fold_type(&mut self, i: Type) -> Type { fold_type(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_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(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_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(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_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(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_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(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_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800367# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500368fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800369# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800370fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(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_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(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_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(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_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(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_path(&mut self, i: TypePath) -> TypePath { fold_type_path(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_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800381# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay0a89b4d2017-11-13 00:55:45 -0800382fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800383# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800384fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(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_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800387# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay05362582017-12-26 01:33:57 -0500388fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800389# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500390fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800391# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400392fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500393# [ cfg ( feature = "full" ) ]
394fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
395# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200396fn fold_use_group(&mut self, i: UseGroup) -> UseGroup { fold_use_group(self, i) }
397# [ cfg ( feature = "full" ) ]
398fn fold_use_name(&mut self, i: UseName) -> UseName { fold_use_name(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500399# [ cfg ( feature = "full" ) ]
400fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
401# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +0200402fn fold_use_rename(&mut self, i: UseRename) -> UseRename { fold_use_rename(self, i) }
403# [ cfg ( feature = "full" ) ]
David Tolnay5f332a92017-12-26 00:42:45 -0500404fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
David Tolnay3cfd1d32018-01-03 00:22:08 -0800405# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400406fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(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_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(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_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(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_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(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_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(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_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(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_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400419
Nika Layzell27726662017-10-24 23:16:35 -0400420}
421
David Tolnay360efd22018-01-04 23:35:26 -0800422macro_rules! fold_span_only {
423 ($f:ident : $t:ident) => {
David Tolnay4b4c4b62018-01-06 13:48:05 -0800424 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
Alex Crichton9a4dca22018-03-28 06:32:19 -0700425 let span = _visitor.fold_span(_i.span());
426 _i.set_span(span);
David Tolnay360efd22018-01-04 23:35:26 -0800427 _i
428 }
429 }
David Tolnayd0adf522017-12-29 01:30:07 -0500430}
431
David Tolnay360efd22018-01-04 23:35:26 -0800432fold_span_only!(fold_ident: Ident);
David Tolnay0a0d78c2018-01-05 15:24:01 -0800433#[cfg(any(feature = "full", feature = "derive"))]
David Tolnay360efd22018-01-04 23:35:26 -0800434fold_span_only!(fold_lifetime: Lifetime);
435#[cfg(any(feature = "full", feature = "derive"))]
436fold_span_only!(fold_lit_byte: LitByte);
437#[cfg(any(feature = "full", feature = "derive"))]
438fold_span_only!(fold_lit_byte_str: LitByteStr);
439#[cfg(any(feature = "full", feature = "derive"))]
440fold_span_only!(fold_lit_char: LitChar);
441#[cfg(any(feature = "full", feature = "derive"))]
442fold_span_only!(fold_lit_float: LitFloat);
443#[cfg(any(feature = "full", feature = "derive"))]
444fold_span_only!(fold_lit_int: LitInt);
445#[cfg(any(feature = "full", feature = "derive"))]
446fold_span_only!(fold_lit_str: LitStr);
David Tolnayd0adf522017-12-29 01:30:07 -0500447
David Tolnay3cfd1d32018-01-03 00:22:08 -0800448# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800449pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400450 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500451 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayc2749802018-01-06 23:40:41 -0800452 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400453 }
454}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800455# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800456pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -0500457 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500458 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500459 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500460 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500461 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400462 }
463}
464# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800465pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400466 ArgCaptured {
467 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800469 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400470 }
471}
472# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800473pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400474 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500475 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500476 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400477 }
478}
479# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800480pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400481 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500482 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500483 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500484 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500485 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400486 }
487}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800488# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800489pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400490 Arm {
491 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay18cc4d42018-03-31 18:47:20 +0200492 leading_vert: (_i . leading_vert).map(|it| { Token ! [ | ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400493 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500494 guard: (_i . guard).map(|it| { (
495 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
496 Box::new(_visitor.fold_expr(* ( it ) . 1)),
497 ) }),
David Tolnaydfb91432018-03-31 19:19:44 +0200498 fat_arrow_token: Token ! [ => ](tokens_helper(_visitor, &(_i . fat_arrow_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400499 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500500 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400501 }
502}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800503# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800504pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400505 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500506 AttrStyle::Outer => { AttrStyle::Outer }
507 AttrStyle::Inner(_binding_0, ) => {
508 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500509 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400510 )
511 }
512 }
513}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800514# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800515pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400516 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500518 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500519 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 path: _visitor.fold_path(_i . path),
521 tts: _i . tts,
522 is_sugared_doc: _i . is_sugared_doc,
523 }
524}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800525# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800526pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400527 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500528 name: (_i . name).map(|it| { (
529 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500530 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500531 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800532 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400533 }
534}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800535# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800536pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400537 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500538 BareFnArgName::Named(_binding_0, ) => {
539 BareFnArgName::Named (
Alex Crichtona74a1c82018-05-16 10:20:44 -0700540 _binding_0,
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
David Tolnay6702ade2017-12-30 23:38:15 -0500543 BareFnArgName::Wild(_binding_0, ) => {
544 BareFnArgName::Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 }
549}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800550# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800551pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400552 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500553 BinOp::Add(_binding_0, ) => {
554 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
David Tolnay6702ade2017-12-30 23:38:15 -0500558 BinOp::Sub(_binding_0, ) => {
559 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
David Tolnay6702ade2017-12-30 23:38:15 -0500563 BinOp::Mul(_binding_0, ) => {
564 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
David Tolnay6702ade2017-12-30 23:38:15 -0500568 BinOp::Div(_binding_0, ) => {
569 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
David Tolnay6702ade2017-12-30 23:38:15 -0500573 BinOp::Rem(_binding_0, ) => {
574 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
David Tolnay6702ade2017-12-30 23:38:15 -0500578 BinOp::And(_binding_0, ) => {
579 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
David Tolnay6702ade2017-12-30 23:38:15 -0500583 BinOp::Or(_binding_0, ) => {
584 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
David Tolnay6702ade2017-12-30 23:38:15 -0500588 BinOp::BitXor(_binding_0, ) => {
589 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
David Tolnay6702ade2017-12-30 23:38:15 -0500593 BinOp::BitAnd(_binding_0, ) => {
594 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
David Tolnay6702ade2017-12-30 23:38:15 -0500598 BinOp::BitOr(_binding_0, ) => {
599 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
David Tolnay6702ade2017-12-30 23:38:15 -0500603 BinOp::Shl(_binding_0, ) => {
604 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
David Tolnay6702ade2017-12-30 23:38:15 -0500608 BinOp::Shr(_binding_0, ) => {
609 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
David Tolnay6702ade2017-12-30 23:38:15 -0500613 BinOp::Eq(_binding_0, ) => {
614 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
David Tolnay6702ade2017-12-30 23:38:15 -0500618 BinOp::Lt(_binding_0, ) => {
619 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
David Tolnay6702ade2017-12-30 23:38:15 -0500623 BinOp::Le(_binding_0, ) => {
624 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
David Tolnay6702ade2017-12-30 23:38:15 -0500628 BinOp::Ne(_binding_0, ) => {
629 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
David Tolnay6702ade2017-12-30 23:38:15 -0500633 BinOp::Ge(_binding_0, ) => {
634 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
David Tolnay6702ade2017-12-30 23:38:15 -0500638 BinOp::Gt(_binding_0, ) => {
639 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
David Tolnay6702ade2017-12-30 23:38:15 -0500643 BinOp::AddEq(_binding_0, ) => {
644 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
David Tolnay6702ade2017-12-30 23:38:15 -0500648 BinOp::SubEq(_binding_0, ) => {
649 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
David Tolnay6702ade2017-12-30 23:38:15 -0500653 BinOp::MulEq(_binding_0, ) => {
654 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
David Tolnay6702ade2017-12-30 23:38:15 -0500658 BinOp::DivEq(_binding_0, ) => {
659 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500660 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400661 )
662 }
David Tolnay6702ade2017-12-30 23:38:15 -0500663 BinOp::RemEq(_binding_0, ) => {
664 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500665 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400666 )
667 }
David Tolnay6702ade2017-12-30 23:38:15 -0500668 BinOp::BitXorEq(_binding_0, ) => {
669 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500670 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400671 )
672 }
David Tolnay6702ade2017-12-30 23:38:15 -0500673 BinOp::BitAndEq(_binding_0, ) => {
674 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500675 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400676 )
677 }
David Tolnay6702ade2017-12-30 23:38:15 -0500678 BinOp::BitOrEq(_binding_0, ) => {
679 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500680 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400681 )
682 }
David Tolnay6702ade2017-12-30 23:38:15 -0500683 BinOp::ShlEq(_binding_0, ) => {
684 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500685 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400686 )
687 }
David Tolnay6702ade2017-12-30 23:38:15 -0500688 BinOp::ShrEq(_binding_0, ) => {
689 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500690 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400691 )
692 }
693 }
694}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800695# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800696pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
David Tolnay506e43a2017-12-29 11:34:36 -0500697 Binding {
Alex Crichtona74a1c82018-05-16 10:20:44 -0700698 ident: _i . ident,
David Tolnay506e43a2017-12-29 11:34:36 -0500699 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
700 ty: _visitor.fold_type(_i . ty),
701 }
702}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800703# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800704pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400705 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500706 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400707 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
708 }
709}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800710# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800711pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400712 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500713 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
714 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400715 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 }
718}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800719# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800720pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721 ConstParam {
722 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -0700724 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500726 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500728 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
729 }
730}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800731# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800732pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
David Tolnaye3d41b72017-12-31 15:24:00 -0500733 match _i {
734 Data::Struct(_binding_0, ) => {
735 Data::Struct (
736 _visitor.fold_data_struct(_binding_0),
737 )
738 }
739 Data::Enum(_binding_0, ) => {
740 Data::Enum (
741 _visitor.fold_data_enum(_binding_0),
742 )
743 }
744 Data::Union(_binding_0, ) => {
745 Data::Union (
746 _visitor.fold_data_union(_binding_0),
747 )
748 }
749 }
750}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800751# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800752pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
David Tolnaye3d41b72017-12-31 15:24:00 -0500753 DataEnum {
754 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
755 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
756 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
757 }
758}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800759# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800760pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
David Tolnaye3d41b72017-12-31 15:24:00 -0500761 DataStruct {
762 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
763 fields: _visitor.fold_fields(_i . fields),
764 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
765 }
766}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800767# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800768pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
David Tolnaye3d41b72017-12-31 15:24:00 -0500769 DataUnion {
770 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
771 fields: _visitor.fold_fields_named(_i . fields),
772 }
773}
David Tolnay0a0d78c2018-01-05 15:24:01 -0800774# [ cfg ( feature = "derive" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800775pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400776 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400777 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500778 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtona74a1c82018-05-16 10:20:44 -0700779 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -0400780 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -0500781 data: _visitor.fold_data(_i . data),
Nika Layzell27726662017-10-24 23:16:35 -0400782 }
783}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800784# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800785pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400786 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500787 Expr::Box(_binding_0, ) => {
788 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400789 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400790 )
791 }
David Tolnay6702ade2017-12-30 23:38:15 -0500792 Expr::InPlace(_binding_0, ) => {
793 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400794 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400795 )
796 }
David Tolnay6702ade2017-12-30 23:38:15 -0500797 Expr::Array(_binding_0, ) => {
798 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400799 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
David Tolnay6702ade2017-12-30 23:38:15 -0500802 Expr::Call(_binding_0, ) => {
803 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400804 _visitor.fold_expr_call(_binding_0),
805 )
806 }
David Tolnay6702ade2017-12-30 23:38:15 -0500807 Expr::MethodCall(_binding_0, ) => {
808 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
David Tolnay6702ade2017-12-30 23:38:15 -0500812 Expr::Tuple(_binding_0, ) => {
813 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500814 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
David Tolnay6702ade2017-12-30 23:38:15 -0500817 Expr::Binary(_binding_0, ) => {
818 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400819 _visitor.fold_expr_binary(_binding_0),
820 )
821 }
David Tolnay6702ade2017-12-30 23:38:15 -0500822 Expr::Unary(_binding_0, ) => {
823 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400824 _visitor.fold_expr_unary(_binding_0),
825 )
826 }
David Tolnay6702ade2017-12-30 23:38:15 -0500827 Expr::Lit(_binding_0, ) => {
828 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500829 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
David Tolnay6702ade2017-12-30 23:38:15 -0500832 Expr::Cast(_binding_0, ) => {
833 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400834 _visitor.fold_expr_cast(_binding_0),
835 )
836 }
David Tolnay6702ade2017-12-30 23:38:15 -0500837 Expr::Type(_binding_0, ) => {
838 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500839 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
David Tolnay6702ade2017-12-30 23:38:15 -0500842 Expr::If(_binding_0, ) => {
843 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
David Tolnay6702ade2017-12-30 23:38:15 -0500847 Expr::IfLet(_binding_0, ) => {
848 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
David Tolnay6702ade2017-12-30 23:38:15 -0500852 Expr::While(_binding_0, ) => {
853 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400854 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
David Tolnay6702ade2017-12-30 23:38:15 -0500857 Expr::WhileLet(_binding_0, ) => {
858 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
David Tolnay6702ade2017-12-30 23:38:15 -0500862 Expr::ForLoop(_binding_0, ) => {
863 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
David Tolnay6702ade2017-12-30 23:38:15 -0500867 Expr::Loop(_binding_0, ) => {
868 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
David Tolnay6702ade2017-12-30 23:38:15 -0500872 Expr::Match(_binding_0, ) => {
873 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
David Tolnay6702ade2017-12-30 23:38:15 -0500877 Expr::Closure(_binding_0, ) => {
878 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
David Tolnay6702ade2017-12-30 23:38:15 -0500882 Expr::Unsafe(_binding_0, ) => {
883 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500884 full!(_visitor.fold_expr_unsafe(_binding_0)),
885 )
886 }
David Tolnay6702ade2017-12-30 23:38:15 -0500887 Expr::Block(_binding_0, ) => {
888 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
David Tolnay6702ade2017-12-30 23:38:15 -0500892 Expr::Assign(_binding_0, ) => {
893 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
David Tolnay6702ade2017-12-30 23:38:15 -0500897 Expr::AssignOp(_binding_0, ) => {
898 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400899 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
David Tolnay6702ade2017-12-30 23:38:15 -0500902 Expr::Field(_binding_0, ) => {
903 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
David Tolnay6702ade2017-12-30 23:38:15 -0500907 Expr::Index(_binding_0, ) => {
908 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400909 _visitor.fold_expr_index(_binding_0),
910 )
911 }
David Tolnay6702ade2017-12-30 23:38:15 -0500912 Expr::Range(_binding_0, ) => {
913 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
David Tolnay6702ade2017-12-30 23:38:15 -0500917 Expr::Path(_binding_0, ) => {
918 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400919 _visitor.fold_expr_path(_binding_0),
920 )
921 }
David Tolnay00674ba2018-03-31 18:14:11 +0200922 Expr::Reference(_binding_0, ) => {
923 Expr::Reference (
924 full!(_visitor.fold_expr_reference(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
David Tolnay6702ade2017-12-30 23:38:15 -0500927 Expr::Break(_binding_0, ) => {
928 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
David Tolnay6702ade2017-12-30 23:38:15 -0500932 Expr::Continue(_binding_0, ) => {
933 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400934 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
David Tolnay6702ade2017-12-30 23:38:15 -0500937 Expr::Return(_binding_0, ) => {
938 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500939 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
David Tolnay6702ade2017-12-30 23:38:15 -0500942 Expr::Macro(_binding_0, ) => {
943 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500944 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400945 )
946 }
David Tolnay6702ade2017-12-30 23:38:15 -0500947 Expr::Struct(_binding_0, ) => {
948 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400949 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
David Tolnay6702ade2017-12-30 23:38:15 -0500952 Expr::Repeat(_binding_0, ) => {
953 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400954 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400955 )
956 }
David Tolnay6702ade2017-12-30 23:38:15 -0500957 Expr::Paren(_binding_0, ) => {
958 Expr::Paren (
David Tolnay81ab4f62018-01-27 19:02:51 -0800959 _visitor.fold_expr_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400960 )
961 }
David Tolnay6702ade2017-12-30 23:38:15 -0500962 Expr::Group(_binding_0, ) => {
963 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500964 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400965 )
966 }
David Tolnay6702ade2017-12-30 23:38:15 -0500967 Expr::Try(_binding_0, ) => {
968 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400969 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
David Tolnay6702ade2017-12-30 23:38:15 -0500972 Expr::Catch(_binding_0, ) => {
973 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400974 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400975 )
976 }
David Tolnay6702ade2017-12-30 23:38:15 -0500977 Expr::Yield(_binding_0, ) => {
978 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400979 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400980 )
981 }
David Tolnay6702ade2017-12-30 23:38:15 -0500982 Expr::Verbatim(_binding_0, ) => {
983 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500984 _visitor.fold_expr_verbatim(_binding_0),
985 )
986 }
Nika Layzell27726662017-10-24 23:16:35 -0400987 }
988}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800989# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800990pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
David Tolnay8c91b882017-12-28 23:04:32 -0500991 ExprArray {
992 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
993 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500994 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500995 }
996}
David Tolnay3cfd1d32018-01-03 00:22:08 -0800997# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -0800998pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
David Tolnay8c91b882017-12-28 23:04:32 -0500999 ExprAssign {
1000 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1001 left: Box::new(_visitor.fold_expr(* _i . left)),
1002 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1003 right: Box::new(_visitor.fold_expr(* _i . right)),
1004 }
1005}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001006# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001007pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
David Tolnay8c91b882017-12-28 23:04:32 -05001008 ExprAssignOp {
1009 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1010 left: Box::new(_visitor.fold_expr(* _i . left)),
1011 op: _visitor.fold_bin_op(_i . op),
1012 right: Box::new(_visitor.fold_expr(* _i . right)),
1013 }
1014}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001015# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001016pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
David Tolnay8c91b882017-12-28 23:04:32 -05001017 ExprBinary {
1018 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1019 left: Box::new(_visitor.fold_expr(* _i . left)),
1020 op: _visitor.fold_bin_op(_i . op),
1021 right: Box::new(_visitor.fold_expr(* _i . right)),
1022 }
1023}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001024# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001025pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
David Tolnay8c91b882017-12-28 23:04:32 -05001026 ExprBlock {
1027 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1028 block: _visitor.fold_block(_i . block),
1029 }
1030}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001031# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001032pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
David Tolnay8c91b882017-12-28 23:04:32 -05001033 ExprBox {
1034 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1035 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1036 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1037 }
1038}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001039# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001040pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
David Tolnay8c91b882017-12-28 23:04:32 -05001041 ExprBreak {
1042 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1043 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1044 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1045 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1046 }
1047}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001048# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001049pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001050 ExprCall {
1051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1052 func: Box::new(_visitor.fold_expr(* _i . func)),
1053 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1054 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1055 }
1056}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001057# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001058pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
David Tolnay8c91b882017-12-28 23:04:32 -05001059 ExprCast {
1060 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1061 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1062 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1063 ty: Box::new(_visitor.fold_type(* _i . ty)),
1064 }
1065}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001066# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001067pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001068 ExprCatch {
1069 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1070 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1071 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1072 block: _visitor.fold_block(_i . block),
1073 }
1074}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001075# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001076pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
David Tolnay8c91b882017-12-28 23:04:32 -05001077 ExprClosure {
1078 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay13d4c0e2018-03-31 20:53:59 +02001079 movability: (_i . movability).map(|it| { Token ! [ static ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001080 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001081 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1082 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1083 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1084 output: _visitor.fold_return_type(_i . output),
1085 body: Box::new(_visitor.fold_expr(* _i . body)),
1086 }
1087}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001088# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001089pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
David Tolnay8c91b882017-12-28 23:04:32 -05001090 ExprContinue {
1091 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1092 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1093 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1094 }
1095}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001096# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001097pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
David Tolnay8c91b882017-12-28 23:04:32 -05001098 ExprField {
1099 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1100 base: Box::new(_visitor.fold_expr(* _i . base)),
1101 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1102 member: _visitor.fold_member(_i . member),
1103 }
1104}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001105# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001106pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001107 ExprForLoop {
1108 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001109 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001110 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1111 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1112 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1113 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1114 body: _visitor.fold_block(_i . body),
1115 }
1116}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001117# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001118pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
David Tolnay8c91b882017-12-28 23:04:32 -05001119 ExprGroup {
1120 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1121 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1122 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1123 }
1124}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001125# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001126pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
David Tolnay8c91b882017-12-28 23:04:32 -05001127 ExprIf {
1128 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1129 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1130 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001131 then_branch: _visitor.fold_block(_i . then_branch),
1132 else_branch: (_i . else_branch).map(|it| { (
1133 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1134 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1135 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001136 }
1137}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001138# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001139pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001140 ExprIfLet {
1141 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1142 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1143 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001144 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001145 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1146 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001147 then_branch: _visitor.fold_block(_i . then_branch),
1148 else_branch: (_i . else_branch).map(|it| { (
1149 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1150 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1151 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001152 }
1153}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001154# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001155pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
David Tolnay8c91b882017-12-28 23:04:32 -05001156 ExprInPlace {
1157 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1158 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001159 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001160 value: Box::new(_visitor.fold_expr(* _i . value)),
1161 }
1162}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001163# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001164pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
David Tolnay8c91b882017-12-28 23:04:32 -05001165 ExprIndex {
1166 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1167 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1168 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1169 index: Box::new(_visitor.fold_expr(* _i . index)),
1170 }
1171}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001172# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001173pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
David Tolnay8c91b882017-12-28 23:04:32 -05001174 ExprLit {
1175 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1176 lit: _visitor.fold_lit(_i . lit),
1177 }
1178}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001179# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001180pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001181 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001182 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001183 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001184 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1185 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
1187}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001188# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001189pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
David Tolnay8c91b882017-12-28 23:04:32 -05001190 ExprMacro {
1191 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1192 mac: _visitor.fold_macro(_i . mac),
1193 }
1194}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001195# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001196pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001197 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001198 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001199 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001200 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001201 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001202 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1203 }
1204}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001205# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001206pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001207 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001208 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001209 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001210 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001211 method: _i . method,
David Tolnayd60cfec2017-12-29 00:21:38 -05001212 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001213 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1214 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
1216}
David Tolnay81ab4f62018-01-27 19:02:51 -08001217# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001218pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001219 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001220 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001221 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001222 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
1224}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001225# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001226pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001229 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 path: _visitor.fold_path(_i . path),
1231 }
1232}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001233# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001234pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001236 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001237 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001239 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001242# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay00674ba2018-03-31 18:14:11 +02001243pub fn fold_expr_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReference) -> ExprReference {
1244 ExprReference {
1245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1246 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1247 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1248 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1249 }
1250}
1251# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001252pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001253 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001254 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001255 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001256 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001257 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay84d80442018-01-07 01:03:20 -08001258 len: Box::new(_visitor.fold_expr(* _i . len)),
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
1260}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001261# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001262pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
David Tolnayc246cd32017-12-28 23:14:32 -05001263 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001264 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001265 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001266 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001267 }
1268}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001269# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001270pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001271 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001273 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001274 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001275 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1276 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1277 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001278 }
1279}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001280# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001281pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001282 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001283 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001284 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001285 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001286 }
1287}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001288# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001289pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
David Tolnay05362582017-12-26 01:33:57 -05001290 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001291 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001292 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001293 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001294 }
1295}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001296# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001297pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001298 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001299 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001300 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001301 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001302 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001303 }
1304}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001305# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001306pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001307 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001308 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001309 op: _visitor.fold_un_op(_i . op),
1310 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1311 }
1312}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001313# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001314pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
Nika Layzell640832a2017-12-04 13:37:09 -05001315 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001316 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001317 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001318 block: _visitor.fold_block(_i . block),
1319 }
1320}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001321# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001322pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001323 ExprVerbatim {
1324 tts: _i . tts,
1325 }
1326}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001327# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001328pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001329 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001330 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001331 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001332 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001333 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1334 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001335 }
1336}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001337# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001338pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001339 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001340 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001341 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001342 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1343 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02001344 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001345 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001346 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1347 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001348 }
1349}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001350# [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001351pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001352 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001353 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001354 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001355 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001356 }
1357}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001358# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001359pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001360 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001361 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001362 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001363 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001364 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001365 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001366 }
1367}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001368# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001369pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001370 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001371 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001372 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001373 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001374 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001375 }
1376}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001377# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001378pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001379 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001380 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1381 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001382 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001383 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001384 }
1385}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001386# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001387pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
David Tolnaye3d41b72017-12-31 15:24:00 -05001388 match _i {
1389 Fields::Named(_binding_0, ) => {
1390 Fields::Named (
1391 _visitor.fold_fields_named(_binding_0),
1392 )
1393 }
1394 Fields::Unnamed(_binding_0, ) => {
1395 Fields::Unnamed (
1396 _visitor.fold_fields_unnamed(_binding_0),
1397 )
1398 }
1399 Fields::Unit => { Fields::Unit }
1400 }
1401}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001402# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001403pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001404 FieldsNamed {
1405 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001406 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001407 }
1408}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001409# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001410pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
David Tolnaye3d41b72017-12-31 15:24:00 -05001411 FieldsUnnamed {
1412 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaybdafb102018-01-01 19:39:10 -08001413 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
David Tolnaye3d41b72017-12-31 15:24:00 -05001414 }
1415}
Nika Layzell27726662017-10-24 23:16:35 -04001416# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001417pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001418 File {
1419 shebang: _i . shebang,
1420 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1421 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1422 }
1423}
1424# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001425pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001426 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001427 FnArg::SelfRef(_binding_0, ) => {
1428 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001429 _visitor.fold_arg_self_ref(_binding_0),
1430 )
1431 }
David Tolnay6702ade2017-12-30 23:38:15 -05001432 FnArg::SelfValue(_binding_0, ) => {
1433 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001434 _visitor.fold_arg_self(_binding_0),
1435 )
1436 }
David Tolnay6702ade2017-12-30 23:38:15 -05001437 FnArg::Captured(_binding_0, ) => {
1438 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001439 _visitor.fold_arg_captured(_binding_0),
1440 )
1441 }
David Tolnay6702ade2017-12-30 23:38:15 -05001442 FnArg::Inferred(_binding_0, ) => {
1443 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001444 _visitor.fold_pat(_binding_0),
1445 )
1446 }
David Tolnay6702ade2017-12-30 23:38:15 -05001447 FnArg::Ignored(_binding_0, ) => {
1448 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001449 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001450 )
1451 }
1452 }
1453}
1454# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001455pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001456 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001457 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001458 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001459 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001460 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001461 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001462 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001463 }
1464}
1465# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001466pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001467 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001468 ForeignItem::Fn(_binding_0, ) => {
1469 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001470 _visitor.fold_foreign_item_fn(_binding_0),
1471 )
1472 }
David Tolnay6702ade2017-12-30 23:38:15 -05001473 ForeignItem::Static(_binding_0, ) => {
1474 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001475 _visitor.fold_foreign_item_static(_binding_0),
1476 )
1477 }
David Tolnay6702ade2017-12-30 23:38:15 -05001478 ForeignItem::Type(_binding_0, ) => {
1479 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001480 _visitor.fold_foreign_item_type(_binding_0),
1481 )
1482 }
David Tolnay6702ade2017-12-30 23:38:15 -05001483 ForeignItem::Verbatim(_binding_0, ) => {
1484 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001485 _visitor.fold_foreign_item_verbatim(_binding_0),
1486 )
1487 }
Nika Layzell27726662017-10-24 23:16:35 -04001488 }
1489}
1490# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001491pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
David Tolnay8894f602017-11-11 12:11:04 -08001492 ForeignItemFn {
1493 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1494 vis: _visitor.fold_visibility(_i . vis),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001495 ident: _i . ident,
David Tolnay8894f602017-11-11 12:11:04 -08001496 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001497 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001498 }
1499}
1500# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001501pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001502 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001503 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1504 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001505 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001506 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001507 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001508 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001509 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001510 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001511 }
1512}
David Tolnay199bcbb2017-11-12 10:33:52 -08001513# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001514pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
David Tolnay199bcbb2017-11-12 10:33:52 -08001515 ForeignItemType {
1516 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1517 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001518 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001519 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001520 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001521 }
1522}
David Tolnay2ae520a2017-12-29 11:19:50 -05001523# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001524pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001525 ForeignItemVerbatim {
1526 tts: _i . tts,
1527 }
1528}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001529# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001530pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001531 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001532 GenericArgument::Lifetime(_binding_0, ) => {
1533 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001534 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001535 )
1536 }
David Tolnay6702ade2017-12-30 23:38:15 -05001537 GenericArgument::Type(_binding_0, ) => {
1538 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001539 _visitor.fold_type(_binding_0),
1540 )
1541 }
David Tolnay6702ade2017-12-30 23:38:15 -05001542 GenericArgument::Binding(_binding_0, ) => {
1543 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001544 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001545 )
1546 }
David Tolnay6702ade2017-12-30 23:38:15 -05001547 GenericArgument::Const(_binding_0, ) => {
1548 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001549 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001550 )
1551 }
Nika Layzell357885a2017-12-04 15:47:07 -05001552 }
1553}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001554# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001555pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001556 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001557 GenericMethodArgument::Type(_binding_0, ) => {
1558 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001559 _visitor.fold_type(_binding_0),
1560 )
1561 }
David Tolnay6702ade2017-12-30 23:38:15 -05001562 GenericMethodArgument::Const(_binding_0, ) => {
1563 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001564 _visitor.fold_expr(_binding_0),
1565 )
1566 }
1567 }
1568}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001569# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001570pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001571 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001572 GenericParam::Type(_binding_0, ) => {
1573 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001574 _visitor.fold_type_param(_binding_0),
1575 )
1576 }
David Tolnay517f3692018-01-01 20:17:23 -08001577 GenericParam::Lifetime(_binding_0, ) => {
1578 GenericParam::Lifetime (
1579 _visitor.fold_lifetime_def(_binding_0),
1580 )
1581 }
David Tolnay6702ade2017-12-30 23:38:15 -05001582 GenericParam::Const(_binding_0, ) => {
1583 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001584 _visitor.fold_const_param(_binding_0),
1585 )
1586 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001587 }
1588}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001589# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001590pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001591 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001592 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001593 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001594 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001595 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001596 }
1597}
1598# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001599pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001600 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001601 ImplItem::Const(_binding_0, ) => {
1602 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001603 _visitor.fold_impl_item_const(_binding_0),
1604 )
1605 }
David Tolnay6702ade2017-12-30 23:38:15 -05001606 ImplItem::Method(_binding_0, ) => {
1607 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001608 _visitor.fold_impl_item_method(_binding_0),
1609 )
1610 }
David Tolnay6702ade2017-12-30 23:38:15 -05001611 ImplItem::Type(_binding_0, ) => {
1612 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001613 _visitor.fold_impl_item_type(_binding_0),
1614 )
1615 }
David Tolnay6702ade2017-12-30 23:38:15 -05001616 ImplItem::Macro(_binding_0, ) => {
1617 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001618 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001619 )
1620 }
David Tolnay6702ade2017-12-30 23:38:15 -05001621 ImplItem::Verbatim(_binding_0, ) => {
1622 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001623 _visitor.fold_impl_item_verbatim(_binding_0),
1624 )
1625 }
Nika Layzell27726662017-10-24 23:16:35 -04001626 }
1627}
1628# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001629pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
David Tolnay857628c2017-11-11 12:25:31 -08001630 ImplItemConst {
1631 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1632 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001633 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001634 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001635 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001636 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001637 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001638 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001639 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001640 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001641 }
1642}
1643# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001644pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
David Tolnay857628c2017-11-11 12:25:31 -08001645 ImplItemMacro {
1646 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1647 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001648 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001649 }
1650}
1651# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001652pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001653 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001654 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001655 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001656 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001657 sig: _visitor.fold_method_sig(_i . sig),
1658 block: _visitor.fold_block(_i . block),
1659 }
1660}
1661# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001662pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001663 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001664 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001665 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001666 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001667 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001668 ident: _i . ident,
Nika Layzell591528a2017-12-05 12:47:37 -05001669 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001670 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001671 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001672 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001673 }
1674}
David Tolnay2ae520a2017-12-29 11:19:50 -05001675# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001676pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001677 ImplItemVerbatim {
1678 tts: _i . tts,
1679 }
1680}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001681# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001682pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
David Tolnay85b69a42017-12-27 20:43:10 -05001683 Index {
1684 index: _i . index,
1685 span: _visitor.fold_span(_i . span),
1686 }
1687}
1688# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001689pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001690 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001691 Item::ExternCrate(_binding_0, ) => {
1692 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001693 _visitor.fold_item_extern_crate(_binding_0),
1694 )
1695 }
David Tolnay6702ade2017-12-30 23:38:15 -05001696 Item::Use(_binding_0, ) => {
1697 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001698 _visitor.fold_item_use(_binding_0),
1699 )
1700 }
David Tolnay6702ade2017-12-30 23:38:15 -05001701 Item::Static(_binding_0, ) => {
1702 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001703 _visitor.fold_item_static(_binding_0),
1704 )
1705 }
David Tolnay6702ade2017-12-30 23:38:15 -05001706 Item::Const(_binding_0, ) => {
1707 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001708 _visitor.fold_item_const(_binding_0),
1709 )
1710 }
David Tolnay6702ade2017-12-30 23:38:15 -05001711 Item::Fn(_binding_0, ) => {
1712 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001713 _visitor.fold_item_fn(_binding_0),
1714 )
1715 }
David Tolnay6702ade2017-12-30 23:38:15 -05001716 Item::Mod(_binding_0, ) => {
1717 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001718 _visitor.fold_item_mod(_binding_0),
1719 )
1720 }
David Tolnay6702ade2017-12-30 23:38:15 -05001721 Item::ForeignMod(_binding_0, ) => {
1722 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001723 _visitor.fold_item_foreign_mod(_binding_0),
1724 )
1725 }
David Tolnay6702ade2017-12-30 23:38:15 -05001726 Item::Type(_binding_0, ) => {
1727 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001728 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001729 )
1730 }
David Tolnay6702ade2017-12-30 23:38:15 -05001731 Item::Struct(_binding_0, ) => {
1732 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001733 _visitor.fold_item_struct(_binding_0),
1734 )
1735 }
David Tolnaye3d41b72017-12-31 15:24:00 -05001736 Item::Enum(_binding_0, ) => {
1737 Item::Enum (
1738 _visitor.fold_item_enum(_binding_0),
1739 )
1740 }
David Tolnay6702ade2017-12-30 23:38:15 -05001741 Item::Union(_binding_0, ) => {
1742 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001743 _visitor.fold_item_union(_binding_0),
1744 )
1745 }
David Tolnay6702ade2017-12-30 23:38:15 -05001746 Item::Trait(_binding_0, ) => {
1747 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001748 _visitor.fold_item_trait(_binding_0),
1749 )
1750 }
David Tolnay6702ade2017-12-30 23:38:15 -05001751 Item::Impl(_binding_0, ) => {
1752 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001753 _visitor.fold_item_impl(_binding_0),
1754 )
1755 }
David Tolnay6702ade2017-12-30 23:38:15 -05001756 Item::Macro(_binding_0, ) => {
1757 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001758 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001759 )
1760 }
David Tolnay6702ade2017-12-30 23:38:15 -05001761 Item::Macro2(_binding_0, ) => {
1762 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001763 _visitor.fold_item_macro2(_binding_0),
1764 )
1765 }
David Tolnay6702ade2017-12-30 23:38:15 -05001766 Item::Verbatim(_binding_0, ) => {
1767 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001768 _visitor.fold_item_verbatim(_binding_0),
1769 )
1770 }
Nika Layzell27726662017-10-24 23:16:35 -04001771 }
1772}
1773# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001774pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001775 ItemConst {
1776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1777 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001779 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001781 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001782 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001783 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 }
1786}
1787# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001788pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 ItemEnum {
1790 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1791 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001792 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001793 ident: _i . ident,
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001795 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1797 }
1798}
1799# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001800pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001801 ItemExternCrate {
1802 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1803 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001804 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1805 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001806 ident: _i . ident,
David Tolnay5c4c0b52017-12-28 17:58:54 -05001807 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001809 ( it ) . 1,
David Tolnay5c4c0b52017-12-28 17:58:54 -05001810 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001811 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 }
1813}
1814# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001815pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001816 ItemFn {
1817 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1818 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001819 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001820 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001821 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001822 ident: _i . ident,
David Tolnay4a3f59a2017-12-28 21:21:12 -05001823 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001824 block: Box::new(_visitor.fold_block(* _i . block)),
1825 }
1826}
1827# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001828pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001829 ItemForeignMod {
1830 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1831 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001832 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001833 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1834 }
1835}
1836# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001837pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001838 ItemImpl {
1839 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001840 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001841 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001843 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001844 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001845 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001846 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001847 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001848 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001849 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001850 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001851 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1852 }
1853}
1854# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001855pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08001856 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001857 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001858 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001859 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001861 }
1862}
1863# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001864pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
David Tolnay500d8322017-12-18 00:32:51 -08001865 ItemMacro2 {
1866 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1867 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001868 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001869 ident: _i . ident,
David Tolnayab919512017-12-30 23:31:51 -05001870 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001871 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001872 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001873 body: _i . body,
1874 }
1875}
1876# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001877pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001878 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001879 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001880 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001881 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001882 ident: _i . ident,
David Tolnay5c4c0b52017-12-28 17:58:54 -05001883 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001884 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001885 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1886 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001888 }
1889}
1890# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001891pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001892 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001893 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001894 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001896 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001897 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05001898 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001899 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001900 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001901 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001903 }
1904}
1905# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001906pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001907 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001908 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001909 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001911 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -04001912 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001913 fields: _visitor.fold_fields(_i . fields),
David Tolnaycc0f0372017-12-28 19:11:04 -05001914 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001915 }
1916}
1917# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001918pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001919 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001920 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001921 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001922 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001923 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1924 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001925 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -04001926 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001927 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001928 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001929 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001930 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1931 }
1932}
1933# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001934pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001935 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001936 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001937 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001938 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001939 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -04001940 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001941 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001942 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001943 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001944 }
1945}
1946# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001947pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001948 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001949 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001950 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001951 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07001952 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -04001953 generics: _visitor.fold_generics(_i . generics),
David Tolnaye3d41b72017-12-31 15:24:00 -05001954 fields: _visitor.fold_fields_named(_i . fields),
Nika Layzell27726662017-10-24 23:16:35 -04001955 }
1956}
1957# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001958pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001959 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001960 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001961 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001962 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1963 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001964 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001965 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001966 }
1967}
David Tolnay2ae520a2017-12-29 11:19:50 -05001968# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001969pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05001970 ItemVerbatim {
1971 tts: _i . tts,
1972 }
1973}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001974# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001975pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
David Tolnaybcd498f2017-12-29 12:02:33 -05001976 Label {
1977 name: _visitor.fold_lifetime(_i . name),
1978 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1979 }
1980}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001981# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001982pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001983 LifetimeDef {
1984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001985 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001986 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001987 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1988 }
1989}
David Tolnay3cfd1d32018-01-03 00:22:08 -08001990# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08001991pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
David Tolnay360efd22018-01-04 23:35:26 -08001992 match _i {
1993 Lit::Str(_binding_0, ) => {
1994 Lit::Str (
1995 _visitor.fold_lit_str(_binding_0),
1996 )
1997 }
1998 Lit::ByteStr(_binding_0, ) => {
1999 Lit::ByteStr (
2000 _visitor.fold_lit_byte_str(_binding_0),
2001 )
2002 }
2003 Lit::Byte(_binding_0, ) => {
2004 Lit::Byte (
2005 _visitor.fold_lit_byte(_binding_0),
2006 )
2007 }
2008 Lit::Char(_binding_0, ) => {
2009 Lit::Char (
2010 _visitor.fold_lit_char(_binding_0),
2011 )
2012 }
2013 Lit::Int(_binding_0, ) => {
2014 Lit::Int (
2015 _visitor.fold_lit_int(_binding_0),
2016 )
2017 }
2018 Lit::Float(_binding_0, ) => {
2019 Lit::Float (
2020 _visitor.fold_lit_float(_binding_0),
2021 )
2022 }
2023 Lit::Bool(_binding_0, ) => {
2024 Lit::Bool (
2025 _visitor.fold_lit_bool(_binding_0),
2026 )
2027 }
2028 Lit::Verbatim(_binding_0, ) => {
2029 Lit::Verbatim (
2030 _visitor.fold_lit_verbatim(_binding_0),
2031 )
2032 }
2033 }
2034}
2035# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002036pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
David Tolnay360efd22018-01-04 23:35:26 -08002037 LitBool {
David Tolnay4ba63a02017-12-28 15:53:05 -05002038 value: _i . value,
2039 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04002040 }
2041}
David Tolnay360efd22018-01-04 23:35:26 -08002042# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002043pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
David Tolnay360efd22018-01-04 23:35:26 -08002044 LitVerbatim {
2045 token: _i . token,
David Tolnay360efd22018-01-04 23:35:26 -08002046 }
2047}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002048# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002049pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04002050 Local {
Nika Layzell27726662017-10-24 23:16:35 -04002051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002052 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay5b5b7d22018-03-31 21:05:00 +02002053 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -05002054 ty: (_i . ty).map(|it| { (
2055 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2056 Box::new(_visitor.fold_type(* ( it ) . 1)),
2057 ) }),
2058 init: (_i . init).map(|it| { (
2059 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2060 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2061 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002062 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002063 }
2064}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002065# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002066pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002067 Macro {
2068 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002069 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05002070 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2071 tts: _i . tts,
2072 }
2073}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002074# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002075pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05002076 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002077 MacroDelimiter::Paren(_binding_0, ) => {
2078 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05002079 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2080 )
2081 }
David Tolnay6702ade2017-12-30 23:38:15 -05002082 MacroDelimiter::Brace(_binding_0, ) => {
2083 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05002084 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2085 )
2086 }
David Tolnay6702ade2017-12-30 23:38:15 -05002087 MacroDelimiter::Bracket(_binding_0, ) => {
2088 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05002089 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2090 )
2091 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002092 }
2093}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002094# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002095pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05002096 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002097 Member::Named(_binding_0, ) => {
2098 Member::Named (
Alex Crichtona74a1c82018-05-16 10:20:44 -07002099 _binding_0,
David Tolnay85b69a42017-12-27 20:43:10 -05002100 )
2101 }
David Tolnay6702ade2017-12-30 23:38:15 -05002102 Member::Unnamed(_binding_0, ) => {
2103 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05002104 _visitor.fold_index(_binding_0),
2105 )
2106 }
2107 }
2108}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002109# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002110pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
Nika Layzell27726662017-10-24 23:16:35 -04002111 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002112 Meta::Word(_binding_0, ) => {
2113 Meta::Word (
Alex Crichtona74a1c82018-05-16 10:20:44 -07002114 _binding_0,
Nika Layzell27726662017-10-24 23:16:35 -04002115 )
2116 }
David Tolnayaaadd782018-01-06 22:58:13 -08002117 Meta::List(_binding_0, ) => {
2118 Meta::List (
2119 _visitor.fold_meta_list(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002120 )
2121 }
David Tolnayaaadd782018-01-06 22:58:13 -08002122 Meta::NameValue(_binding_0, ) => {
2123 Meta::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04002124 _visitor.fold_meta_name_value(_binding_0),
2125 )
2126 }
2127 }
2128}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002129# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002130pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2131 MetaList {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002132 ident: _i . ident,
David Tolnay1e01f9c2017-12-28 20:16:19 -05002133 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayaaadd782018-01-06 22:58:13 -08002134 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002135 }
2136}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002137# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002138pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002139 MetaNameValue {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002140 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05002141 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002142 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002143 }
2144}
2145# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002146pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002147 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002148 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002149 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002150 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002151 ident: _i . ident,
Nika Layzell27726662017-10-24 23:16:35 -04002152 decl: _visitor.fold_fn_decl(_i . decl),
2153 }
2154}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002155# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002156pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
David Tolnayd60cfec2017-12-29 00:21:38 -05002157 MethodTurbofish {
2158 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2159 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2160 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2161 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2162 }
2163}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002164# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnayaaadd782018-01-06 22:58:13 -08002165pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
Nika Layzell27726662017-10-24 23:16:35 -04002166 match _i {
David Tolnayaaadd782018-01-06 22:58:13 -08002167 NestedMeta::Meta(_binding_0, ) => {
2168 NestedMeta::Meta (
2169 _visitor.fold_meta(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002170 )
2171 }
David Tolnayaaadd782018-01-06 22:58:13 -08002172 NestedMeta::Literal(_binding_0, ) => {
2173 NestedMeta::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002174 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002175 )
2176 }
2177 }
2178}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002179# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002180pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002181 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002182 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002183 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002184 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002185 }
2186}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002187# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002188pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002189 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002190 Pat::Wild(_binding_0, ) => {
2191 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002192 _visitor.fold_pat_wild(_binding_0),
2193 )
2194 }
David Tolnay6702ade2017-12-30 23:38:15 -05002195 Pat::Ident(_binding_0, ) => {
2196 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002197 _visitor.fold_pat_ident(_binding_0),
2198 )
2199 }
David Tolnay6702ade2017-12-30 23:38:15 -05002200 Pat::Struct(_binding_0, ) => {
2201 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002202 _visitor.fold_pat_struct(_binding_0),
2203 )
2204 }
David Tolnay6702ade2017-12-30 23:38:15 -05002205 Pat::TupleStruct(_binding_0, ) => {
2206 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002207 _visitor.fold_pat_tuple_struct(_binding_0),
2208 )
2209 }
David Tolnay6702ade2017-12-30 23:38:15 -05002210 Pat::Path(_binding_0, ) => {
2211 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002212 _visitor.fold_pat_path(_binding_0),
2213 )
2214 }
David Tolnay6702ade2017-12-30 23:38:15 -05002215 Pat::Tuple(_binding_0, ) => {
2216 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002217 _visitor.fold_pat_tuple(_binding_0),
2218 )
2219 }
David Tolnay6702ade2017-12-30 23:38:15 -05002220 Pat::Box(_binding_0, ) => {
2221 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002222 _visitor.fold_pat_box(_binding_0),
2223 )
2224 }
David Tolnay6702ade2017-12-30 23:38:15 -05002225 Pat::Ref(_binding_0, ) => {
2226 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002227 _visitor.fold_pat_ref(_binding_0),
2228 )
2229 }
David Tolnay6702ade2017-12-30 23:38:15 -05002230 Pat::Lit(_binding_0, ) => {
2231 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002232 _visitor.fold_pat_lit(_binding_0),
2233 )
2234 }
David Tolnay6702ade2017-12-30 23:38:15 -05002235 Pat::Range(_binding_0, ) => {
2236 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002237 _visitor.fold_pat_range(_binding_0),
2238 )
2239 }
David Tolnay6702ade2017-12-30 23:38:15 -05002240 Pat::Slice(_binding_0, ) => {
2241 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002242 _visitor.fold_pat_slice(_binding_0),
2243 )
2244 }
David Tolnay6702ade2017-12-30 23:38:15 -05002245 Pat::Macro(_binding_0, ) => {
2246 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002247 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002248 )
2249 }
David Tolnay6702ade2017-12-30 23:38:15 -05002250 Pat::Verbatim(_binding_0, ) => {
2251 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002252 _visitor.fold_pat_verbatim(_binding_0),
2253 )
2254 }
Nika Layzell27726662017-10-24 23:16:35 -04002255 }
2256}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002257# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002258pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002259 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002260 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002261 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002262 }
2263}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002264# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002265pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002266 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002267 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2268 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002269 ident: _i . ident,
David Tolnay8b4d3022017-12-29 12:11:10 -05002270 subpat: (_i . subpat).map(|it| { (
2271 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2272 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2273 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002274 }
2275}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002276# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002277pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002278 PatLit {
2279 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2280 }
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_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002284 PatMacro {
2285 mac: _visitor.fold_macro(_i . mac),
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_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002290 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002291 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002292 path: _visitor.fold_path(_i . path),
2293 }
2294}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002295# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002296pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002297 PatRange {
2298 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002299 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002300 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002301 }
2302}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002303# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002304pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002305 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002306 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002307 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002308 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002309 }
2310}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002311# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002312pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002313 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002314 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002315 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002316 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002317 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002318 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002319 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002320 }
2321}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002322# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002323pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002324 PatStruct {
2325 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002326 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002327 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002328 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002329 }
2330}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002331# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002332pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002333 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002334 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002335 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002336 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002337 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2338 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002339 }
2340}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002341# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002342pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002343 PatTupleStruct {
2344 path: _visitor.fold_path(_i . path),
2345 pat: _visitor.fold_pat_tuple(_i . pat),
2346 }
2347}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002348# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002349pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002350 PatVerbatim {
2351 tts: _i . tts,
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_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002356 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002357 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002358 }
2359}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002360# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002361pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002362 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002363 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002364 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2365 }
2366}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002367# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002368pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002369 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002370 PathArguments::None => { PathArguments::None }
2371 PathArguments::AngleBracketed(_binding_0, ) => {
2372 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002373 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2374 )
2375 }
David Tolnay6702ade2017-12-30 23:38:15 -05002376 PathArguments::Parenthesized(_binding_0, ) => {
2377 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002378 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2379 )
2380 }
2381 }
2382}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002383# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002384pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002385 PathSegment {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002386 ident: _i . ident,
Nika Layzellc08227a2017-12-04 16:30:17 -05002387 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002388 }
2389}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002390# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002391pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
David Tolnayd4add852018-01-01 20:13:24 -08002392 PredicateEq {
2393 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2394 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2395 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2396 }
2397}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002398# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002399pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
David Tolnayd4add852018-01-01 20:13:24 -08002400 PredicateLifetime {
2401 lifetime: _visitor.fold_lifetime(_i . lifetime),
2402 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2403 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2404 }
2405}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002406# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002407pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
David Tolnayd4add852018-01-01 20:13:24 -08002408 PredicateType {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002409 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayd4add852018-01-01 20:13:24 -08002410 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2411 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2412 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2413 }
2414}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002415# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002416pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002417 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002418 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002419 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002420 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2422 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002423 }
2424}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002425# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002426pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002427 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002428 RangeLimits::HalfOpen(_binding_0, ) => {
2429 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002430 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002431 )
2432 }
David Tolnay6702ade2017-12-30 23:38:15 -05002433 RangeLimits::Closed(_binding_0, ) => {
2434 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002435 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
2438 }
2439}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002440# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002441pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002442 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002443 ReturnType::Default => { ReturnType::Default }
2444 ReturnType::Type(_binding_0, _binding_1, ) => {
2445 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002446 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2447 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002448 )
2449 }
2450 }
2451}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002452
David Tolnay4b4c4b62018-01-06 13:48:05 -08002453pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002454 _i
2455}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002456# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002457pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002458 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002459 Stmt::Local(_binding_0, ) => {
2460 Stmt::Local (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002461 _visitor.fold_local(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002462 )
2463 }
David Tolnay6702ade2017-12-30 23:38:15 -05002464 Stmt::Item(_binding_0, ) => {
2465 Stmt::Item (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002466 _visitor.fold_item(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002467 )
2468 }
David Tolnay6702ade2017-12-30 23:38:15 -05002469 Stmt::Expr(_binding_0, ) => {
2470 Stmt::Expr (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002471 _visitor.fold_expr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
David Tolnay6702ade2017-12-30 23:38:15 -05002474 Stmt::Semi(_binding_0, _binding_1, ) => {
2475 Stmt::Semi (
David Tolnay1f0b7b82018-01-06 16:07:14 -08002476 _visitor.fold_expr(_binding_0),
David Tolnaycc0f0372017-12-28 19:11:04 -05002477 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002478 )
2479 }
Nika Layzell27726662017-10-24 23:16:35 -04002480 }
2481}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002482# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002483pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002484 TraitBound {
David Tolnayc1f5d5d2018-03-31 22:17:56 +02002485 paren_token: (_i . paren_token).map(|it| { Paren(tokens_helper(_visitor, &(it).0)) }),
David Tolnay40fb8ce2018-01-02 10:53:46 -08002486 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2487 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2488 path: _visitor.fold_path(_i . path),
2489 }
2490}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002491# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002492pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002493 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002494 TraitBoundModifier::None => { TraitBoundModifier::None }
2495 TraitBoundModifier::Maybe(_binding_0, ) => {
2496 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002497 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002498 )
2499 }
2500 }
2501}
2502# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002503pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002504 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002505 TraitItem::Const(_binding_0, ) => {
2506 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002507 _visitor.fold_trait_item_const(_binding_0),
2508 )
2509 }
David Tolnay6702ade2017-12-30 23:38:15 -05002510 TraitItem::Method(_binding_0, ) => {
2511 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002512 _visitor.fold_trait_item_method(_binding_0),
2513 )
2514 }
David Tolnay6702ade2017-12-30 23:38:15 -05002515 TraitItem::Type(_binding_0, ) => {
2516 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002517 _visitor.fold_trait_item_type(_binding_0),
2518 )
2519 }
David Tolnay6702ade2017-12-30 23:38:15 -05002520 TraitItem::Macro(_binding_0, ) => {
2521 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002522 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002523 )
2524 }
David Tolnay6702ade2017-12-30 23:38:15 -05002525 TraitItem::Verbatim(_binding_0, ) => {
2526 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002527 _visitor.fold_trait_item_verbatim(_binding_0),
2528 )
2529 }
Nika Layzell27726662017-10-24 23:16:35 -04002530 }
2531}
2532# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002533pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
David Tolnayda705bd2017-11-10 21:58:05 -08002534 TraitItemConst {
2535 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002536 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002537 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05002538 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002539 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002540 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002541 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002542 _visitor.fold_expr(( it ) . 1),
2543 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002544 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002545 }
2546}
2547# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002548pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
David Tolnaydecf28d2017-11-11 11:56:45 -08002549 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002550 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002551 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002552 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002553 }
2554}
2555# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002556pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002557 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002558 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002559 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002560 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002562 }
2563}
2564# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002565pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002566 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002568 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002569 ident: _i . ident,
Nika Layzell591528a2017-12-05 12:47:37 -05002570 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002571 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002573 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002574 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002575 _visitor.fold_type(( it ) . 1),
2576 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002577 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002578 }
2579}
David Tolnay2ae520a2017-12-29 11:19:50 -05002580# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002581pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002582 TraitItemVerbatim {
2583 tts: _i . tts,
2584 }
2585}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002586# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002587pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002588 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002589 Type::Slice(_binding_0, ) => {
2590 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002592 )
2593 }
David Tolnay6702ade2017-12-30 23:38:15 -05002594 Type::Array(_binding_0, ) => {
2595 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002597 )
2598 }
David Tolnay6702ade2017-12-30 23:38:15 -05002599 Type::Ptr(_binding_0, ) => {
2600 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002601 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002602 )
2603 }
David Tolnay6702ade2017-12-30 23:38:15 -05002604 Type::Reference(_binding_0, ) => {
2605 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002606 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002607 )
2608 }
David Tolnay6702ade2017-12-30 23:38:15 -05002609 Type::BareFn(_binding_0, ) => {
2610 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
David Tolnay6702ade2017-12-30 23:38:15 -05002614 Type::Never(_binding_0, ) => {
2615 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002616 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002617 )
2618 }
David Tolnay6702ade2017-12-30 23:38:15 -05002619 Type::Tuple(_binding_0, ) => {
2620 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002621 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002622 )
2623 }
David Tolnay6702ade2017-12-30 23:38:15 -05002624 Type::Path(_binding_0, ) => {
2625 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002627 )
2628 }
David Tolnay6702ade2017-12-30 23:38:15 -05002629 Type::TraitObject(_binding_0, ) => {
2630 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002632 )
2633 }
David Tolnay6702ade2017-12-30 23:38:15 -05002634 Type::ImplTrait(_binding_0, ) => {
2635 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002636 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002637 )
2638 }
David Tolnay6702ade2017-12-30 23:38:15 -05002639 Type::Paren(_binding_0, ) => {
2640 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002642 )
2643 }
David Tolnay6702ade2017-12-30 23:38:15 -05002644 Type::Group(_binding_0, ) => {
2645 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002646 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
David Tolnay6702ade2017-12-30 23:38:15 -05002649 Type::Infer(_binding_0, ) => {
2650 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002651 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002652 )
2653 }
David Tolnay6702ade2017-12-30 23:38:15 -05002654 Type::Macro(_binding_0, ) => {
2655 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002656 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002657 )
2658 }
David Tolnay6702ade2017-12-30 23:38:15 -05002659 Type::Verbatim(_binding_0, ) => {
2660 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002661 _visitor.fold_type_verbatim(_binding_0),
2662 )
2663 }
Nika Layzell27726662017-10-24 23:16:35 -04002664 }
2665}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002666# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002667pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002668 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002669 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002670 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002671 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002672 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002673 }
2674}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002675# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002676pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002677 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002678 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2679 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2680 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2681 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2682 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2683 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2684 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2685 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002686 }
2687}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002688# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002689pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002690 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002691 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002692 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002693 }
2694}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002695# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002696pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002697 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002698 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002699 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002700 }
2701}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002702# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002703pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002704 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002705 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002706 }
2707}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002708# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002709pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
David Tolnay323279a2017-12-29 11:26:32 -05002710 TypeMacro {
2711 mac: _visitor.fold_macro(_i . mac),
2712 }
2713}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002714# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002715pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002716 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002717 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002718 }
2719}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002720# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002721pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002722 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002723 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002724 ident: _i . ident,
David Tolnaycc0f0372017-12-28 19:11:04 -05002725 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002726 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002727 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002728 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002729 }
2730}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002731# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002732pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002733 match _i {
David Tolnay40fb8ce2018-01-02 10:53:46 -08002734 TypeParamBound::Trait(_binding_0, ) => {
David Tolnay6702ade2017-12-30 23:38:15 -05002735 TypeParamBound::Trait (
David Tolnay40fb8ce2018-01-02 10:53:46 -08002736 _visitor.fold_trait_bound(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002737 )
2738 }
David Tolnay40fb8ce2018-01-02 10:53:46 -08002739 TypeParamBound::Lifetime(_binding_0, ) => {
2740 TypeParamBound::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05002741 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002742 )
2743 }
2744 }
2745}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002746# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002747pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002748 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002749 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002750 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002751 }
2752}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002753# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002754pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002755 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002756 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002757 path: _visitor.fold_path(_i . path),
2758 }
2759}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002760# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002761pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002762 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002763 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2764 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002765 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2766 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002767 }
2768}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002769# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002770pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
David Tolnay0a89b4d2017-11-13 00:55:45 -08002771 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002772 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002773 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002774 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2775 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002776 }
2777}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002778# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002779pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002780 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002781 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002782 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002785# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002786pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002787 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002789 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002790 }
2791}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002792# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002793pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
David Tolnay05362582017-12-26 01:33:57 -05002794 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002795 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002796 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002797 }
2798}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002799# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002800pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
David Tolnay2ae520a2017-12-29 11:19:50 -05002801 TypeVerbatim {
2802 tts: _i . tts,
2803 }
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_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002807 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002808 UnOp::Deref(_binding_0, ) => {
2809 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002810 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002811 )
2812 }
David Tolnay6702ade2017-12-30 23:38:15 -05002813 UnOp::Not(_binding_0, ) => {
2814 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002815 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002816 )
2817 }
David Tolnay6702ade2017-12-30 23:38:15 -05002818 UnOp::Neg(_binding_0, ) => {
2819 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002820 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002821 )
2822 }
2823 }
2824}
David Tolnay5f332a92017-12-26 00:42:45 -05002825# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002826pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
David Tolnay5f332a92017-12-26 00:42:45 -05002827 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002828 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002829 }
2830}
2831# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002832pub fn fold_use_group<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGroup) -> UseGroup {
2833 UseGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002834 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002835 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2836 }
2837}
2838# [ cfg ( feature = "full" ) ]
David Tolnayd97a7d22018-03-31 19:17:01 +02002839pub fn fold_use_name<V: Fold + ?Sized>(_visitor: &mut V, _i: UseName) -> UseName {
2840 UseName {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002841 ident: _i . ident,
David Tolnayd97a7d22018-03-31 19:17:01 +02002842 }
2843}
2844# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002845pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
David Tolnay5f332a92017-12-26 00:42:45 -05002846 UsePath {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002847 ident: _i . ident,
David Tolnayd97a7d22018-03-31 19:17:01 +02002848 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2849 tree: Box::new(_visitor.fold_use_tree(* _i . tree)),
2850 }
2851}
2852# [ cfg ( feature = "full" ) ]
2853pub fn fold_use_rename<V: Fold + ?Sized>(_visitor: &mut V, _i: UseRename) -> UseRename {
2854 UseRename {
Alex Crichtona74a1c82018-05-16 10:20:44 -07002855 ident: _i . ident,
David Tolnayd97a7d22018-03-31 19:17:01 +02002856 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002857 rename: _i . rename,
David Tolnay5f332a92017-12-26 00:42:45 -05002858 }
2859}
2860# [ cfg ( feature = "full" ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002861pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002862 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002863 UseTree::Path(_binding_0, ) => {
2864 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002865 _visitor.fold_use_path(_binding_0),
2866 )
2867 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002868 UseTree::Name(_binding_0, ) => {
2869 UseTree::Name (
2870 _visitor.fold_use_name(_binding_0),
2871 )
2872 }
2873 UseTree::Rename(_binding_0, ) => {
2874 UseTree::Rename (
2875 _visitor.fold_use_rename(_binding_0),
2876 )
2877 }
David Tolnay6702ade2017-12-30 23:38:15 -05002878 UseTree::Glob(_binding_0, ) => {
2879 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002880 _visitor.fold_use_glob(_binding_0),
2881 )
2882 }
David Tolnayd97a7d22018-03-31 19:17:01 +02002883 UseTree::Group(_binding_0, ) => {
2884 UseTree::Group (
2885 _visitor.fold_use_group(_binding_0),
David Tolnay5f332a92017-12-26 00:42:45 -05002886 )
2887 }
2888 }
2889}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002890# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002891pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002892 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002893 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Alex Crichtona74a1c82018-05-16 10:20:44 -07002894 ident: _i . ident,
David Tolnaye3d41b72017-12-31 15:24:00 -05002895 fields: _visitor.fold_fields(_i . fields),
David Tolnaye67902a2017-12-28 22:12:00 -05002896 discriminant: (_i . discriminant).map(|it| { (
2897 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2898 _visitor.fold_expr(( it ) . 1),
2899 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002900 }
2901}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002902# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002903pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002904 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002905 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
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_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002910 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002911 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_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_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002916 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002917 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002918 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002919 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002920 path: Box::new(_visitor.fold_path(* _i . path)),
2921 }
2922}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002923# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002924pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002925 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002926 Visibility::Public(_binding_0, ) => {
2927 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002928 _visitor.fold_vis_public(_binding_0),
2929 )
2930 }
David Tolnay6702ade2017-12-30 23:38:15 -05002931 Visibility::Crate(_binding_0, ) => {
2932 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002933 _visitor.fold_vis_crate(_binding_0),
2934 )
2935 }
David Tolnay6702ade2017-12-30 23:38:15 -05002936 Visibility::Restricted(_binding_0, ) => {
2937 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002938 _visitor.fold_vis_restricted(_binding_0),
2939 )
2940 }
David Tolnay6702ade2017-12-30 23:38:15 -05002941 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002942 }
2943}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002944# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002945pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002946 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002947 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002948 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2949 }
2950}
David Tolnay3cfd1d32018-01-03 00:22:08 -08002951# [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
David Tolnay4b4c4b62018-01-06 13:48:05 -08002952pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002953 match _i {
David Tolnayd4add852018-01-01 20:13:24 -08002954 WherePredicate::Type(_binding_0, ) => {
2955 WherePredicate::Type (
2956 _visitor.fold_predicate_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002957 )
2958 }
David Tolnayd4add852018-01-01 20:13:24 -08002959 WherePredicate::Lifetime(_binding_0, ) => {
2960 WherePredicate::Lifetime (
2961 _visitor.fold_predicate_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002962 )
2963 }
David Tolnayd4add852018-01-01 20:13:24 -08002964 WherePredicate::Eq(_binding_0, ) => {
2965 WherePredicate::Eq (
2966 _visitor.fold_predicate_eq(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002967 )
2968 }
2969 }
2970}
2971