blob: 3faa53ce2acbe8240612f5c9c7426299295620f4 [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 use ::AttrStyle::*;
470 match _i {
471 Outer => { Outer }
472 Inner(_binding_0, ) => {
473 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400475 )
476 }
477 }
478}
479
Nika Layzella6f46c42017-10-26 15:26:16 -0400480pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400481 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500482 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500483 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500484 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400485 path: _visitor.fold_path(_i . path),
486 tts: _i . tts,
487 is_sugared_doc: _i . is_sugared_doc,
488 }
489}
490
Nika Layzella6f46c42017-10-26 15:26:16 -0400491pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400492 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500493 name: (_i . name).map(|it| { (
494 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500495 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500496 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800497 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400498 }
499}
500
Nika Layzella6f46c42017-10-26 15:26:16 -0400501pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400502 use ::BareFnArgName::*;
503 match _i {
504 Named(_binding_0, ) => {
505 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500506 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400507 )
508 }
509 Wild(_binding_0, ) => {
510 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500511 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400512 )
513 }
514 }
515}
516
Nika Layzella6f46c42017-10-26 15:26:16 -0400517pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400518 use ::BinOp::*;
519 match _i {
520 Add(_binding_0, ) => {
521 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500522 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400523 )
524 }
525 Sub(_binding_0, ) => {
526 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500527 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400528 )
529 }
530 Mul(_binding_0, ) => {
531 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500532 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400533 )
534 }
535 Div(_binding_0, ) => {
536 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500537 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400538 )
539 }
540 Rem(_binding_0, ) => {
541 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500542 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400543 )
544 }
545 And(_binding_0, ) => {
546 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500547 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400548 )
549 }
550 Or(_binding_0, ) => {
551 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500552 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400553 )
554 }
555 BitXor(_binding_0, ) => {
556 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500557 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400558 )
559 }
560 BitAnd(_binding_0, ) => {
561 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500562 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400563 )
564 }
565 BitOr(_binding_0, ) => {
566 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500567 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400568 )
569 }
570 Shl(_binding_0, ) => {
571 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500572 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400573 )
574 }
575 Shr(_binding_0, ) => {
576 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500577 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400578 )
579 }
580 Eq(_binding_0, ) => {
581 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500582 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400583 )
584 }
585 Lt(_binding_0, ) => {
586 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500587 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400588 )
589 }
590 Le(_binding_0, ) => {
591 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500592 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400593 )
594 }
595 Ne(_binding_0, ) => {
596 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500597 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400598 )
599 }
600 Ge(_binding_0, ) => {
601 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500602 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400603 )
604 }
605 Gt(_binding_0, ) => {
606 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500607 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400608 )
609 }
610 AddEq(_binding_0, ) => {
611 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500612 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400613 )
614 }
615 SubEq(_binding_0, ) => {
616 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500617 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400618 )
619 }
620 MulEq(_binding_0, ) => {
621 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500622 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400623 )
624 }
625 DivEq(_binding_0, ) => {
626 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500627 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400628 )
629 }
630 RemEq(_binding_0, ) => {
631 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500632 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400633 )
634 }
635 BitXorEq(_binding_0, ) => {
636 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500637 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400638 )
639 }
640 BitAndEq(_binding_0, ) => {
641 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500642 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400643 )
644 }
645 BitOrEq(_binding_0, ) => {
646 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500647 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400648 )
649 }
650 ShlEq(_binding_0, ) => {
651 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500652 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400653 )
654 }
655 ShrEq(_binding_0, ) => {
656 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500657 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400658 )
659 }
660 }
661}
David Tolnay506e43a2017-12-29 11:34:36 -0500662
663pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
664 Binding {
665 ident: _visitor.fold_ident(_i . ident),
666 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
667 ty: _visitor.fold_type(_i . ty),
668 }
669}
Nika Layzell27726662017-10-24 23:16:35 -0400670# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400671pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400672 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500673 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400674 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
675 }
676}
677
Nika Layzella6f46c42017-10-26 15:26:16 -0400678pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400679 use ::Body::*;
680 match _i {
681 Enum(_binding_0, ) => {
682 Enum (
683 _visitor.fold_body_enum(_binding_0),
684 )
685 }
686 Struct(_binding_0, ) => {
687 Struct (
688 _visitor.fold_body_struct(_binding_0),
689 )
690 }
691 }
692}
693
Nika Layzella6f46c42017-10-26 15:26:16 -0400694pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400695 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500696 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500697 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400698 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
699 }
700}
701
Nika Layzella6f46c42017-10-26 15:26:16 -0400702pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400703 BodyStruct {
704 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500705 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
706 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400707 }
708}
709
Nika Layzella6f46c42017-10-26 15:26:16 -0400710pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400711 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500712 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
713 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400714 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500715 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400716 }
717}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500718
719pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
720 ConstParam {
721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500723 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500724 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500725 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500726 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500727 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
728 }
729}
Nika Layzell27726662017-10-24 23:16:35 -0400730
Nika Layzella6f46c42017-10-26 15:26:16 -0400731pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400732 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400733 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500734 vis: _visitor.fold_visibility(_i . vis),
735 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400736 generics: _visitor.fold_generics(_i . generics),
737 body: _visitor.fold_body(_i . body),
738 }
739}
740
Nika Layzella6f46c42017-10-26 15:26:16 -0400741pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500742 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400743 match _i {
744 Box(_binding_0, ) => {
745 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400746 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400747 )
748 }
749 InPlace(_binding_0, ) => {
750 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400751 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400752 )
753 }
754 Array(_binding_0, ) => {
755 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400756 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400757 )
758 }
759 Call(_binding_0, ) => {
760 Call (
761 _visitor.fold_expr_call(_binding_0),
762 )
763 }
764 MethodCall(_binding_0, ) => {
765 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400766 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400767 )
768 }
David Tolnay05362582017-12-26 01:33:57 -0500769 Tuple(_binding_0, ) => {
770 Tuple (
771 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400772 )
773 }
774 Binary(_binding_0, ) => {
775 Binary (
776 _visitor.fold_expr_binary(_binding_0),
777 )
778 }
779 Unary(_binding_0, ) => {
780 Unary (
781 _visitor.fold_expr_unary(_binding_0),
782 )
783 }
784 Lit(_binding_0, ) => {
785 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500786 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400787 )
788 }
789 Cast(_binding_0, ) => {
790 Cast (
791 _visitor.fold_expr_cast(_binding_0),
792 )
793 }
794 Type(_binding_0, ) => {
795 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500796 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400797 )
798 }
799 If(_binding_0, ) => {
800 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400801 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400802 )
803 }
804 IfLet(_binding_0, ) => {
805 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400806 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 )
808 }
809 While(_binding_0, ) => {
810 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400811 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400812 )
813 }
814 WhileLet(_binding_0, ) => {
815 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400816 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400817 )
818 }
819 ForLoop(_binding_0, ) => {
820 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400821 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400822 )
823 }
824 Loop(_binding_0, ) => {
825 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400826 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400827 )
828 }
829 Match(_binding_0, ) => {
830 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400831 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400832 )
833 }
834 Closure(_binding_0, ) => {
835 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400836 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400837 )
838 }
Nika Layzell640832a2017-12-04 13:37:09 -0500839 Unsafe(_binding_0, ) => {
840 Unsafe (
841 full!(_visitor.fold_expr_unsafe(_binding_0)),
842 )
843 }
Nika Layzell27726662017-10-24 23:16:35 -0400844 Block(_binding_0, ) => {
845 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400846 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400847 )
848 }
849 Assign(_binding_0, ) => {
850 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
854 AssignOp(_binding_0, ) => {
855 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
859 Field(_binding_0, ) => {
860 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400861 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400862 )
863 }
Nika Layzell27726662017-10-24 23:16:35 -0400864 Index(_binding_0, ) => {
865 Index (
866 _visitor.fold_expr_index(_binding_0),
867 )
868 }
869 Range(_binding_0, ) => {
870 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400871 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400872 )
873 }
874 Path(_binding_0, ) => {
875 Path (
876 _visitor.fold_expr_path(_binding_0),
877 )
878 }
879 AddrOf(_binding_0, ) => {
880 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400881 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 )
883 }
884 Break(_binding_0, ) => {
885 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400886 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400887 )
888 }
889 Continue(_binding_0, ) => {
890 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400891 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
David Tolnayc246cd32017-12-28 23:14:32 -0500894 Return(_binding_0, ) => {
895 Return (
896 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800899 Macro(_binding_0, ) => {
900 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500901 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400902 )
903 }
904 Struct(_binding_0, ) => {
905 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400906 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400907 )
908 }
909 Repeat(_binding_0, ) => {
910 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400911 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400912 )
913 }
914 Paren(_binding_0, ) => {
915 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500916 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400917 )
918 }
919 Group(_binding_0, ) => {
920 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500921 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400922 )
923 }
924 Try(_binding_0, ) => {
925 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400926 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400927 )
928 }
929 Catch(_binding_0, ) => {
930 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400931 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400932 )
933 }
934 Yield(_binding_0, ) => {
935 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400936 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400937 )
938 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500939 Verbatim(_binding_0, ) => {
940 Verbatim (
941 _visitor.fold_expr_verbatim(_binding_0),
942 )
943 }
Nika Layzell27726662017-10-24 23:16:35 -0400944 }
945}
946# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500947pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
948 ExprAddrOf {
949 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
950 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500951 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500952 expr: Box::new(_visitor.fold_expr(* _i . expr)),
953 }
954}
955# [ cfg ( feature = "full" ) ]
956pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
957 ExprArray {
958 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
959 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500960 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500961 }
962}
963# [ cfg ( feature = "full" ) ]
964pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
965 ExprAssign {
966 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
967 left: Box::new(_visitor.fold_expr(* _i . left)),
968 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
969 right: Box::new(_visitor.fold_expr(* _i . right)),
970 }
971}
972# [ cfg ( feature = "full" ) ]
973pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
974 ExprAssignOp {
975 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
976 left: Box::new(_visitor.fold_expr(* _i . left)),
977 op: _visitor.fold_bin_op(_i . op),
978 right: Box::new(_visitor.fold_expr(* _i . right)),
979 }
980}
981
982pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
983 ExprBinary {
984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
985 left: Box::new(_visitor.fold_expr(* _i . left)),
986 op: _visitor.fold_bin_op(_i . op),
987 right: Box::new(_visitor.fold_expr(* _i . right)),
988 }
989}
990# [ cfg ( feature = "full" ) ]
991pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
992 ExprBlock {
993 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
994 block: _visitor.fold_block(_i . block),
995 }
996}
997# [ cfg ( feature = "full" ) ]
998pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
999 ExprBox {
1000 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1001 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1002 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1003 }
1004}
1005# [ cfg ( feature = "full" ) ]
1006pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1007 ExprBreak {
1008 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1009 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1010 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1011 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1012 }
1013}
1014
1015pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1016 ExprCall {
1017 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1018 func: Box::new(_visitor.fold_expr(* _i . func)),
1019 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1020 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1021 }
1022}
1023
1024pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1025 ExprCast {
1026 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1027 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1028 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1029 ty: Box::new(_visitor.fold_type(* _i . ty)),
1030 }
1031}
1032# [ cfg ( feature = "full" ) ]
1033pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1034 ExprCatch {
1035 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1036 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1037 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1038 block: _visitor.fold_block(_i . block),
1039 }
1040}
1041# [ cfg ( feature = "full" ) ]
1042pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1043 ExprClosure {
1044 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001045 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001046 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1047 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1048 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1049 output: _visitor.fold_return_type(_i . output),
1050 body: Box::new(_visitor.fold_expr(* _i . body)),
1051 }
1052}
1053# [ cfg ( feature = "full" ) ]
1054pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1055 ExprContinue {
1056 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1057 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1058 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1059 }
1060}
1061# [ cfg ( feature = "full" ) ]
1062pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1063 ExprField {
1064 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1065 base: Box::new(_visitor.fold_expr(* _i . base)),
1066 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1067 member: _visitor.fold_member(_i . member),
1068 }
1069}
1070# [ cfg ( feature = "full" ) ]
1071pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1072 ExprForLoop {
1073 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001074 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001075 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1076 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1077 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1078 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1079 body: _visitor.fold_block(_i . body),
1080 }
1081}
David Tolnaye98775f2017-12-28 23:17:00 -05001082# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001083pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1084 ExprGroup {
1085 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1086 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1087 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1088 }
1089}
1090# [ cfg ( feature = "full" ) ]
1091pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1092 ExprIf {
1093 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1094 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1095 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001096 then_branch: _visitor.fold_block(_i . then_branch),
1097 else_branch: (_i . else_branch).map(|it| { (
1098 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1099 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1100 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001101 }
1102}
1103# [ cfg ( feature = "full" ) ]
1104pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1105 ExprIfLet {
1106 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1107 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1108 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1109 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1110 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1111 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001112 then_branch: _visitor.fold_block(_i . then_branch),
1113 else_branch: (_i . else_branch).map(|it| { (
1114 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1115 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1116 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001117 }
1118}
1119# [ cfg ( feature = "full" ) ]
1120pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1121 ExprInPlace {
1122 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1123 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001124 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001125 value: Box::new(_visitor.fold_expr(* _i . value)),
1126 }
1127}
1128
1129pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1130 ExprIndex {
1131 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1132 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1133 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1134 index: Box::new(_visitor.fold_expr(* _i . index)),
1135 }
1136}
1137
1138pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1139 ExprLit {
1140 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1141 lit: _visitor.fold_lit(_i . lit),
1142 }
1143}
1144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001145pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001146 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001147 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001148 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001149 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1150 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001151 }
1152}
1153# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001154pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1155 ExprMacro {
1156 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1157 mac: _visitor.fold_macro(_i . mac),
1158 }
1159}
1160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001161pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001162 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001163 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001164 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001165 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001166 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001167 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1168 }
1169}
1170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001171pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001172 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001173 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001174 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001175 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001176 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001177 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001178 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1179 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
1181}
David Tolnaye98775f2017-12-28 23:17:00 -05001182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001183pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001184 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001185 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001186 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001187 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
1189}
1190
Nika Layzella6f46c42017-10-26 15:26:16 -04001191pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001192 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001193 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001194 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001195 path: _visitor.fold_path(_i . path),
1196 }
1197}
1198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001199pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001200 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001201 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001202 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001203 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001204 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
1206}
1207# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001208pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001209 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001210 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001211 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001212 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001213 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001214 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1215 }
1216}
1217# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001218pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1219 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001220 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001221 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001222 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
1224}
1225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001226pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001229 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001230 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001231 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1232 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1233 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
1235}
1236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001237pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001238 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001239 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001240 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001241 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
1243}
1244# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001245pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1246 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001247 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001248 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001249 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001250 }
1251}
David Tolnay0cf94f22017-12-28 23:46:26 -05001252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001253pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001254 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001255 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001256 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001257 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001258 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
1260}
1261
Nika Layzella6f46c42017-10-26 15:26:16 -04001262pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001263 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001264 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001265 op: _visitor.fold_un_op(_i . op),
1266 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1267 }
1268}
1269# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001270pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1271 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001273 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001274 block: _visitor.fold_block(_i . block),
1275 }
1276}
David Tolnay2ae520a2017-12-29 11:19:50 -05001277
1278pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1279 ExprVerbatim {
1280 tts: _i . tts,
1281 }
1282}
Nika Layzell640832a2017-12-04 13:37:09 -05001283# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001284pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001285 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001286 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001287 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001288 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001289 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1290 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001291 }
1292}
1293# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001294pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001295 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001296 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001297 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001298 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1299 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001300 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001301 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001302 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1303 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001304 }
1305}
1306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001307pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001308 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001310 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001311 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001312 }
1313}
1314
Nika Layzella6f46c42017-10-26 15:26:16 -04001315pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001316 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001317 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001318 vis: _visitor.fold_visibility(_i . vis),
1319 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001320 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001321 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001322 }
1323}
1324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001325pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001326 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001327 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001328 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001329 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001330 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001331 }
1332}
1333# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001334pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001335 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001336 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1337 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001338 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001339 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001340 }
1341}
1342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001343pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001344 File {
1345 shebang: _i . shebang,
1346 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1347 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1348 }
1349}
1350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001351pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001352 use ::FnArg::*;
1353 match _i {
1354 SelfRef(_binding_0, ) => {
1355 SelfRef (
1356 _visitor.fold_arg_self_ref(_binding_0),
1357 )
1358 }
1359 SelfValue(_binding_0, ) => {
1360 SelfValue (
1361 _visitor.fold_arg_self(_binding_0),
1362 )
1363 }
1364 Captured(_binding_0, ) => {
1365 Captured (
1366 _visitor.fold_arg_captured(_binding_0),
1367 )
1368 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001369 Inferred(_binding_0, ) => {
1370 Inferred (
1371 _visitor.fold_pat(_binding_0),
1372 )
1373 }
Nika Layzell27726662017-10-24 23:16:35 -04001374 Ignored(_binding_0, ) => {
1375 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001376 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001377 )
1378 }
1379 }
1380}
1381# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001382pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001383 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001384 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001385 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001386 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001387 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001388 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001389 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001390 }
1391}
1392# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001393pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001394 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001395 match _i {
1396 Fn(_binding_0, ) => {
1397 Fn (
1398 _visitor.fold_foreign_item_fn(_binding_0),
1399 )
1400 }
1401 Static(_binding_0, ) => {
1402 Static (
1403 _visitor.fold_foreign_item_static(_binding_0),
1404 )
1405 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001406 Type(_binding_0, ) => {
1407 Type (
1408 _visitor.fold_foreign_item_type(_binding_0),
1409 )
1410 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001411 Verbatim(_binding_0, ) => {
1412 Verbatim (
1413 _visitor.fold_foreign_item_verbatim(_binding_0),
1414 )
1415 }
Nika Layzell27726662017-10-24 23:16:35 -04001416 }
1417}
1418# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001419pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1420 ForeignItemFn {
1421 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1422 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001423 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001424 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001425 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001426 }
1427}
1428# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001429pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001430 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001431 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1432 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001433 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001434 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001435 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001436 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001437 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001438 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001439 }
1440}
David Tolnay199bcbb2017-11-12 10:33:52 -08001441# [ cfg ( feature = "full" ) ]
1442pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1443 ForeignItemType {
1444 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1445 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001446 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001447 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001448 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001449 }
1450}
David Tolnay2ae520a2017-12-29 11:19:50 -05001451# [ cfg ( feature = "full" ) ]
1452pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1453 ForeignItemVerbatim {
1454 tts: _i . tts,
1455 }
1456}
Nika Layzell27726662017-10-24 23:16:35 -04001457
Nika Layzellc08227a2017-12-04 16:30:17 -05001458pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1459 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001460 match _i {
1461 Lifetime(_binding_0, ) => {
1462 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001463 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001464 )
1465 }
1466 Type(_binding_0, ) => {
1467 Type (
1468 _visitor.fold_type(_binding_0),
1469 )
1470 }
David Tolnay506e43a2017-12-29 11:34:36 -05001471 Binding(_binding_0, ) => {
1472 Binding (
1473 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001474 )
1475 }
Nika Layzellc680e612017-12-04 19:07:20 -05001476 Const(_binding_0, ) => {
1477 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001478 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001479 )
1480 }
Nika Layzell357885a2017-12-04 15:47:07 -05001481 }
1482}
David Tolnayd60cfec2017-12-29 00:21:38 -05001483# [ cfg ( feature = "full" ) ]
1484pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1485 use ::GenericMethodArgument::*;
1486 match _i {
1487 Type(_binding_0, ) => {
1488 Type (
1489 _visitor.fold_type(_binding_0),
1490 )
1491 }
1492 Const(_binding_0, ) => {
1493 Const (
1494 _visitor.fold_expr(_binding_0),
1495 )
1496 }
1497 }
1498}
Nika Layzell357885a2017-12-04 15:47:07 -05001499
David Tolnayc2f1aba2017-11-12 20:29:22 -08001500pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1501 use ::GenericParam::*;
1502 match _i {
1503 Lifetime(_binding_0, ) => {
1504 Lifetime (
1505 _visitor.fold_lifetime_def(_binding_0),
1506 )
1507 }
1508 Type(_binding_0, ) => {
1509 Type (
1510 _visitor.fold_type_param(_binding_0),
1511 )
1512 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001513 Const(_binding_0, ) => {
1514 Const (
1515 _visitor.fold_const_param(_binding_0),
1516 )
1517 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001518 }
1519}
1520
Nika Layzella6f46c42017-10-26 15:26:16 -04001521pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001522 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001523 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001524 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001525 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001526 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001527 }
1528}
1529# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001530pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001531 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001532 match _i {
1533 Const(_binding_0, ) => {
1534 Const (
1535 _visitor.fold_impl_item_const(_binding_0),
1536 )
1537 }
1538 Method(_binding_0, ) => {
1539 Method (
1540 _visitor.fold_impl_item_method(_binding_0),
1541 )
1542 }
1543 Type(_binding_0, ) => {
1544 Type (
1545 _visitor.fold_impl_item_type(_binding_0),
1546 )
1547 }
1548 Macro(_binding_0, ) => {
1549 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001550 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001551 )
1552 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001553 Verbatim(_binding_0, ) => {
1554 Verbatim (
1555 _visitor.fold_impl_item_verbatim(_binding_0),
1556 )
1557 }
Nika Layzell27726662017-10-24 23:16:35 -04001558 }
1559}
1560# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001561pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1562 ImplItemConst {
1563 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1564 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001565 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001566 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001567 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001568 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001569 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001570 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001571 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001572 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001573 }
1574}
1575# [ cfg ( feature = "full" ) ]
1576pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1577 ImplItemMacro {
1578 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1579 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001581 }
1582}
1583# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001584pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001585 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001586 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001587 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001588 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001589 sig: _visitor.fold_method_sig(_i . sig),
1590 block: _visitor.fold_block(_i . block),
1591 }
1592}
1593# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001594pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001595 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001596 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001597 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001598 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001599 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001600 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001601 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001602 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001603 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001604 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001605 }
1606}
David Tolnay2ae520a2017-12-29 11:19:50 -05001607# [ cfg ( feature = "full" ) ]
1608pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1609 ImplItemVerbatim {
1610 tts: _i . tts,
1611 }
1612}
David Tolnay14982012017-12-29 00:49:51 -05001613
David Tolnay85b69a42017-12-27 20:43:10 -05001614pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1615 Index {
1616 index: _i . index,
1617 span: _visitor.fold_span(_i . span),
1618 }
1619}
1620# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001621pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001622 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001623 match _i {
1624 ExternCrate(_binding_0, ) => {
1625 ExternCrate (
1626 _visitor.fold_item_extern_crate(_binding_0),
1627 )
1628 }
1629 Use(_binding_0, ) => {
1630 Use (
1631 _visitor.fold_item_use(_binding_0),
1632 )
1633 }
1634 Static(_binding_0, ) => {
1635 Static (
1636 _visitor.fold_item_static(_binding_0),
1637 )
1638 }
1639 Const(_binding_0, ) => {
1640 Const (
1641 _visitor.fold_item_const(_binding_0),
1642 )
1643 }
1644 Fn(_binding_0, ) => {
1645 Fn (
1646 _visitor.fold_item_fn(_binding_0),
1647 )
1648 }
1649 Mod(_binding_0, ) => {
1650 Mod (
1651 _visitor.fold_item_mod(_binding_0),
1652 )
1653 }
1654 ForeignMod(_binding_0, ) => {
1655 ForeignMod (
1656 _visitor.fold_item_foreign_mod(_binding_0),
1657 )
1658 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001659 Type(_binding_0, ) => {
1660 Type (
1661 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001662 )
1663 }
1664 Enum(_binding_0, ) => {
1665 Enum (
1666 _visitor.fold_item_enum(_binding_0),
1667 )
1668 }
1669 Struct(_binding_0, ) => {
1670 Struct (
1671 _visitor.fold_item_struct(_binding_0),
1672 )
1673 }
1674 Union(_binding_0, ) => {
1675 Union (
1676 _visitor.fold_item_union(_binding_0),
1677 )
1678 }
1679 Trait(_binding_0, ) => {
1680 Trait (
1681 _visitor.fold_item_trait(_binding_0),
1682 )
1683 }
Nika Layzell27726662017-10-24 23:16:35 -04001684 Impl(_binding_0, ) => {
1685 Impl (
1686 _visitor.fold_item_impl(_binding_0),
1687 )
1688 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001689 Macro(_binding_0, ) => {
1690 Macro (
1691 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001692 )
1693 }
David Tolnay500d8322017-12-18 00:32:51 -08001694 Macro2(_binding_0, ) => {
1695 Macro2 (
1696 _visitor.fold_item_macro2(_binding_0),
1697 )
1698 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001699 Verbatim(_binding_0, ) => {
1700 Verbatim (
1701 _visitor.fold_item_verbatim(_binding_0),
1702 )
1703 }
Nika Layzell27726662017-10-24 23:16:35 -04001704 }
1705}
1706# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001707pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1708 ItemConst {
1709 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1710 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001711 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001712 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001713 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001714 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001715 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001716 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001717 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001718 }
1719}
1720# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001721pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1722 ItemEnum {
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 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001726 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001727 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001728 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001729 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1730 }
1731}
1732# [ cfg ( feature = "full" ) ]
1733pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1734 ItemExternCrate {
1735 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1736 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001737 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1738 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001739 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001740 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001741 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001742 _visitor.fold_ident(( it ) . 1),
1743 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001744 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001745 }
1746}
1747# [ cfg ( feature = "full" ) ]
1748pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1749 ItemFn {
1750 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1751 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001752 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001753 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001755 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001756 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757 block: Box::new(_visitor.fold_block(* _i . block)),
1758 }
1759}
1760# [ cfg ( feature = "full" ) ]
1761pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1762 ItemForeignMod {
1763 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1764 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001765 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001766 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1767 }
1768}
1769# [ cfg ( feature = "full" ) ]
1770pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1771 ItemImpl {
1772 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001773 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001774 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001775 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001776 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001777 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001778 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001779 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001781 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001782 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001783 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001784 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1785 }
1786}
1787# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001788pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1789 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001790 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001791 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001792 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001793 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 }
1795}
1796# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001797pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1798 ItemMacro2 {
1799 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1800 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001801 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001802 ident: _visitor.fold_ident(_i . ident),
David Tolnayab919512017-12-30 23:31:51 -05001803 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001804 args: _i . args,
David Tolnayab919512017-12-30 23:31:51 -05001805 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay500d8322017-12-18 00:32:51 -08001806 body: _i . body,
1807 }
1808}
1809# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001810pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001811 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001813 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001814 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001815 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001816 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001817 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001818 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1819 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001820 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001821 }
1822}
1823# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001824pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001825 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001826 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001827 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001828 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001829 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001830 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001832 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001833 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001834 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001835 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).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_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001840 ItemStruct {
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 Tolnaycc0f0372017-12-28 19:11:04 -05001843 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001844 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001845 generics: _visitor.fold_generics(_i . generics),
1846 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001847 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001848 }
1849}
1850# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001851pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001852 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001854 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001855 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1857 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001858 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001859 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001861 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001862 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001863 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1864 }
1865}
1866# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001867pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1868 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001869 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001870 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001872 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001873 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001874 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001875 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001876 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001877 }
1878}
1879# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001880pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001881 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001882 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001883 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001884 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001885 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001886 generics: _visitor.fold_generics(_i . generics),
1887 data: _visitor.fold_variant_data(_i . data),
1888 }
1889}
1890# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001891pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001892 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001893 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001894 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1896 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001897 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1898 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001899 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001900 }
1901}
David Tolnay2ae520a2017-12-29 11:19:50 -05001902# [ cfg ( feature = "full" ) ]
1903pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1904 ItemVerbatim {
1905 tts: _i . tts,
1906 }
1907}
David Tolnaybcd498f2017-12-29 12:02:33 -05001908# [ cfg ( feature = "full" ) ]
1909pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1910 Label {
1911 name: _visitor.fold_lifetime(_i . name),
1912 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1913 }
1914}
Nika Layzell27726662017-10-24 23:16:35 -04001915
Nika Layzella6f46c42017-10-26 15:26:16 -04001916pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001917 LifetimeDef {
1918 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001919 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001920 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001921 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1922 }
1923}
1924
1925pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1926 Lit {
1927 value: _i . value,
1928 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001929 }
1930}
1931# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001932pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001933 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001934 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001935 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1936 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05001937 ty: (_i . ty).map(|it| { (
1938 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
1939 Box::new(_visitor.fold_type(* ( it ) . 1)),
1940 ) }),
1941 init: (_i . init).map(|it| { (
1942 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
1943 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1944 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001945 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001946 }
1947}
Nika Layzell27726662017-10-24 23:16:35 -04001948
David Tolnaydecf28d2017-11-11 11:56:45 -08001949pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1950 Macro {
1951 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001952 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayab919512017-12-30 23:31:51 -05001953 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
1954 tts: _i . tts,
1955 }
1956}
1957
1958pub fn fold_macro_delimiter<V: Folder + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
1959 use ::MacroDelimiter::*;
1960 match _i {
1961 Paren(_binding_0, ) => {
1962 Paren (
1963 Paren(tokens_helper(_visitor, &(_binding_0).0)),
1964 )
1965 }
1966 Brace(_binding_0, ) => {
1967 Brace (
1968 Brace(tokens_helper(_visitor, &(_binding_0).0)),
1969 )
1970 }
1971 Bracket(_binding_0, ) => {
1972 Bracket (
1973 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
1974 )
1975 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001976 }
1977}
David Tolnay14982012017-12-29 00:49:51 -05001978
David Tolnay85b69a42017-12-27 20:43:10 -05001979pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1980 use ::Member::*;
1981 match _i {
1982 Named(_binding_0, ) => {
1983 Named (
1984 _visitor.fold_ident(_binding_0),
1985 )
1986 }
1987 Unnamed(_binding_0, ) => {
1988 Unnamed (
1989 _visitor.fold_index(_binding_0),
1990 )
1991 }
1992 }
1993}
David Tolnaydecf28d2017-11-11 11:56:45 -08001994
Nika Layzella6f46c42017-10-26 15:26:16 -04001995pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001996 use ::MetaItem::*;
1997 match _i {
1998 Term(_binding_0, ) => {
1999 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002000 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002001 )
2002 }
2003 List(_binding_0, ) => {
2004 List (
2005 _visitor.fold_meta_item_list(_binding_0),
2006 )
2007 }
2008 NameValue(_binding_0, ) => {
2009 NameValue (
2010 _visitor.fold_meta_name_value(_binding_0),
2011 )
2012 }
2013 }
2014}
2015
Nika Layzella6f46c42017-10-26 15:26:16 -04002016pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002017 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002018 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002019 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002020 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2021 }
2022}
2023
Nika Layzella6f46c42017-10-26 15:26:16 -04002024pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002025 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002026 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002027 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002028 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002029 }
2030}
2031# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002032pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002033 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002034 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002035 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002036 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002037 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002038 decl: _visitor.fold_fn_decl(_i . decl),
2039 }
2040}
David Tolnayd60cfec2017-12-29 00:21:38 -05002041# [ cfg ( feature = "full" ) ]
2042pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2043 MethodTurbofish {
2044 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2045 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2046 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2047 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2048 }
2049}
Nika Layzell27726662017-10-24 23:16:35 -04002050
Nika Layzella6f46c42017-10-26 15:26:16 -04002051pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002052 use ::NestedMetaItem::*;
2053 match _i {
2054 MetaItem(_binding_0, ) => {
2055 MetaItem (
2056 _visitor.fold_meta_item(_binding_0),
2057 )
2058 }
2059 Literal(_binding_0, ) => {
2060 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002061 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002062 )
2063 }
2064 }
2065}
2066
Nika Layzellc08227a2017-12-04 16:30:17 -05002067pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2068 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002069 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002070 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002071 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002072 }
2073}
2074# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002075pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002076 use ::Pat::*;
2077 match _i {
2078 Wild(_binding_0, ) => {
2079 Wild (
2080 _visitor.fold_pat_wild(_binding_0),
2081 )
2082 }
2083 Ident(_binding_0, ) => {
2084 Ident (
2085 _visitor.fold_pat_ident(_binding_0),
2086 )
2087 }
2088 Struct(_binding_0, ) => {
2089 Struct (
2090 _visitor.fold_pat_struct(_binding_0),
2091 )
2092 }
2093 TupleStruct(_binding_0, ) => {
2094 TupleStruct (
2095 _visitor.fold_pat_tuple_struct(_binding_0),
2096 )
2097 }
2098 Path(_binding_0, ) => {
2099 Path (
2100 _visitor.fold_pat_path(_binding_0),
2101 )
2102 }
2103 Tuple(_binding_0, ) => {
2104 Tuple (
2105 _visitor.fold_pat_tuple(_binding_0),
2106 )
2107 }
2108 Box(_binding_0, ) => {
2109 Box (
2110 _visitor.fold_pat_box(_binding_0),
2111 )
2112 }
2113 Ref(_binding_0, ) => {
2114 Ref (
2115 _visitor.fold_pat_ref(_binding_0),
2116 )
2117 }
2118 Lit(_binding_0, ) => {
2119 Lit (
2120 _visitor.fold_pat_lit(_binding_0),
2121 )
2122 }
2123 Range(_binding_0, ) => {
2124 Range (
2125 _visitor.fold_pat_range(_binding_0),
2126 )
2127 }
2128 Slice(_binding_0, ) => {
2129 Slice (
2130 _visitor.fold_pat_slice(_binding_0),
2131 )
2132 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002133 Macro(_binding_0, ) => {
2134 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002135 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002136 )
2137 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002138 Verbatim(_binding_0, ) => {
2139 Verbatim (
2140 _visitor.fold_pat_verbatim(_binding_0),
2141 )
2142 }
Nika Layzell27726662017-10-24 23:16:35 -04002143 }
2144}
2145# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002146pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002147 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002148 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002149 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002150 }
2151}
2152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002153pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002154 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002155 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2156 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002157 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002158 subpat: (_i . subpat).map(|it| { (
2159 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2160 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2161 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002162 }
2163}
2164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002165pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002166 PatLit {
2167 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2168 }
2169}
2170# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002171pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2172 PatMacro {
2173 mac: _visitor.fold_macro(_i . mac),
2174 }
2175}
2176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002177pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002178 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002179 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002180 path: _visitor.fold_path(_i . path),
2181 }
2182}
2183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002184pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002185 PatRange {
2186 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002187 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002188 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
2190}
2191# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002192pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002193 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002194 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002195 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002196 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002197 }
2198}
2199# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002200pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002201 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002202 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002203 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002204 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002205 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002206 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002207 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
2209}
2210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002212 PatStruct {
2213 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002214 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002215 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002216 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002217 }
2218}
2219# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002220pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002221 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002222 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002223 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002224 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002225 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2226 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002227 }
2228}
2229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002230pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002231 PatTupleStruct {
2232 path: _visitor.fold_path(_i . path),
2233 pat: _visitor.fold_pat_tuple(_i . pat),
2234 }
2235}
2236# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002237pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2238 PatVerbatim {
2239 tts: _i . tts,
2240 }
2241}
2242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002243pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002244 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002245 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002246 }
2247}
2248
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002250 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002251 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002252 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2253 }
2254}
Nika Layzellc08227a2017-12-04 16:30:17 -05002255
2256pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2257 use ::PathArguments::*;
2258 match _i {
2259 None => { None }
2260 AngleBracketed(_binding_0, ) => {
2261 AngleBracketed (
2262 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2263 )
2264 }
2265 Parenthesized(_binding_0, ) => {
2266 Parenthesized (
2267 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2268 )
2269 }
2270 }
2271}
Nika Layzell27726662017-10-24 23:16:35 -04002272
Nika Layzella6f46c42017-10-26 15:26:16 -04002273pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002274 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002275 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002276 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002277 }
2278}
Nika Layzell27726662017-10-24 23:16:35 -04002279
Nika Layzella6f46c42017-10-26 15:26:16 -04002280pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002281 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002282 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002283 trait_ref: _visitor.fold_path(_i . trait_ref),
2284 }
2285}
2286
Nika Layzella6f46c42017-10-26 15:26:16 -04002287pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002288 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002289 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002290 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002291 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002292 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2293 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002294 }
2295}
2296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002297pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002298 use ::RangeLimits::*;
2299 match _i {
2300 HalfOpen(_binding_0, ) => {
2301 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002302 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002303 )
2304 }
2305 Closed(_binding_0, ) => {
2306 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002307 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002308 )
2309 }
2310 }
2311}
David Tolnayf93b90d2017-11-11 19:21:26 -08002312
2313pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2314 use ::ReturnType::*;
2315 match _i {
2316 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002317 Type(_binding_0, _binding_1, ) => {
2318 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002319 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2320 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002321 )
2322 }
2323 }
2324}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002325
2326pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2327 _i
2328}
Nika Layzell27726662017-10-24 23:16:35 -04002329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002330pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002331 use ::Stmt::*;
2332 match _i {
2333 Local(_binding_0, ) => {
2334 Local (
2335 Box::new(_visitor.fold_local(* _binding_0)),
2336 )
2337 }
2338 Item(_binding_0, ) => {
2339 Item (
2340 Box::new(_visitor.fold_item(* _binding_0)),
2341 )
2342 }
2343 Expr(_binding_0, ) => {
2344 Expr (
2345 Box::new(_visitor.fold_expr(* _binding_0)),
2346 )
2347 }
2348 Semi(_binding_0, _binding_1, ) => {
2349 Semi (
2350 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002351 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002352 )
2353 }
Nika Layzell27726662017-10-24 23:16:35 -04002354 }
2355}
2356
Nika Layzella6f46c42017-10-26 15:26:16 -04002357pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002358 use ::TraitBoundModifier::*;
2359 match _i {
2360 None => { None }
2361 Maybe(_binding_0, ) => {
2362 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002363 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002364 )
2365 }
2366 }
2367}
2368# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002369pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002370 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002371 match _i {
2372 Const(_binding_0, ) => {
2373 Const (
2374 _visitor.fold_trait_item_const(_binding_0),
2375 )
2376 }
2377 Method(_binding_0, ) => {
2378 Method (
2379 _visitor.fold_trait_item_method(_binding_0),
2380 )
2381 }
2382 Type(_binding_0, ) => {
2383 Type (
2384 _visitor.fold_trait_item_type(_binding_0),
2385 )
2386 }
2387 Macro(_binding_0, ) => {
2388 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002389 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002390 )
2391 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002392 Verbatim(_binding_0, ) => {
2393 Verbatim (
2394 _visitor.fold_trait_item_verbatim(_binding_0),
2395 )
2396 }
Nika Layzell27726662017-10-24 23:16:35 -04002397 }
2398}
2399# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002400pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2401 TraitItemConst {
2402 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002403 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002404 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002405 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002406 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002407 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002408 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002409 _visitor.fold_expr(( it ) . 1),
2410 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002411 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002412 }
2413}
2414# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002415pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2416 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002417 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002418 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002419 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002420 }
2421}
2422# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002423pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002424 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002425 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002426 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002427 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002428 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002429 }
2430}
2431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002432pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002433 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002434 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002435 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002436 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002437 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002438 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002439 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002440 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002441 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002442 _visitor.fold_type(( it ) . 1),
2443 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002444 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002445 }
2446}
David Tolnay2ae520a2017-12-29 11:19:50 -05002447# [ cfg ( feature = "full" ) ]
2448pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2449 TraitItemVerbatim {
2450 tts: _i . tts,
2451 }
2452}
Nika Layzell27726662017-10-24 23:16:35 -04002453
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002454pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2455 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002456 match _i {
2457 Slice(_binding_0, ) => {
2458 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002459 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002460 )
2461 }
2462 Array(_binding_0, ) => {
2463 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002464 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002465 )
2466 }
2467 Ptr(_binding_0, ) => {
2468 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002469 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002470 )
2471 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002472 Reference(_binding_0, ) => {
2473 Reference (
2474 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002475 )
2476 }
2477 BareFn(_binding_0, ) => {
2478 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002480 )
2481 }
2482 Never(_binding_0, ) => {
2483 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002484 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002485 )
2486 }
David Tolnay05362582017-12-26 01:33:57 -05002487 Tuple(_binding_0, ) => {
2488 Tuple (
2489 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002490 )
2491 }
2492 Path(_binding_0, ) => {
2493 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002494 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002495 )
2496 }
2497 TraitObject(_binding_0, ) => {
2498 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002499 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002500 )
2501 }
2502 ImplTrait(_binding_0, ) => {
2503 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002504 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002505 )
2506 }
2507 Paren(_binding_0, ) => {
2508 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002510 )
2511 }
2512 Group(_binding_0, ) => {
2513 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002514 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002515 )
2516 }
2517 Infer(_binding_0, ) => {
2518 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002520 )
2521 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002522 Macro(_binding_0, ) => {
2523 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002524 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002525 )
2526 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002527 Verbatim(_binding_0, ) => {
2528 Verbatim (
2529 _visitor.fold_type_verbatim(_binding_0),
2530 )
2531 }
Nika Layzell27726662017-10-24 23:16:35 -04002532 }
2533}
2534
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2536 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002537 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002538 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002539 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002540 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002541 }
2542}
2543
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2545 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002546 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2547 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2548 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2549 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2550 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2551 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2552 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2553 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2558 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002559 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002560 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002561 }
2562}
2563
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002564pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2565 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002566 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002571pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2572 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002573 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002574 }
2575}
2576
David Tolnay323279a2017-12-29 11:26:32 -05002577pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2578 TypeMacro {
2579 mac: _visitor.fold_macro(_i . mac),
2580 }
2581}
2582
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2584 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002585 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 }
2587}
2588
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002589pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2590 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002591 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002592 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002593 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002594 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002597 }
2598}
2599
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002600pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2601 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002602 match _i {
2603 Trait(_binding_0, _binding_1, ) => {
2604 Trait (
2605 _visitor.fold_poly_trait_ref(_binding_0),
2606 _visitor.fold_trait_bound_modifier(_binding_1),
2607 )
2608 }
2609 Region(_binding_0, ) => {
2610 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002611 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
2614 }
2615}
2616
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002617pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2618 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002619 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002620 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_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2625 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002626 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002627 path: _visitor.fold_path(_i . path),
2628 }
2629}
2630
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2632 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002633 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2634 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002635 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2636 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002637 }
2638}
2639
David Tolnay0a89b4d2017-11-13 00:55:45 -08002640pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2641 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002642 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002643 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002644 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2645 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002646 }
2647}
2648
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002649pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2650 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002651 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002652 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
2654}
2655
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002656pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2657 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002658 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002659 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
2661}
2662
David Tolnay05362582017-12-26 01:33:57 -05002663pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2664 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002665 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002666 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002667 }
2668}
2669
David Tolnay2ae520a2017-12-29 11:19:50 -05002670pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2671 TypeVerbatim {
2672 tts: _i . tts,
2673 }
2674}
2675
Nika Layzella6f46c42017-10-26 15:26:16 -04002676pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002677 use ::UnOp::*;
2678 match _i {
2679 Deref(_binding_0, ) => {
2680 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002681 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002682 )
2683 }
2684 Not(_binding_0, ) => {
2685 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002686 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002687 )
2688 }
2689 Neg(_binding_0, ) => {
2690 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002691 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002692 )
2693 }
2694 }
2695}
David Tolnay5f332a92017-12-26 00:42:45 -05002696# [ cfg ( feature = "full" ) ]
2697pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2698 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002699 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002700 }
2701}
2702# [ cfg ( feature = "full" ) ]
2703pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2704 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002705 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002706 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2707 }
2708}
2709# [ cfg ( feature = "full" ) ]
2710pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2711 UsePath {
2712 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002713 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002714 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002715 _visitor.fold_ident(( it ) . 1),
2716 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002717 }
2718}
2719# [ cfg ( feature = "full" ) ]
2720pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2721 use ::UseTree::*;
2722 match _i {
2723 Path(_binding_0, ) => {
2724 Path (
2725 _visitor.fold_use_path(_binding_0),
2726 )
2727 }
2728 Glob(_binding_0, ) => {
2729 Glob (
2730 _visitor.fold_use_glob(_binding_0),
2731 )
2732 }
2733 List(_binding_0, ) => {
2734 List (
2735 _visitor.fold_use_list(_binding_0),
2736 )
2737 }
2738 }
2739}
Nika Layzell27726662017-10-24 23:16:35 -04002740
Nika Layzella6f46c42017-10-26 15:26:16 -04002741pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002742 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002743 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002744 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002745 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002746 discriminant: (_i . discriminant).map(|it| { (
2747 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2748 _visitor.fold_expr(( it ) . 1),
2749 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002750 }
2751}
2752
Nika Layzella6f46c42017-10-26 15:26:16 -04002753pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002754 use ::VariantData::*;
2755 match _i {
2756 Struct(_binding_0, _binding_1, ) => {
2757 Struct (
2758 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002759 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002760 )
2761 }
2762 Tuple(_binding_0, _binding_1, ) => {
2763 Tuple (
2764 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002765 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002766 )
2767 }
2768 Unit => { Unit }
2769 }
2770}
Nika Layzell27726662017-10-24 23:16:35 -04002771
Nika Layzella6f46c42017-10-26 15:26:16 -04002772pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002773 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002774 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002775 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002776 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002777 }
2778}
2779
Nika Layzella6f46c42017-10-26 15:26:16 -04002780pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002781 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002782 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
2785
Nika Layzella6f46c42017-10-26 15:26:16 -04002786pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002787 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002789 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002790 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002791 path: Box::new(_visitor.fold_path(* _i . path)),
2792 }
2793}
2794
Nika Layzella6f46c42017-10-26 15:26:16 -04002795pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002796 use ::Visibility::*;
2797 match _i {
2798 Public(_binding_0, ) => {
2799 Public (
2800 _visitor.fold_vis_public(_binding_0),
2801 )
2802 }
2803 Crate(_binding_0, ) => {
2804 Crate (
2805 _visitor.fold_vis_crate(_binding_0),
2806 )
2807 }
2808 Restricted(_binding_0, ) => {
2809 Restricted (
2810 _visitor.fold_vis_restricted(_binding_0),
2811 )
2812 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002813 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002814 }
2815}
2816
Nika Layzella6f46c42017-10-26 15:26:16 -04002817pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002818 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002819 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002820 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002821 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002822 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002823 }
2824}
2825
Nika Layzella6f46c42017-10-26 15:26:16 -04002826pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002827 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002828 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002829 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2830 }
2831}
2832
Nika Layzella6f46c42017-10-26 15:26:16 -04002833pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002834 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002835 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002836 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002837 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002838 }
2839}
2840
Nika Layzella6f46c42017-10-26 15:26:16 -04002841pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002842 use ::WherePredicate::*;
2843 match _i {
2844 BoundPredicate(_binding_0, ) => {
2845 BoundPredicate (
2846 _visitor.fold_where_bound_predicate(_binding_0),
2847 )
2848 }
2849 RegionPredicate(_binding_0, ) => {
2850 RegionPredicate (
2851 _visitor.fold_where_region_predicate(_binding_0),
2852 )
2853 }
2854 EqPredicate(_binding_0, ) => {
2855 EqPredicate (
2856 _visitor.fold_where_eq_predicate(_binding_0),
2857 )
2858 }
2859 }
2860}
2861
Nika Layzella6f46c42017-10-26 15:26:16 -04002862pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002863 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002864 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002865 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002866 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002867 }
2868}
2869