blob: 85809523b4c54accdcee9936b82d7e8d88b83bf6 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzellc08227a2017-12-04 16:30:17 -050045fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
David Tolnay506e43a2017-12-29 11:34:36 -050064
65fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050076
77fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
David Tolnay8c91b882017-12-28 23:04:32 -0500123fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500127fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500141fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500147fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500153fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500154
155fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
Nika Layzell640832a2017-12-04 13:37:09 -0500156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800180# [ cfg ( feature = "full" ) ]
181fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500182# [ cfg ( feature = "full" ) ]
183fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184
Nika Layzellc08227a2017-12-04 16:30:17 -0500185fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500186# [ cfg ( feature = "full" ) ]
187fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500188
David Tolnayc2f1aba2017-11-12 20:29:22 -0800189fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
190
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500192
193fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800199fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500204# [ cfg ( feature = "full" ) ]
205fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500206
David Tolnay85b69a42017-12-27 20:43:10 -0500207fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800223fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800225fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800235fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500240# [ cfg ( feature = "full" ) ]
241fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
David Tolnaybcd498f2017-12-29 12:02:33 -0500242# [ cfg ( feature = "full" ) ]
243fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244
David Tolnay4ba63a02017-12-28 15:53:05 -0500245fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
246
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500248
249fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
David Tolnaydecf28d2017-11-11 11:56:45 -0800253fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500254
David Tolnayab919512017-12-30 23:31:51 -0500255fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
256
David Tolnay85b69a42017-12-27 20:43:10 -0500257fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500266# [ cfg ( feature = "full" ) ]
267fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzellc08227a2017-12-04 16:30:17 -0500271fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500281fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500297fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500302
303fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800312
313fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500314
315fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800325fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500330# [ cfg ( feature = "full" ) ]
331fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800339fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
340
341fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
342
343fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
344
David Tolnay323279a2017-12-29 11:26:32 -0500345fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
348
349fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
350
351fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
352
353fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
354
355fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
356
357fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
358
David Tolnay0a89b4d2017-11-13 00:55:45 -0800359fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360
361fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
362
363fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
364
David Tolnay05362582017-12-26 01:33:57 -0500365fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800366
David Tolnay2ae520a2017-12-29 11:19:50 -0500367fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500370# [ cfg ( feature = "full" ) ]
371fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
376# [ cfg ( feature = "full" ) ]
377fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
401}
402
David Tolnayd0adf522017-12-29 01:30:07 -0500403pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
404 _i.span = _visitor.fold_span(_i.span);
405 _i
406}
407
408pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
409 _i.span = _visitor.fold_span(_i.span);
410 _i
411}
412
Nika Layzell27726662017-10-24 23:16:35 -0400413
Nika Layzella6f46c42017-10-26 15:26:16 -0400414pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400415 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500416 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500417 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400418 }
419}
420
Nika Layzellc08227a2017-12-04 16:30:17 -0500421pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
422 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500423 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500425 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500426 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400427 }
428}
429# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400430pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400431 ArgCaptured {
432 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500433 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800434 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400435 }
436}
437# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400438pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400439 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500440 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400442 }
443}
444# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400445pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400446 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500447 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500448 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500449 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500450 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400451 }
452}
453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400454pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400455 Arm {
456 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
457 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnay8b4d3022017-12-29 12:11:10 -0500458 guard: (_i . guard).map(|it| { (
459 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
460 Box::new(_visitor.fold_expr(* ( it ) . 1)),
461 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400463 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500464 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400465 }
466}
467
Nika Layzella6f46c42017-10-26 15:26:16 -0400468pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400469 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500470 AttrStyle::Outer => { AttrStyle::Outer }
471 AttrStyle::Inner(_binding_0, ) => {
472 AttrStyle::Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500473 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400474 )
475 }
476 }
477}
478
Nika Layzella6f46c42017-10-26 15:26:16 -0400479pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400480 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500481 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500482 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500483 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400484 path: _visitor.fold_path(_i . path),
485 tts: _i . tts,
486 is_sugared_doc: _i . is_sugared_doc,
487 }
488}
489
Nika Layzella6f46c42017-10-26 15:26:16 -0400490pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400491 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 name: (_i . name).map(|it| { (
493 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500494 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500495 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800496 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400497 }
498}
499
Nika Layzella6f46c42017-10-26 15:26:16 -0400500pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400501 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500502 BareFnArgName::Named(_binding_0, ) => {
503 BareFnArgName::Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500504 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400505 )
506 }
David Tolnay6702ade2017-12-30 23:38:15 -0500507 BareFnArgName::Wild(_binding_0, ) => {
508 BareFnArgName::Wild (
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}
514
Nika Layzella6f46c42017-10-26 15:26:16 -0400515pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400516 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500517 BinOp::Add(_binding_0, ) => {
518 BinOp::Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 )
521 }
David Tolnay6702ade2017-12-30 23:38:15 -0500522 BinOp::Sub(_binding_0, ) => {
523 BinOp::Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500524 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400525 )
526 }
David Tolnay6702ade2017-12-30 23:38:15 -0500527 BinOp::Mul(_binding_0, ) => {
528 BinOp::Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400530 )
531 }
David Tolnay6702ade2017-12-30 23:38:15 -0500532 BinOp::Div(_binding_0, ) => {
533 BinOp::Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500534 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400535 )
536 }
David Tolnay6702ade2017-12-30 23:38:15 -0500537 BinOp::Rem(_binding_0, ) => {
538 BinOp::Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500539 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
David Tolnay6702ade2017-12-30 23:38:15 -0500542 BinOp::And(_binding_0, ) => {
543 BinOp::And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
David Tolnay6702ade2017-12-30 23:38:15 -0500547 BinOp::Or(_binding_0, ) => {
548 BinOp::Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500549 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400550 )
551 }
David Tolnay6702ade2017-12-30 23:38:15 -0500552 BinOp::BitXor(_binding_0, ) => {
553 BinOp::BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
David Tolnay6702ade2017-12-30 23:38:15 -0500557 BinOp::BitAnd(_binding_0, ) => {
558 BinOp::BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
David Tolnay6702ade2017-12-30 23:38:15 -0500562 BinOp::BitOr(_binding_0, ) => {
563 BinOp::BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
David Tolnay6702ade2017-12-30 23:38:15 -0500567 BinOp::Shl(_binding_0, ) => {
568 BinOp::Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
David Tolnay6702ade2017-12-30 23:38:15 -0500572 BinOp::Shr(_binding_0, ) => {
573 BinOp::Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
David Tolnay6702ade2017-12-30 23:38:15 -0500577 BinOp::Eq(_binding_0, ) => {
578 BinOp::Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
David Tolnay6702ade2017-12-30 23:38:15 -0500582 BinOp::Lt(_binding_0, ) => {
583 BinOp::Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
David Tolnay6702ade2017-12-30 23:38:15 -0500587 BinOp::Le(_binding_0, ) => {
588 BinOp::Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
David Tolnay6702ade2017-12-30 23:38:15 -0500592 BinOp::Ne(_binding_0, ) => {
593 BinOp::Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
David Tolnay6702ade2017-12-30 23:38:15 -0500597 BinOp::Ge(_binding_0, ) => {
598 BinOp::Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
David Tolnay6702ade2017-12-30 23:38:15 -0500602 BinOp::Gt(_binding_0, ) => {
603 BinOp::Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
David Tolnay6702ade2017-12-30 23:38:15 -0500607 BinOp::AddEq(_binding_0, ) => {
608 BinOp::AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
David Tolnay6702ade2017-12-30 23:38:15 -0500612 BinOp::SubEq(_binding_0, ) => {
613 BinOp::SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
David Tolnay6702ade2017-12-30 23:38:15 -0500617 BinOp::MulEq(_binding_0, ) => {
618 BinOp::MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
David Tolnay6702ade2017-12-30 23:38:15 -0500622 BinOp::DivEq(_binding_0, ) => {
623 BinOp::DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
David Tolnay6702ade2017-12-30 23:38:15 -0500627 BinOp::RemEq(_binding_0, ) => {
628 BinOp::RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
David Tolnay6702ade2017-12-30 23:38:15 -0500632 BinOp::BitXorEq(_binding_0, ) => {
633 BinOp::BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
David Tolnay6702ade2017-12-30 23:38:15 -0500637 BinOp::BitAndEq(_binding_0, ) => {
638 BinOp::BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
David Tolnay6702ade2017-12-30 23:38:15 -0500642 BinOp::BitOrEq(_binding_0, ) => {
643 BinOp::BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
David Tolnay6702ade2017-12-30 23:38:15 -0500647 BinOp::ShlEq(_binding_0, ) => {
648 BinOp::ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
David Tolnay6702ade2017-12-30 23:38:15 -0500652 BinOp::ShrEq(_binding_0, ) => {
653 BinOp::ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500654 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400655 )
656 }
657 }
658}
David Tolnay506e43a2017-12-29 11:34:36 -0500659
660pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
661 Binding {
662 ident: _visitor.fold_ident(_i . ident),
663 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
664 ty: _visitor.fold_type(_i . ty),
665 }
666}
Nika Layzell27726662017-10-24 23:16:35 -0400667# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400668pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400669 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500670 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400671 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
672 }
673}
674
Nika Layzella6f46c42017-10-26 15:26:16 -0400675pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400676 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500677 Body::Enum(_binding_0, ) => {
678 Body::Enum (
Nika Layzell27726662017-10-24 23:16:35 -0400679 _visitor.fold_body_enum(_binding_0),
680 )
681 }
David Tolnay6702ade2017-12-30 23:38:15 -0500682 Body::Struct(_binding_0, ) => {
683 Body::Struct (
Nika Layzell27726662017-10-24 23:16:35 -0400684 _visitor.fold_body_struct(_binding_0),
685 )
686 }
687 }
688}
689
Nika Layzella6f46c42017-10-26 15:26:16 -0400690pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400691 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500692 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500693 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400694 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
695 }
696}
697
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400699 BodyStruct {
700 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500701 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
702 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400703 }
704}
705
Nika Layzella6f46c42017-10-26 15:26:16 -0400706pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400707 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500708 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
709 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400710 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500711 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400712 }
713}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500714
715pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
716 ConstParam {
717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500719 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500723 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
724 }
725}
Nika Layzell27726662017-10-24 23:16:35 -0400726
Nika Layzella6f46c42017-10-26 15:26:16 -0400727pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400728 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400729 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500730 vis: _visitor.fold_visibility(_i . vis),
731 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400732 generics: _visitor.fold_generics(_i . generics),
733 body: _visitor.fold_body(_i . body),
734 }
735}
736
Nika Layzella6f46c42017-10-26 15:26:16 -0400737pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400738 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -0500739 Expr::Box(_binding_0, ) => {
740 Expr::Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400741 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400742 )
743 }
David Tolnay6702ade2017-12-30 23:38:15 -0500744 Expr::InPlace(_binding_0, ) => {
745 Expr::InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400746 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400747 )
748 }
David Tolnay6702ade2017-12-30 23:38:15 -0500749 Expr::Array(_binding_0, ) => {
750 Expr::Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400751 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400752 )
753 }
David Tolnay6702ade2017-12-30 23:38:15 -0500754 Expr::Call(_binding_0, ) => {
755 Expr::Call (
Nika Layzell27726662017-10-24 23:16:35 -0400756 _visitor.fold_expr_call(_binding_0),
757 )
758 }
David Tolnay6702ade2017-12-30 23:38:15 -0500759 Expr::MethodCall(_binding_0, ) => {
760 Expr::MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400761 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400762 )
763 }
David Tolnay6702ade2017-12-30 23:38:15 -0500764 Expr::Tuple(_binding_0, ) => {
765 Expr::Tuple (
David Tolnay05362582017-12-26 01:33:57 -0500766 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400767 )
768 }
David Tolnay6702ade2017-12-30 23:38:15 -0500769 Expr::Binary(_binding_0, ) => {
770 Expr::Binary (
Nika Layzell27726662017-10-24 23:16:35 -0400771 _visitor.fold_expr_binary(_binding_0),
772 )
773 }
David Tolnay6702ade2017-12-30 23:38:15 -0500774 Expr::Unary(_binding_0, ) => {
775 Expr::Unary (
Nika Layzell27726662017-10-24 23:16:35 -0400776 _visitor.fold_expr_unary(_binding_0),
777 )
778 }
David Tolnay6702ade2017-12-30 23:38:15 -0500779 Expr::Lit(_binding_0, ) => {
780 Expr::Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500781 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400782 )
783 }
David Tolnay6702ade2017-12-30 23:38:15 -0500784 Expr::Cast(_binding_0, ) => {
785 Expr::Cast (
Nika Layzell27726662017-10-24 23:16:35 -0400786 _visitor.fold_expr_cast(_binding_0),
787 )
788 }
David Tolnay6702ade2017-12-30 23:38:15 -0500789 Expr::Type(_binding_0, ) => {
790 Expr::Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500791 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400792 )
793 }
David Tolnay6702ade2017-12-30 23:38:15 -0500794 Expr::If(_binding_0, ) => {
795 Expr::If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400796 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400797 )
798 }
David Tolnay6702ade2017-12-30 23:38:15 -0500799 Expr::IfLet(_binding_0, ) => {
800 Expr::IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400801 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400802 )
803 }
David Tolnay6702ade2017-12-30 23:38:15 -0500804 Expr::While(_binding_0, ) => {
805 Expr::While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400806 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 )
808 }
David Tolnay6702ade2017-12-30 23:38:15 -0500809 Expr::WhileLet(_binding_0, ) => {
810 Expr::WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400811 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400812 )
813 }
David Tolnay6702ade2017-12-30 23:38:15 -0500814 Expr::ForLoop(_binding_0, ) => {
815 Expr::ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400816 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400817 )
818 }
David Tolnay6702ade2017-12-30 23:38:15 -0500819 Expr::Loop(_binding_0, ) => {
820 Expr::Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400821 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400822 )
823 }
David Tolnay6702ade2017-12-30 23:38:15 -0500824 Expr::Match(_binding_0, ) => {
825 Expr::Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400826 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400827 )
828 }
David Tolnay6702ade2017-12-30 23:38:15 -0500829 Expr::Closure(_binding_0, ) => {
830 Expr::Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400831 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400832 )
833 }
David Tolnay6702ade2017-12-30 23:38:15 -0500834 Expr::Unsafe(_binding_0, ) => {
835 Expr::Unsafe (
Nika Layzell640832a2017-12-04 13:37:09 -0500836 full!(_visitor.fold_expr_unsafe(_binding_0)),
837 )
838 }
David Tolnay6702ade2017-12-30 23:38:15 -0500839 Expr::Block(_binding_0, ) => {
840 Expr::Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400841 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400842 )
843 }
David Tolnay6702ade2017-12-30 23:38:15 -0500844 Expr::Assign(_binding_0, ) => {
845 Expr::Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400846 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400847 )
848 }
David Tolnay6702ade2017-12-30 23:38:15 -0500849 Expr::AssignOp(_binding_0, ) => {
850 Expr::AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
David Tolnay6702ade2017-12-30 23:38:15 -0500854 Expr::Field(_binding_0, ) => {
855 Expr::Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
David Tolnay6702ade2017-12-30 23:38:15 -0500859 Expr::Index(_binding_0, ) => {
860 Expr::Index (
Nika Layzell27726662017-10-24 23:16:35 -0400861 _visitor.fold_expr_index(_binding_0),
862 )
863 }
David Tolnay6702ade2017-12-30 23:38:15 -0500864 Expr::Range(_binding_0, ) => {
865 Expr::Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400866 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 )
868 }
David Tolnay6702ade2017-12-30 23:38:15 -0500869 Expr::Path(_binding_0, ) => {
870 Expr::Path (
Nika Layzell27726662017-10-24 23:16:35 -0400871 _visitor.fold_expr_path(_binding_0),
872 )
873 }
David Tolnay6702ade2017-12-30 23:38:15 -0500874 Expr::AddrOf(_binding_0, ) => {
875 Expr::AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400876 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400877 )
878 }
David Tolnay6702ade2017-12-30 23:38:15 -0500879 Expr::Break(_binding_0, ) => {
880 Expr::Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400881 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 )
883 }
David Tolnay6702ade2017-12-30 23:38:15 -0500884 Expr::Continue(_binding_0, ) => {
885 Expr::Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400886 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400887 )
888 }
David Tolnay6702ade2017-12-30 23:38:15 -0500889 Expr::Return(_binding_0, ) => {
890 Expr::Return (
David Tolnayc246cd32017-12-28 23:14:32 -0500891 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
David Tolnay6702ade2017-12-30 23:38:15 -0500894 Expr::Macro(_binding_0, ) => {
895 Expr::Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500896 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
David Tolnay6702ade2017-12-30 23:38:15 -0500899 Expr::Struct(_binding_0, ) => {
900 Expr::Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400901 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400902 )
903 }
David Tolnay6702ade2017-12-30 23:38:15 -0500904 Expr::Repeat(_binding_0, ) => {
905 Expr::Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400906 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400907 )
908 }
David Tolnay6702ade2017-12-30 23:38:15 -0500909 Expr::Paren(_binding_0, ) => {
910 Expr::Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500911 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400912 )
913 }
David Tolnay6702ade2017-12-30 23:38:15 -0500914 Expr::Group(_binding_0, ) => {
915 Expr::Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500916 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400917 )
918 }
David Tolnay6702ade2017-12-30 23:38:15 -0500919 Expr::Try(_binding_0, ) => {
920 Expr::Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400921 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400922 )
923 }
David Tolnay6702ade2017-12-30 23:38:15 -0500924 Expr::Catch(_binding_0, ) => {
925 Expr::Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400926 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400927 )
928 }
David Tolnay6702ade2017-12-30 23:38:15 -0500929 Expr::Yield(_binding_0, ) => {
930 Expr::Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400931 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400932 )
933 }
David Tolnay6702ade2017-12-30 23:38:15 -0500934 Expr::Verbatim(_binding_0, ) => {
935 Expr::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -0500936 _visitor.fold_expr_verbatim(_binding_0),
937 )
938 }
Nika Layzell27726662017-10-24 23:16:35 -0400939 }
940}
941# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500942pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
943 ExprAddrOf {
944 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
945 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500946 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500947 expr: Box::new(_visitor.fold_expr(* _i . expr)),
948 }
949}
950# [ cfg ( feature = "full" ) ]
951pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
952 ExprArray {
953 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
954 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500955 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500956 }
957}
958# [ cfg ( feature = "full" ) ]
959pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
960 ExprAssign {
961 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
962 left: Box::new(_visitor.fold_expr(* _i . left)),
963 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
964 right: Box::new(_visitor.fold_expr(* _i . right)),
965 }
966}
967# [ cfg ( feature = "full" ) ]
968pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
969 ExprAssignOp {
970 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
971 left: Box::new(_visitor.fold_expr(* _i . left)),
972 op: _visitor.fold_bin_op(_i . op),
973 right: Box::new(_visitor.fold_expr(* _i . right)),
974 }
975}
976
977pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
978 ExprBinary {
979 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
980 left: Box::new(_visitor.fold_expr(* _i . left)),
981 op: _visitor.fold_bin_op(_i . op),
982 right: Box::new(_visitor.fold_expr(* _i . right)),
983 }
984}
985# [ cfg ( feature = "full" ) ]
986pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
987 ExprBlock {
988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
989 block: _visitor.fold_block(_i . block),
990 }
991}
992# [ cfg ( feature = "full" ) ]
993pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
994 ExprBox {
995 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
996 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
997 expr: Box::new(_visitor.fold_expr(* _i . expr)),
998 }
999}
1000# [ cfg ( feature = "full" ) ]
1001pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1002 ExprBreak {
1003 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1004 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1005 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1006 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1007 }
1008}
1009
1010pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1011 ExprCall {
1012 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1013 func: Box::new(_visitor.fold_expr(* _i . func)),
1014 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1015 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1016 }
1017}
1018
1019pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1020 ExprCast {
1021 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1022 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1023 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1024 ty: Box::new(_visitor.fold_type(* _i . ty)),
1025 }
1026}
1027# [ cfg ( feature = "full" ) ]
1028pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1029 ExprCatch {
1030 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1031 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1032 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1033 block: _visitor.fold_block(_i . block),
1034 }
1035}
1036# [ cfg ( feature = "full" ) ]
1037pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1038 ExprClosure {
1039 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001040 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001041 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1042 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1043 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1044 output: _visitor.fold_return_type(_i . output),
1045 body: Box::new(_visitor.fold_expr(* _i . body)),
1046 }
1047}
1048# [ cfg ( feature = "full" ) ]
1049pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1050 ExprContinue {
1051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1052 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1053 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1054 }
1055}
1056# [ cfg ( feature = "full" ) ]
1057pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1058 ExprField {
1059 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1060 base: Box::new(_visitor.fold_expr(* _i . base)),
1061 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1062 member: _visitor.fold_member(_i . member),
1063 }
1064}
1065# [ cfg ( feature = "full" ) ]
1066pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1067 ExprForLoop {
1068 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001069 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001070 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1071 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1072 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1073 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1074 body: _visitor.fold_block(_i . body),
1075 }
1076}
David Tolnaye98775f2017-12-28 23:17:00 -05001077# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001078pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1079 ExprGroup {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1081 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1082 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1083 }
1084}
1085# [ cfg ( feature = "full" ) ]
1086pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1087 ExprIf {
1088 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1089 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1090 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001091 then_branch: _visitor.fold_block(_i . then_branch),
1092 else_branch: (_i . else_branch).map(|it| { (
1093 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1094 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1095 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001096 }
1097}
1098# [ cfg ( feature = "full" ) ]
1099pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1100 ExprIfLet {
1101 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1102 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1103 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1104 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1105 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1106 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001107 then_branch: _visitor.fold_block(_i . then_branch),
1108 else_branch: (_i . else_branch).map(|it| { (
1109 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1110 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1111 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001112 }
1113}
1114# [ cfg ( feature = "full" ) ]
1115pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1116 ExprInPlace {
1117 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1118 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001119 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001120 value: Box::new(_visitor.fold_expr(* _i . value)),
1121 }
1122}
1123
1124pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1125 ExprIndex {
1126 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1127 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1128 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1129 index: Box::new(_visitor.fold_expr(* _i . index)),
1130 }
1131}
1132
1133pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1134 ExprLit {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 lit: _visitor.fold_lit(_i . lit),
1137 }
1138}
1139# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001140pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001141 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001142 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001143 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001144 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1145 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001146 }
1147}
1148# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001149pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1150 ExprMacro {
1151 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1152 mac: _visitor.fold_macro(_i . mac),
1153 }
1154}
1155# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001156pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001157 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001158 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001159 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001160 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001161 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001162 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1163 }
1164}
1165# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001166pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001167 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001168 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001169 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001170 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001171 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001172 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001173 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1174 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001175 }
1176}
David Tolnaye98775f2017-12-28 23:17:00 -05001177# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001178pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001179 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001180 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001181 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001182 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
1184}
1185
Nika Layzella6f46c42017-10-26 15:26:16 -04001186pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001187 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001188 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001189 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001190 path: _visitor.fold_path(_i . path),
1191 }
1192}
1193# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001194pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001195 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001196 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001197 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001198 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001199 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
1201}
1202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001203pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001204 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001205 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001206 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001207 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001208 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001209 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1210 }
1211}
1212# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001213pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1214 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001215 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001216 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
1219}
1220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001221pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001222 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001223 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001224 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001225 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001226 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1227 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1228 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001229 }
1230}
1231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001232pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001233 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001234 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001235 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001236 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
1238}
1239# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001240pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1241 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001242 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001243 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001244 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001245 }
1246}
David Tolnay0cf94f22017-12-28 23:46:26 -05001247# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001248pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001249 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001251 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001252 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001253 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001254 }
1255}
1256
Nika Layzella6f46c42017-10-26 15:26:16 -04001257pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001258 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001259 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001260 op: _visitor.fold_un_op(_i . op),
1261 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1262 }
1263}
1264# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001265pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1266 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001267 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001268 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001269 block: _visitor.fold_block(_i . block),
1270 }
1271}
David Tolnay2ae520a2017-12-29 11:19:50 -05001272
1273pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1274 ExprVerbatim {
1275 tts: _i . tts,
1276 }
1277}
Nika Layzell640832a2017-12-04 13:37:09 -05001278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001279pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001280 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001281 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001282 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001283 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001284 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1285 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001286 }
1287}
1288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001289pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001291 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001292 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1294 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001295 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001296 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001297 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1298 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001299 }
1300}
1301# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001302pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001303 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001305 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001306 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001307 }
1308}
1309
Nika Layzella6f46c42017-10-26 15:26:16 -04001310pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001311 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001312 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001313 vis: _visitor.fold_visibility(_i . vis),
1314 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001315 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001316 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001317 }
1318}
1319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001320pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001321 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001322 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001323 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001324 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001325 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001326 }
1327}
1328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001329pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001330 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001331 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1332 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001333 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001334 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001335 }
1336}
1337# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001338pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001339 File {
1340 shebang: _i . shebang,
1341 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1342 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1343 }
1344}
1345# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001346pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001347 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001348 FnArg::SelfRef(_binding_0, ) => {
1349 FnArg::SelfRef (
Nika Layzell27726662017-10-24 23:16:35 -04001350 _visitor.fold_arg_self_ref(_binding_0),
1351 )
1352 }
David Tolnay6702ade2017-12-30 23:38:15 -05001353 FnArg::SelfValue(_binding_0, ) => {
1354 FnArg::SelfValue (
Nika Layzell27726662017-10-24 23:16:35 -04001355 _visitor.fold_arg_self(_binding_0),
1356 )
1357 }
David Tolnay6702ade2017-12-30 23:38:15 -05001358 FnArg::Captured(_binding_0, ) => {
1359 FnArg::Captured (
Nika Layzell27726662017-10-24 23:16:35 -04001360 _visitor.fold_arg_captured(_binding_0),
1361 )
1362 }
David Tolnay6702ade2017-12-30 23:38:15 -05001363 FnArg::Inferred(_binding_0, ) => {
1364 FnArg::Inferred (
David Tolnay80ed55f2017-12-27 22:54:40 -05001365 _visitor.fold_pat(_binding_0),
1366 )
1367 }
David Tolnay6702ade2017-12-30 23:38:15 -05001368 FnArg::Ignored(_binding_0, ) => {
1369 FnArg::Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001370 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001371 )
1372 }
1373 }
1374}
1375# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001376pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001377 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001378 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001379 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001380 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001381 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001382 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001383 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001384 }
1385}
1386# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001387pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
Nika Layzell27726662017-10-24 23:16:35 -04001388 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001389 ForeignItem::Fn(_binding_0, ) => {
1390 ForeignItem::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001391 _visitor.fold_foreign_item_fn(_binding_0),
1392 )
1393 }
David Tolnay6702ade2017-12-30 23:38:15 -05001394 ForeignItem::Static(_binding_0, ) => {
1395 ForeignItem::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001396 _visitor.fold_foreign_item_static(_binding_0),
1397 )
1398 }
David Tolnay6702ade2017-12-30 23:38:15 -05001399 ForeignItem::Type(_binding_0, ) => {
1400 ForeignItem::Type (
David Tolnay199bcbb2017-11-12 10:33:52 -08001401 _visitor.fold_foreign_item_type(_binding_0),
1402 )
1403 }
David Tolnay6702ade2017-12-30 23:38:15 -05001404 ForeignItem::Verbatim(_binding_0, ) => {
1405 ForeignItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001406 _visitor.fold_foreign_item_verbatim(_binding_0),
1407 )
1408 }
Nika Layzell27726662017-10-24 23:16:35 -04001409 }
1410}
1411# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001412pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1413 ForeignItemFn {
1414 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1415 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001416 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001417 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001418 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001419 }
1420}
1421# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001422pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001423 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001424 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1425 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001426 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001427 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001428 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001429 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001430 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001431 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001432 }
1433}
David Tolnay199bcbb2017-11-12 10:33:52 -08001434# [ cfg ( feature = "full" ) ]
1435pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1436 ForeignItemType {
1437 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1438 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001439 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001440 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001441 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001442 }
1443}
David Tolnay2ae520a2017-12-29 11:19:50 -05001444# [ cfg ( feature = "full" ) ]
1445pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1446 ForeignItemVerbatim {
1447 tts: _i . tts,
1448 }
1449}
Nika Layzell27726662017-10-24 23:16:35 -04001450
Nika Layzellc08227a2017-12-04 16:30:17 -05001451pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
Nika Layzell357885a2017-12-04 15:47:07 -05001452 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001453 GenericArgument::Lifetime(_binding_0, ) => {
1454 GenericArgument::Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001455 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001456 )
1457 }
David Tolnay6702ade2017-12-30 23:38:15 -05001458 GenericArgument::Type(_binding_0, ) => {
1459 GenericArgument::Type (
Nika Layzell357885a2017-12-04 15:47:07 -05001460 _visitor.fold_type(_binding_0),
1461 )
1462 }
David Tolnay6702ade2017-12-30 23:38:15 -05001463 GenericArgument::Binding(_binding_0, ) => {
1464 GenericArgument::Binding (
David Tolnay506e43a2017-12-29 11:34:36 -05001465 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001466 )
1467 }
David Tolnay6702ade2017-12-30 23:38:15 -05001468 GenericArgument::Const(_binding_0, ) => {
1469 GenericArgument::Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001470 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001471 )
1472 }
Nika Layzell357885a2017-12-04 15:47:07 -05001473 }
1474}
David Tolnayd60cfec2017-12-29 00:21:38 -05001475# [ cfg ( feature = "full" ) ]
1476pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
David Tolnayd60cfec2017-12-29 00:21:38 -05001477 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001478 GenericMethodArgument::Type(_binding_0, ) => {
1479 GenericMethodArgument::Type (
David Tolnayd60cfec2017-12-29 00:21:38 -05001480 _visitor.fold_type(_binding_0),
1481 )
1482 }
David Tolnay6702ade2017-12-30 23:38:15 -05001483 GenericMethodArgument::Const(_binding_0, ) => {
1484 GenericMethodArgument::Const (
David Tolnayd60cfec2017-12-29 00:21:38 -05001485 _visitor.fold_expr(_binding_0),
1486 )
1487 }
1488 }
1489}
Nika Layzell357885a2017-12-04 15:47:07 -05001490
David Tolnayc2f1aba2017-11-12 20:29:22 -08001491pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
David Tolnayc2f1aba2017-11-12 20:29:22 -08001492 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001493 GenericParam::Lifetime(_binding_0, ) => {
1494 GenericParam::Lifetime (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001495 _visitor.fold_lifetime_def(_binding_0),
1496 )
1497 }
David Tolnay6702ade2017-12-30 23:38:15 -05001498 GenericParam::Type(_binding_0, ) => {
1499 GenericParam::Type (
David Tolnayc2f1aba2017-11-12 20:29:22 -08001500 _visitor.fold_type_param(_binding_0),
1501 )
1502 }
David Tolnay6702ade2017-12-30 23:38:15 -05001503 GenericParam::Const(_binding_0, ) => {
1504 GenericParam::Const (
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001505 _visitor.fold_const_param(_binding_0),
1506 )
1507 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001508 }
1509}
1510
Nika Layzella6f46c42017-10-26 15:26:16 -04001511pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001512 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001513 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001514 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001515 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001516 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001517 }
1518}
1519# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001520pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
Nika Layzell27726662017-10-24 23:16:35 -04001521 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001522 ImplItem::Const(_binding_0, ) => {
1523 ImplItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001524 _visitor.fold_impl_item_const(_binding_0),
1525 )
1526 }
David Tolnay6702ade2017-12-30 23:38:15 -05001527 ImplItem::Method(_binding_0, ) => {
1528 ImplItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04001529 _visitor.fold_impl_item_method(_binding_0),
1530 )
1531 }
David Tolnay6702ade2017-12-30 23:38:15 -05001532 ImplItem::Type(_binding_0, ) => {
1533 ImplItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04001534 _visitor.fold_impl_item_type(_binding_0),
1535 )
1536 }
David Tolnay6702ade2017-12-30 23:38:15 -05001537 ImplItem::Macro(_binding_0, ) => {
1538 ImplItem::Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001539 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001540 )
1541 }
David Tolnay6702ade2017-12-30 23:38:15 -05001542 ImplItem::Verbatim(_binding_0, ) => {
1543 ImplItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001544 _visitor.fold_impl_item_verbatim(_binding_0),
1545 )
1546 }
Nika Layzell27726662017-10-24 23:16:35 -04001547 }
1548}
1549# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001550pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1551 ImplItemConst {
1552 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1553 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001554 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001555 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001556 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001557 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001558 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001559 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001560 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001561 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001562 }
1563}
1564# [ cfg ( feature = "full" ) ]
1565pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1566 ImplItemMacro {
1567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1568 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001569 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001570 }
1571}
1572# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001573pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001574 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001575 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001576 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001577 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001578 sig: _visitor.fold_method_sig(_i . sig),
1579 block: _visitor.fold_block(_i . block),
1580 }
1581}
1582# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001583pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001584 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001585 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001586 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001587 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001588 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001589 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001590 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001592 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001594 }
1595}
David Tolnay2ae520a2017-12-29 11:19:50 -05001596# [ cfg ( feature = "full" ) ]
1597pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1598 ImplItemVerbatim {
1599 tts: _i . tts,
1600 }
1601}
David Tolnay14982012017-12-29 00:49:51 -05001602
David Tolnay85b69a42017-12-27 20:43:10 -05001603pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1604 Index {
1605 index: _i . index,
1606 span: _visitor.fold_span(_i . span),
1607 }
1608}
1609# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001610pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
Nika Layzell27726662017-10-24 23:16:35 -04001611 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001612 Item::ExternCrate(_binding_0, ) => {
1613 Item::ExternCrate (
Nika Layzell27726662017-10-24 23:16:35 -04001614 _visitor.fold_item_extern_crate(_binding_0),
1615 )
1616 }
David Tolnay6702ade2017-12-30 23:38:15 -05001617 Item::Use(_binding_0, ) => {
1618 Item::Use (
Nika Layzell27726662017-10-24 23:16:35 -04001619 _visitor.fold_item_use(_binding_0),
1620 )
1621 }
David Tolnay6702ade2017-12-30 23:38:15 -05001622 Item::Static(_binding_0, ) => {
1623 Item::Static (
Nika Layzell27726662017-10-24 23:16:35 -04001624 _visitor.fold_item_static(_binding_0),
1625 )
1626 }
David Tolnay6702ade2017-12-30 23:38:15 -05001627 Item::Const(_binding_0, ) => {
1628 Item::Const (
Nika Layzell27726662017-10-24 23:16:35 -04001629 _visitor.fold_item_const(_binding_0),
1630 )
1631 }
David Tolnay6702ade2017-12-30 23:38:15 -05001632 Item::Fn(_binding_0, ) => {
1633 Item::Fn (
Nika Layzell27726662017-10-24 23:16:35 -04001634 _visitor.fold_item_fn(_binding_0),
1635 )
1636 }
David Tolnay6702ade2017-12-30 23:38:15 -05001637 Item::Mod(_binding_0, ) => {
1638 Item::Mod (
Nika Layzell27726662017-10-24 23:16:35 -04001639 _visitor.fold_item_mod(_binding_0),
1640 )
1641 }
David Tolnay6702ade2017-12-30 23:38:15 -05001642 Item::ForeignMod(_binding_0, ) => {
1643 Item::ForeignMod (
Nika Layzell27726662017-10-24 23:16:35 -04001644 _visitor.fold_item_foreign_mod(_binding_0),
1645 )
1646 }
David Tolnay6702ade2017-12-30 23:38:15 -05001647 Item::Type(_binding_0, ) => {
1648 Item::Type (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001649 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001650 )
1651 }
David Tolnay6702ade2017-12-30 23:38:15 -05001652 Item::Enum(_binding_0, ) => {
1653 Item::Enum (
Nika Layzell27726662017-10-24 23:16:35 -04001654 _visitor.fold_item_enum(_binding_0),
1655 )
1656 }
David Tolnay6702ade2017-12-30 23:38:15 -05001657 Item::Struct(_binding_0, ) => {
1658 Item::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04001659 _visitor.fold_item_struct(_binding_0),
1660 )
1661 }
David Tolnay6702ade2017-12-30 23:38:15 -05001662 Item::Union(_binding_0, ) => {
1663 Item::Union (
Nika Layzell27726662017-10-24 23:16:35 -04001664 _visitor.fold_item_union(_binding_0),
1665 )
1666 }
David Tolnay6702ade2017-12-30 23:38:15 -05001667 Item::Trait(_binding_0, ) => {
1668 Item::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04001669 _visitor.fold_item_trait(_binding_0),
1670 )
1671 }
David Tolnay6702ade2017-12-30 23:38:15 -05001672 Item::Impl(_binding_0, ) => {
1673 Item::Impl (
Nika Layzell27726662017-10-24 23:16:35 -04001674 _visitor.fold_item_impl(_binding_0),
1675 )
1676 }
David Tolnay6702ade2017-12-30 23:38:15 -05001677 Item::Macro(_binding_0, ) => {
1678 Item::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08001679 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001680 )
1681 }
David Tolnay6702ade2017-12-30 23:38:15 -05001682 Item::Macro2(_binding_0, ) => {
1683 Item::Macro2 (
David Tolnay500d8322017-12-18 00:32:51 -08001684 _visitor.fold_item_macro2(_binding_0),
1685 )
1686 }
David Tolnay6702ade2017-12-30 23:38:15 -05001687 Item::Verbatim(_binding_0, ) => {
1688 Item::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05001689 _visitor.fold_item_verbatim(_binding_0),
1690 )
1691 }
Nika Layzell27726662017-10-24 23:16:35 -04001692 }
1693}
1694# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001695pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1696 ItemConst {
1697 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1698 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001699 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001700 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001701 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001702 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001703 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001704 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001705 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001706 }
1707}
1708# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001709pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1710 ItemEnum {
1711 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1712 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001713 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001714 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001715 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001716 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001717 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1718 }
1719}
1720# [ cfg ( feature = "full" ) ]
1721pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1722 ItemExternCrate {
1723 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1724 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001725 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1726 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001727 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001728 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001729 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001730 _visitor.fold_ident(( it ) . 1),
1731 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001732 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001733 }
1734}
1735# [ cfg ( feature = "full" ) ]
1736pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1737 ItemFn {
1738 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1739 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001740 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001741 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001742 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001743 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001744 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001745 block: Box::new(_visitor.fold_block(* _i . block)),
1746 }
1747}
1748# [ cfg ( feature = "full" ) ]
1749pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1750 ItemForeignMod {
1751 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1752 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001753 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1755 }
1756}
1757# [ cfg ( feature = "full" ) ]
1758pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1759 ItemImpl {
1760 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001761 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001762 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001763 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001764 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001765 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001766 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001767 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001768 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001769 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001770 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001771 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001772 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1773 }
1774}
1775# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001776pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1777 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001778 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001779 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001780 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001781 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001782 }
1783}
1784# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001785pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1786 ItemMacro2 {
1787 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1788 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001789 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001790 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001791 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001792 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001793 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001794 body: _i . body,
1795 }
1796}
1797# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001798pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001799 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001800 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001801 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001802 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001803 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001804 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001805 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001806 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1807 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001809 }
1810}
1811# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001812pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001813 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001814 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001815 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001816 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001817 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001818 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001819 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001820 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001821 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001822 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001823 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001824 }
1825}
1826# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001827pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001828 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001829 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001830 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001832 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001833 generics: _visitor.fold_generics(_i . generics),
1834 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001835 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001836 }
1837}
1838# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001839pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001840 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001841 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001842 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001843 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001844 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1845 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001846 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001847 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001848 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001849 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001850 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001851 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1852 }
1853}
1854# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001855pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1856 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001857 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001858 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001860 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001861 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001862 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001863 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001865 }
1866}
1867# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001868pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001869 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001870 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001871 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001872 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001873 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001874 generics: _visitor.fold_generics(_i . generics),
1875 data: _visitor.fold_variant_data(_i . data),
1876 }
1877}
1878# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001879pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001880 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001881 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001882 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1884 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001885 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1886 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001888 }
1889}
David Tolnay2ae520a2017-12-29 11:19:50 -05001890# [ cfg ( feature = "full" ) ]
1891pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1892 ItemVerbatim {
1893 tts: _i . tts,
1894 }
1895}
David Tolnaybcd498f2017-12-29 12:02:33 -05001896# [ cfg ( feature = "full" ) ]
1897pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1898 Label {
1899 name: _visitor.fold_lifetime(_i . name),
1900 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1901 }
1902}
Nika Layzell27726662017-10-24 23:16:35 -04001903
Nika Layzella6f46c42017-10-26 15:26:16 -04001904pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001905 LifetimeDef {
1906 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001907 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001908 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001909 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1910 }
1911}
1912
1913pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1914 Lit {
1915 value: _i . value,
1916 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001917 }
1918}
1919# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001920pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001921 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001922 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001923 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1924 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05001925 ty: (_i . ty).map(|it| { (
1926 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
1927 Box::new(_visitor.fold_type(* ( it ) . 1)),
1928 ) }),
1929 init: (_i . init).map(|it| { (
1930 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
1931 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1932 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001933 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001934 }
1935}
Nika Layzell27726662017-10-24 23:16:35 -04001936
David Tolnaydecf28d2017-11-11 11:56:45 -08001937pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1938 Macro {
1939 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001940 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05001941 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
1942 tts: _i . tts,
1943 }
1944}
1945
1946pub fn fold_macro_delimiter<V: Folder + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
David Tolnayab919512017-12-30 23:31:51 -05001947 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001948 MacroDelimiter::Paren(_binding_0, ) => {
1949 MacroDelimiter::Paren (
David Tolnayab919512017-12-30 23:31:51 -05001950 Paren(tokens_helper(_visitor, &(_binding_0).0)),
1951 )
1952 }
David Tolnay6702ade2017-12-30 23:38:15 -05001953 MacroDelimiter::Brace(_binding_0, ) => {
1954 MacroDelimiter::Brace (
David Tolnayab919512017-12-30 23:31:51 -05001955 Brace(tokens_helper(_visitor, &(_binding_0).0)),
1956 )
1957 }
David Tolnay6702ade2017-12-30 23:38:15 -05001958 MacroDelimiter::Bracket(_binding_0, ) => {
1959 MacroDelimiter::Bracket (
David Tolnayab919512017-12-30 23:31:51 -05001960 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
1961 )
1962 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001963 }
1964}
David Tolnay14982012017-12-29 00:49:51 -05001965
David Tolnay85b69a42017-12-27 20:43:10 -05001966pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
David Tolnay85b69a42017-12-27 20:43:10 -05001967 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001968 Member::Named(_binding_0, ) => {
1969 Member::Named (
David Tolnay85b69a42017-12-27 20:43:10 -05001970 _visitor.fold_ident(_binding_0),
1971 )
1972 }
David Tolnay6702ade2017-12-30 23:38:15 -05001973 Member::Unnamed(_binding_0, ) => {
1974 Member::Unnamed (
David Tolnay85b69a42017-12-27 20:43:10 -05001975 _visitor.fold_index(_binding_0),
1976 )
1977 }
1978 }
1979}
David Tolnaydecf28d2017-11-11 11:56:45 -08001980
Nika Layzella6f46c42017-10-26 15:26:16 -04001981pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001982 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05001983 MetaItem::Term(_binding_0, ) => {
1984 MetaItem::Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001985 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001986 )
1987 }
David Tolnay6702ade2017-12-30 23:38:15 -05001988 MetaItem::List(_binding_0, ) => {
1989 MetaItem::List (
Nika Layzell27726662017-10-24 23:16:35 -04001990 _visitor.fold_meta_item_list(_binding_0),
1991 )
1992 }
David Tolnay6702ade2017-12-30 23:38:15 -05001993 MetaItem::NameValue(_binding_0, ) => {
1994 MetaItem::NameValue (
Nika Layzell27726662017-10-24 23:16:35 -04001995 _visitor.fold_meta_name_value(_binding_0),
1996 )
1997 }
1998 }
1999}
2000
Nika Layzella6f46c42017-10-26 15:26:16 -04002001pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002002 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002003 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002004 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002005 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2006 }
2007}
2008
Nika Layzella6f46c42017-10-26 15:26:16 -04002009pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002010 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002011 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002012 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002013 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002014 }
2015}
2016# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002017pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002018 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002019 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002020 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002021 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002022 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002023 decl: _visitor.fold_fn_decl(_i . decl),
2024 }
2025}
David Tolnayd60cfec2017-12-29 00:21:38 -05002026# [ cfg ( feature = "full" ) ]
2027pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2028 MethodTurbofish {
2029 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2030 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2031 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2032 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2033 }
2034}
Nika Layzell27726662017-10-24 23:16:35 -04002035
Nika Layzella6f46c42017-10-26 15:26:16 -04002036pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002037 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002038 NestedMetaItem::MetaItem(_binding_0, ) => {
2039 NestedMetaItem::MetaItem (
Nika Layzell27726662017-10-24 23:16:35 -04002040 _visitor.fold_meta_item(_binding_0),
2041 )
2042 }
David Tolnay6702ade2017-12-30 23:38:15 -05002043 NestedMetaItem::Literal(_binding_0, ) => {
2044 NestedMetaItem::Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002045 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002046 )
2047 }
2048 }
2049}
2050
Nika Layzellc08227a2017-12-04 16:30:17 -05002051pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2052 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002053 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002054 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002055 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002056 }
2057}
2058# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002059pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002060 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002061 Pat::Wild(_binding_0, ) => {
2062 Pat::Wild (
Nika Layzell27726662017-10-24 23:16:35 -04002063 _visitor.fold_pat_wild(_binding_0),
2064 )
2065 }
David Tolnay6702ade2017-12-30 23:38:15 -05002066 Pat::Ident(_binding_0, ) => {
2067 Pat::Ident (
Nika Layzell27726662017-10-24 23:16:35 -04002068 _visitor.fold_pat_ident(_binding_0),
2069 )
2070 }
David Tolnay6702ade2017-12-30 23:38:15 -05002071 Pat::Struct(_binding_0, ) => {
2072 Pat::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002073 _visitor.fold_pat_struct(_binding_0),
2074 )
2075 }
David Tolnay6702ade2017-12-30 23:38:15 -05002076 Pat::TupleStruct(_binding_0, ) => {
2077 Pat::TupleStruct (
Nika Layzell27726662017-10-24 23:16:35 -04002078 _visitor.fold_pat_tuple_struct(_binding_0),
2079 )
2080 }
David Tolnay6702ade2017-12-30 23:38:15 -05002081 Pat::Path(_binding_0, ) => {
2082 Pat::Path (
Nika Layzell27726662017-10-24 23:16:35 -04002083 _visitor.fold_pat_path(_binding_0),
2084 )
2085 }
David Tolnay6702ade2017-12-30 23:38:15 -05002086 Pat::Tuple(_binding_0, ) => {
2087 Pat::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002088 _visitor.fold_pat_tuple(_binding_0),
2089 )
2090 }
David Tolnay6702ade2017-12-30 23:38:15 -05002091 Pat::Box(_binding_0, ) => {
2092 Pat::Box (
Nika Layzell27726662017-10-24 23:16:35 -04002093 _visitor.fold_pat_box(_binding_0),
2094 )
2095 }
David Tolnay6702ade2017-12-30 23:38:15 -05002096 Pat::Ref(_binding_0, ) => {
2097 Pat::Ref (
Nika Layzell27726662017-10-24 23:16:35 -04002098 _visitor.fold_pat_ref(_binding_0),
2099 )
2100 }
David Tolnay6702ade2017-12-30 23:38:15 -05002101 Pat::Lit(_binding_0, ) => {
2102 Pat::Lit (
Nika Layzell27726662017-10-24 23:16:35 -04002103 _visitor.fold_pat_lit(_binding_0),
2104 )
2105 }
David Tolnay6702ade2017-12-30 23:38:15 -05002106 Pat::Range(_binding_0, ) => {
2107 Pat::Range (
Nika Layzell27726662017-10-24 23:16:35 -04002108 _visitor.fold_pat_range(_binding_0),
2109 )
2110 }
David Tolnay6702ade2017-12-30 23:38:15 -05002111 Pat::Slice(_binding_0, ) => {
2112 Pat::Slice (
Nika Layzell27726662017-10-24 23:16:35 -04002113 _visitor.fold_pat_slice(_binding_0),
2114 )
2115 }
David Tolnay6702ade2017-12-30 23:38:15 -05002116 Pat::Macro(_binding_0, ) => {
2117 Pat::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002118 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002119 )
2120 }
David Tolnay6702ade2017-12-30 23:38:15 -05002121 Pat::Verbatim(_binding_0, ) => {
2122 Pat::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002123 _visitor.fold_pat_verbatim(_binding_0),
2124 )
2125 }
Nika Layzell27726662017-10-24 23:16:35 -04002126 }
2127}
2128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002129pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002130 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002131 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002132 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002133 }
2134}
2135# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002136pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002137 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002138 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2139 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002140 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002141 subpat: (_i . subpat).map(|it| { (
2142 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2143 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2144 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
2146}
2147# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002149 PatLit {
2150 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2151 }
2152}
2153# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002154pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2155 PatMacro {
2156 mac: _visitor.fold_macro(_i . mac),
2157 }
2158}
2159# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002160pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002161 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002162 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002163 path: _visitor.fold_path(_i . path),
2164 }
2165}
2166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002167pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002168 PatRange {
2169 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002170 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002171 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002172 }
2173}
2174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002175pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002176 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002177 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002178 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002179 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
2181}
2182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002183pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002184 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002185 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002186 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002187 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002188 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002189 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002190 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002191 }
2192}
2193# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002194pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002195 PatStruct {
2196 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002197 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002198 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002199 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002200 }
2201}
2202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002203pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002204 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002205 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002206 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002207 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002208 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2209 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002210 }
2211}
2212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002213pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002214 PatTupleStruct {
2215 path: _visitor.fold_path(_i . path),
2216 pat: _visitor.fold_pat_tuple(_i . pat),
2217 }
2218}
2219# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002220pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2221 PatVerbatim {
2222 tts: _i . tts,
2223 }
2224}
2225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002226pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002227 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002228 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002229 }
2230}
2231
Nika Layzella6f46c42017-10-26 15:26:16 -04002232pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002233 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002234 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002235 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2236 }
2237}
Nika Layzellc08227a2017-12-04 16:30:17 -05002238
2239pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
Nika Layzellc08227a2017-12-04 16:30:17 -05002240 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002241 PathArguments::None => { PathArguments::None }
2242 PathArguments::AngleBracketed(_binding_0, ) => {
2243 PathArguments::AngleBracketed (
Nika Layzellc08227a2017-12-04 16:30:17 -05002244 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2245 )
2246 }
David Tolnay6702ade2017-12-30 23:38:15 -05002247 PathArguments::Parenthesized(_binding_0, ) => {
2248 PathArguments::Parenthesized (
Nika Layzellc08227a2017-12-04 16:30:17 -05002249 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2250 )
2251 }
2252 }
2253}
Nika Layzell27726662017-10-24 23:16:35 -04002254
Nika Layzella6f46c42017-10-26 15:26:16 -04002255pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002256 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002257 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002258 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002259 }
2260}
Nika Layzell27726662017-10-24 23:16:35 -04002261
Nika Layzella6f46c42017-10-26 15:26:16 -04002262pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002263 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002264 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002265 trait_ref: _visitor.fold_path(_i . trait_ref),
2266 }
2267}
2268
Nika Layzella6f46c42017-10-26 15:26:16 -04002269pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002270 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002271 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002272 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002273 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002274 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2275 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002276 }
2277}
2278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002279pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002280 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002281 RangeLimits::HalfOpen(_binding_0, ) => {
2282 RangeLimits::HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002283 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002284 )
2285 }
David Tolnay6702ade2017-12-30 23:38:15 -05002286 RangeLimits::Closed(_binding_0, ) => {
2287 RangeLimits::Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002288 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002289 )
2290 }
2291 }
2292}
David Tolnayf93b90d2017-11-11 19:21:26 -08002293
2294pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
David Tolnayf93b90d2017-11-11 19:21:26 -08002295 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002296 ReturnType::Default => { ReturnType::Default }
2297 ReturnType::Type(_binding_0, _binding_1, ) => {
2298 ReturnType::Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002299 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2300 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002301 )
2302 }
2303 }
2304}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002305
2306pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2307 _i
2308}
Nika Layzell27726662017-10-24 23:16:35 -04002309# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002310pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002311 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002312 Stmt::Local(_binding_0, ) => {
2313 Stmt::Local (
Nika Layzell27726662017-10-24 23:16:35 -04002314 Box::new(_visitor.fold_local(* _binding_0)),
2315 )
2316 }
David Tolnay6702ade2017-12-30 23:38:15 -05002317 Stmt::Item(_binding_0, ) => {
2318 Stmt::Item (
Nika Layzell27726662017-10-24 23:16:35 -04002319 Box::new(_visitor.fold_item(* _binding_0)),
2320 )
2321 }
David Tolnay6702ade2017-12-30 23:38:15 -05002322 Stmt::Expr(_binding_0, ) => {
2323 Stmt::Expr (
Nika Layzell27726662017-10-24 23:16:35 -04002324 Box::new(_visitor.fold_expr(* _binding_0)),
2325 )
2326 }
David Tolnay6702ade2017-12-30 23:38:15 -05002327 Stmt::Semi(_binding_0, _binding_1, ) => {
2328 Stmt::Semi (
Nika Layzell27726662017-10-24 23:16:35 -04002329 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002330 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002331 )
2332 }
Nika Layzell27726662017-10-24 23:16:35 -04002333 }
2334}
2335
Nika Layzella6f46c42017-10-26 15:26:16 -04002336pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002337 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002338 TraitBoundModifier::None => { TraitBoundModifier::None }
2339 TraitBoundModifier::Maybe(_binding_0, ) => {
2340 TraitBoundModifier::Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002341 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002342 )
2343 }
2344 }
2345}
2346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002347pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
Nika Layzell27726662017-10-24 23:16:35 -04002348 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002349 TraitItem::Const(_binding_0, ) => {
2350 TraitItem::Const (
Nika Layzell27726662017-10-24 23:16:35 -04002351 _visitor.fold_trait_item_const(_binding_0),
2352 )
2353 }
David Tolnay6702ade2017-12-30 23:38:15 -05002354 TraitItem::Method(_binding_0, ) => {
2355 TraitItem::Method (
Nika Layzell27726662017-10-24 23:16:35 -04002356 _visitor.fold_trait_item_method(_binding_0),
2357 )
2358 }
David Tolnay6702ade2017-12-30 23:38:15 -05002359 TraitItem::Type(_binding_0, ) => {
2360 TraitItem::Type (
Nika Layzell27726662017-10-24 23:16:35 -04002361 _visitor.fold_trait_item_type(_binding_0),
2362 )
2363 }
David Tolnay6702ade2017-12-30 23:38:15 -05002364 TraitItem::Macro(_binding_0, ) => {
2365 TraitItem::Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002366 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002367 )
2368 }
David Tolnay6702ade2017-12-30 23:38:15 -05002369 TraitItem::Verbatim(_binding_0, ) => {
2370 TraitItem::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002371 _visitor.fold_trait_item_verbatim(_binding_0),
2372 )
2373 }
Nika Layzell27726662017-10-24 23:16:35 -04002374 }
2375}
2376# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002377pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2378 TraitItemConst {
2379 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002380 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002381 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002382 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002383 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002384 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002385 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002386 _visitor.fold_expr(( it ) . 1),
2387 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002388 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002389 }
2390}
2391# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002392pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2393 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002394 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002395 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002396 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002397 }
2398}
2399# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002400pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002401 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002402 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002403 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002404 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002405 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002406 }
2407}
2408# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002409pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002410 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002411 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002412 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002413 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002414 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002415 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002416 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002417 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002418 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002419 _visitor.fold_type(( it ) . 1),
2420 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002422 }
2423}
David Tolnay2ae520a2017-12-29 11:19:50 -05002424# [ cfg ( feature = "full" ) ]
2425pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2426 TraitItemVerbatim {
2427 tts: _i . tts,
2428 }
2429}
Nika Layzell27726662017-10-24 23:16:35 -04002430
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002431pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
Nika Layzell27726662017-10-24 23:16:35 -04002432 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002433 Type::Slice(_binding_0, ) => {
2434 Type::Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002435 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
David Tolnay6702ade2017-12-30 23:38:15 -05002438 Type::Array(_binding_0, ) => {
2439 Type::Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002440 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002441 )
2442 }
David Tolnay6702ade2017-12-30 23:38:15 -05002443 Type::Ptr(_binding_0, ) => {
2444 Type::Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002445 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
David Tolnay6702ade2017-12-30 23:38:15 -05002448 Type::Reference(_binding_0, ) => {
2449 Type::Reference (
David Tolnay0a89b4d2017-11-13 00:55:45 -08002450 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002451 )
2452 }
David Tolnay6702ade2017-12-30 23:38:15 -05002453 Type::BareFn(_binding_0, ) => {
2454 Type::BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002456 )
2457 }
David Tolnay6702ade2017-12-30 23:38:15 -05002458 Type::Never(_binding_0, ) => {
2459 Type::Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002460 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002461 )
2462 }
David Tolnay6702ade2017-12-30 23:38:15 -05002463 Type::Tuple(_binding_0, ) => {
2464 Type::Tuple (
David Tolnay05362582017-12-26 01:33:57 -05002465 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002466 )
2467 }
David Tolnay6702ade2017-12-30 23:38:15 -05002468 Type::Path(_binding_0, ) => {
2469 Type::Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002471 )
2472 }
David Tolnay6702ade2017-12-30 23:38:15 -05002473 Type::TraitObject(_binding_0, ) => {
2474 Type::TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
David Tolnay6702ade2017-12-30 23:38:15 -05002478 Type::ImplTrait(_binding_0, ) => {
2479 Type::ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
David Tolnay6702ade2017-12-30 23:38:15 -05002483 Type::Paren(_binding_0, ) => {
2484 Type::Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002486 )
2487 }
David Tolnay6702ade2017-12-30 23:38:15 -05002488 Type::Group(_binding_0, ) => {
2489 Type::Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
David Tolnay6702ade2017-12-30 23:38:15 -05002493 Type::Infer(_binding_0, ) => {
2494 Type::Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002495 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002496 )
2497 }
David Tolnay6702ade2017-12-30 23:38:15 -05002498 Type::Macro(_binding_0, ) => {
2499 Type::Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002500 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002501 )
2502 }
David Tolnay6702ade2017-12-30 23:38:15 -05002503 Type::Verbatim(_binding_0, ) => {
2504 Type::Verbatim (
David Tolnay2ae520a2017-12-29 11:19:50 -05002505 _visitor.fold_type_verbatim(_binding_0),
2506 )
2507 }
Nika Layzell27726662017-10-24 23:16:35 -04002508 }
2509}
2510
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002511pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2512 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002513 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002514 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002515 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002516 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002517 }
2518}
2519
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002520pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2521 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002522 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2523 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2524 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2525 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2526 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2527 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2528 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2529 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002530 }
2531}
2532
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2534 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002535 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002536 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002537 }
2538}
2539
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002540pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2541 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002542 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002544 }
2545}
2546
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002547pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2548 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002549 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002550 }
2551}
2552
David Tolnay323279a2017-12-29 11:26:32 -05002553pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2554 TypeMacro {
2555 mac: _visitor.fold_macro(_i . mac),
2556 }
2557}
2558
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002559pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2560 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002562 }
2563}
2564
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2566 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002568 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002569 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002571 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002573 }
2574}
2575
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002576pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
Nika Layzell27726662017-10-24 23:16:35 -04002577 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002578 TypeParamBound::Trait(_binding_0, _binding_1, ) => {
2579 TypeParamBound::Trait (
Nika Layzell27726662017-10-24 23:16:35 -04002580 _visitor.fold_poly_trait_ref(_binding_0),
2581 _visitor.fold_trait_bound_modifier(_binding_1),
2582 )
2583 }
David Tolnay6702ade2017-12-30 23:38:15 -05002584 TypeParamBound::Region(_binding_0, ) => {
2585 TypeParamBound::Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002586 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002587 )
2588 }
2589 }
2590}
2591
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002592pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2593 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002594 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002595 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002596 }
2597}
2598
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002599pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2600 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002601 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002602 path: _visitor.fold_path(_i . path),
2603 }
2604}
2605
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002606pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2607 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002608 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2609 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002610 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2611 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002612 }
2613}
2614
David Tolnay0a89b4d2017-11-13 00:55:45 -08002615pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2616 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002617 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002618 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002619 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2620 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002621 }
2622}
2623
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002624pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2625 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002626 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002627 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002628 }
2629}
2630
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2632 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002633 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002634 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002635 }
2636}
2637
David Tolnay05362582017-12-26 01:33:57 -05002638pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2639 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002640 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002641 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002642 }
2643}
2644
David Tolnay2ae520a2017-12-29 11:19:50 -05002645pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2646 TypeVerbatim {
2647 tts: _i . tts,
2648 }
2649}
2650
Nika Layzella6f46c42017-10-26 15:26:16 -04002651pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002652 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002653 UnOp::Deref(_binding_0, ) => {
2654 UnOp::Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002655 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002656 )
2657 }
David Tolnay6702ade2017-12-30 23:38:15 -05002658 UnOp::Not(_binding_0, ) => {
2659 UnOp::Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002660 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002661 )
2662 }
David Tolnay6702ade2017-12-30 23:38:15 -05002663 UnOp::Neg(_binding_0, ) => {
2664 UnOp::Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002665 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002666 )
2667 }
2668 }
2669}
David Tolnay5f332a92017-12-26 00:42:45 -05002670# [ cfg ( feature = "full" ) ]
2671pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2672 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002673 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002674 }
2675}
2676# [ cfg ( feature = "full" ) ]
2677pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2678 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002679 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002680 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2681 }
2682}
2683# [ cfg ( feature = "full" ) ]
2684pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2685 UsePath {
2686 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002687 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002688 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002689 _visitor.fold_ident(( it ) . 1),
2690 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002691 }
2692}
2693# [ cfg ( feature = "full" ) ]
2694pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
David Tolnay5f332a92017-12-26 00:42:45 -05002695 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002696 UseTree::Path(_binding_0, ) => {
2697 UseTree::Path (
David Tolnay5f332a92017-12-26 00:42:45 -05002698 _visitor.fold_use_path(_binding_0),
2699 )
2700 }
David Tolnay6702ade2017-12-30 23:38:15 -05002701 UseTree::Glob(_binding_0, ) => {
2702 UseTree::Glob (
David Tolnay5f332a92017-12-26 00:42:45 -05002703 _visitor.fold_use_glob(_binding_0),
2704 )
2705 }
David Tolnay6702ade2017-12-30 23:38:15 -05002706 UseTree::List(_binding_0, ) => {
2707 UseTree::List (
David Tolnay5f332a92017-12-26 00:42:45 -05002708 _visitor.fold_use_list(_binding_0),
2709 )
2710 }
2711 }
2712}
Nika Layzell27726662017-10-24 23:16:35 -04002713
Nika Layzella6f46c42017-10-26 15:26:16 -04002714pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002715 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002716 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002717 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002718 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002719 discriminant: (_i . discriminant).map(|it| { (
2720 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2721 _visitor.fold_expr(( it ) . 1),
2722 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002723 }
2724}
2725
Nika Layzella6f46c42017-10-26 15:26:16 -04002726pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002727 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002728 VariantData::Struct(_binding_0, _binding_1, ) => {
2729 VariantData::Struct (
Nika Layzell27726662017-10-24 23:16:35 -04002730 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002731 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002732 )
2733 }
David Tolnay6702ade2017-12-30 23:38:15 -05002734 VariantData::Tuple(_binding_0, _binding_1, ) => {
2735 VariantData::Tuple (
Nika Layzell27726662017-10-24 23:16:35 -04002736 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002737 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002738 )
2739 }
David Tolnay6702ade2017-12-30 23:38:15 -05002740 VariantData::Unit => { VariantData::Unit }
Nika Layzell27726662017-10-24 23:16:35 -04002741 }
2742}
Nika Layzell27726662017-10-24 23:16:35 -04002743
Nika Layzella6f46c42017-10-26 15:26:16 -04002744pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002745 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002746 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002747 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002748 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002749 }
2750}
2751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002753 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002755 }
2756}
2757
Nika Layzella6f46c42017-10-26 15:26:16 -04002758pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002759 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002760 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002761 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002762 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002763 path: Box::new(_visitor.fold_path(* _i . path)),
2764 }
2765}
2766
Nika Layzella6f46c42017-10-26 15:26:16 -04002767pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002768 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002769 Visibility::Public(_binding_0, ) => {
2770 Visibility::Public (
Nika Layzell27726662017-10-24 23:16:35 -04002771 _visitor.fold_vis_public(_binding_0),
2772 )
2773 }
David Tolnay6702ade2017-12-30 23:38:15 -05002774 Visibility::Crate(_binding_0, ) => {
2775 Visibility::Crate (
Nika Layzell27726662017-10-24 23:16:35 -04002776 _visitor.fold_vis_crate(_binding_0),
2777 )
2778 }
David Tolnay6702ade2017-12-30 23:38:15 -05002779 Visibility::Restricted(_binding_0, ) => {
2780 Visibility::Restricted (
Nika Layzell27726662017-10-24 23:16:35 -04002781 _visitor.fold_vis_restricted(_binding_0),
2782 )
2783 }
David Tolnay6702ade2017-12-30 23:38:15 -05002784 Visibility::Inherited => { Visibility::Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002785 }
2786}
2787
Nika Layzella6f46c42017-10-26 15:26:16 -04002788pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002789 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002790 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002791 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002792 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002793 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002794 }
2795}
2796
Nika Layzella6f46c42017-10-26 15:26:16 -04002797pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002798 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002799 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002800 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2801 }
2802}
2803
Nika Layzella6f46c42017-10-26 15:26:16 -04002804pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002805 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002806 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002807 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002808 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002809 }
2810}
2811
Nika Layzella6f46c42017-10-26 15:26:16 -04002812pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002813 match _i {
David Tolnay6702ade2017-12-30 23:38:15 -05002814 WherePredicate::BoundPredicate(_binding_0, ) => {
2815 WherePredicate::BoundPredicate (
Nika Layzell27726662017-10-24 23:16:35 -04002816 _visitor.fold_where_bound_predicate(_binding_0),
2817 )
2818 }
David Tolnay6702ade2017-12-30 23:38:15 -05002819 WherePredicate::RegionPredicate(_binding_0, ) => {
2820 WherePredicate::RegionPredicate (
Nika Layzell27726662017-10-24 23:16:35 -04002821 _visitor.fold_where_region_predicate(_binding_0),
2822 )
2823 }
David Tolnay6702ade2017-12-30 23:38:15 -05002824 WherePredicate::EqPredicate(_binding_0, ) => {
2825 WherePredicate::EqPredicate (
Nika Layzell27726662017-10-24 23:16:35 -04002826 _visitor.fold_where_eq_predicate(_binding_0),
2827 )
2828 }
2829 }
2830}
2831
Nika Layzella6f46c42017-10-26 15:26:16 -04002832pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002833 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002834 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002835 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002836 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002837 }
2838}
2839