blob: 1f60d889ca380e03e9d70ea4ebd243ee6cbfc0ac [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 Tolnay85b69a42017-12-27 20:43:10 -0500255fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800256
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500264# [ cfg ( feature = "full" ) ]
265fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzellc08227a2017-12-04 16:30:17 -0500269fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500279fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500295fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500300
301fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800310
311fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500312
313fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800323fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500328# [ cfg ( feature = "full" ) ]
329fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
338
339fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
340
341fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
342
David Tolnay323279a2017-12-29 11:26:32 -0500343fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
344
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800345fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
346
347fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
348
349fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
350
351fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
352
353fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
354
355fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
356
David Tolnay0a89b4d2017-11-13 00:55:45 -0800357fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800358
359fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
360
361fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
362
David Tolnay05362582017-12-26 01:33:57 -0500363fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800364
David Tolnay2ae520a2017-12-29 11:19:50 -0500365fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500368# [ cfg ( feature = "full" ) ]
369fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
399}
400
David Tolnayd0adf522017-12-29 01:30:07 -0500401pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
402 _i.span = _visitor.fold_span(_i.span);
403 _i
404}
405
406pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
407 _i.span = _visitor.fold_span(_i.span);
408 _i
409}
410
Nika Layzell27726662017-10-24 23:16:35 -0400411
Nika Layzella6f46c42017-10-26 15:26:16 -0400412pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400413 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500414 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500415 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400416 }
417}
418
Nika Layzellc08227a2017-12-04 16:30:17 -0500419pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
420 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500421 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500423 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400425 }
426}
427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400428pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400429 ArgCaptured {
430 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500431 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800432 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500438 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400440 }
441}
442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400443pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400444 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500446 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500447 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500448 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400449 }
450}
451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400452pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400453 Arm {
454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
455 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400457 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400465 use ::AttrStyle::*;
466 match _i {
467 Outer => { Outer }
468 Inner(_binding_0, ) => {
469 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 )
472 }
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400477 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500480 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 path: _visitor.fold_path(_i . path),
482 tts: _i . tts,
483 is_sugared_doc: _i . is_sugared_doc,
484 }
485}
486
Nika Layzella6f46c42017-10-26 15:26:16 -0400487pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400488 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500489 name: (_i . name).map(|it| { (
490 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800493 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400498 use ::BareFnArgName::*;
499 match _i {
500 Named(_binding_0, ) => {
501 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500502 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 Wild(_binding_0, ) => {
506 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
512
Nika Layzella6f46c42017-10-26 15:26:16 -0400513pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400514 use ::BinOp::*;
515 match _i {
516 Add(_binding_0, ) => {
517 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500518 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400519 )
520 }
521 Sub(_binding_0, ) => {
522 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500523 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400524 )
525 }
526 Mul(_binding_0, ) => {
527 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500528 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400529 )
530 }
531 Div(_binding_0, ) => {
532 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500533 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400534 )
535 }
536 Rem(_binding_0, ) => {
537 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500538 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400539 )
540 }
541 And(_binding_0, ) => {
542 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500543 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400544 )
545 }
546 Or(_binding_0, ) => {
547 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500548 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400549 )
550 }
551 BitXor(_binding_0, ) => {
552 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
556 BitAnd(_binding_0, ) => {
557 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
561 BitOr(_binding_0, ) => {
562 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
566 Shl(_binding_0, ) => {
567 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
571 Shr(_binding_0, ) => {
572 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
576 Eq(_binding_0, ) => {
577 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
581 Lt(_binding_0, ) => {
582 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
586 Le(_binding_0, ) => {
587 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
591 Ne(_binding_0, ) => {
592 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
596 Ge(_binding_0, ) => {
597 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
601 Gt(_binding_0, ) => {
602 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
606 AddEq(_binding_0, ) => {
607 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
611 SubEq(_binding_0, ) => {
612 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
616 MulEq(_binding_0, ) => {
617 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
621 DivEq(_binding_0, ) => {
622 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
626 RemEq(_binding_0, ) => {
627 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
631 BitXorEq(_binding_0, ) => {
632 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
636 BitAndEq(_binding_0, ) => {
637 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
641 BitOrEq(_binding_0, ) => {
642 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
646 ShlEq(_binding_0, ) => {
647 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
651 ShrEq(_binding_0, ) => {
652 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
656 }
657}
David Tolnay506e43a2017-12-29 11:34:36 -0500658
659pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
660 Binding {
661 ident: _visitor.fold_ident(_i . ident),
662 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
663 ty: _visitor.fold_type(_i . ty),
664 }
665}
Nika Layzell27726662017-10-24 23:16:35 -0400666# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400667pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400668 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500669 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400670 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
671 }
672}
673
Nika Layzella6f46c42017-10-26 15:26:16 -0400674pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400675 use ::Body::*;
676 match _i {
677 Enum(_binding_0, ) => {
678 Enum (
679 _visitor.fold_body_enum(_binding_0),
680 )
681 }
682 Struct(_binding_0, ) => {
683 Struct (
684 _visitor.fold_body_struct(_binding_0),
685 )
686 }
687 }
688}
689
Nika Layzella6f46c42017-10-26 15:26:16 -0400690pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400691 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500692 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500693 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400694 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
695 }
696}
697
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400699 BodyStruct {
700 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500701 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
702 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400703 }
704}
705
Nika Layzella6f46c42017-10-26 15:26:16 -0400706pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400707 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500708 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
709 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400710 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500711 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400712 }
713}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500714
715pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
716 ConstParam {
717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500719 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500723 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
724 }
725}
Nika Layzell27726662017-10-24 23:16:35 -0400726
Nika Layzella6f46c42017-10-26 15:26:16 -0400727pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400728 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400729 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500730 vis: _visitor.fold_visibility(_i . vis),
731 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400732 generics: _visitor.fold_generics(_i . generics),
733 body: _visitor.fold_body(_i . body),
734 }
735}
736
Nika Layzella6f46c42017-10-26 15:26:16 -0400737pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500738 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400739 match _i {
740 Box(_binding_0, ) => {
741 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400742 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400743 )
744 }
745 InPlace(_binding_0, ) => {
746 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400747 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400748 )
749 }
750 Array(_binding_0, ) => {
751 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400752 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400753 )
754 }
755 Call(_binding_0, ) => {
756 Call (
757 _visitor.fold_expr_call(_binding_0),
758 )
759 }
760 MethodCall(_binding_0, ) => {
761 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400762 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400763 )
764 }
David Tolnay05362582017-12-26 01:33:57 -0500765 Tuple(_binding_0, ) => {
766 Tuple (
767 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400768 )
769 }
770 Binary(_binding_0, ) => {
771 Binary (
772 _visitor.fold_expr_binary(_binding_0),
773 )
774 }
775 Unary(_binding_0, ) => {
776 Unary (
777 _visitor.fold_expr_unary(_binding_0),
778 )
779 }
780 Lit(_binding_0, ) => {
781 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500782 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400783 )
784 }
785 Cast(_binding_0, ) => {
786 Cast (
787 _visitor.fold_expr_cast(_binding_0),
788 )
789 }
790 Type(_binding_0, ) => {
791 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500792 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400793 )
794 }
795 If(_binding_0, ) => {
796 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400797 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400798 )
799 }
800 IfLet(_binding_0, ) => {
801 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400802 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400803 )
804 }
805 While(_binding_0, ) => {
806 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400807 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400808 )
809 }
810 WhileLet(_binding_0, ) => {
811 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400812 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400813 )
814 }
815 ForLoop(_binding_0, ) => {
816 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400817 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400818 )
819 }
820 Loop(_binding_0, ) => {
821 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400822 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400823 )
824 }
825 Match(_binding_0, ) => {
826 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400827 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400828 )
829 }
830 Closure(_binding_0, ) => {
831 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400832 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400833 )
834 }
Nika Layzell640832a2017-12-04 13:37:09 -0500835 Unsafe(_binding_0, ) => {
836 Unsafe (
837 full!(_visitor.fold_expr_unsafe(_binding_0)),
838 )
839 }
Nika Layzell27726662017-10-24 23:16:35 -0400840 Block(_binding_0, ) => {
841 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400842 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400843 )
844 }
845 Assign(_binding_0, ) => {
846 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400847 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400848 )
849 }
850 AssignOp(_binding_0, ) => {
851 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400852 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400853 )
854 }
855 Field(_binding_0, ) => {
856 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400857 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400858 )
859 }
Nika Layzell27726662017-10-24 23:16:35 -0400860 Index(_binding_0, ) => {
861 Index (
862 _visitor.fold_expr_index(_binding_0),
863 )
864 }
865 Range(_binding_0, ) => {
866 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400867 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400868 )
869 }
870 Path(_binding_0, ) => {
871 Path (
872 _visitor.fold_expr_path(_binding_0),
873 )
874 }
875 AddrOf(_binding_0, ) => {
876 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400877 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400878 )
879 }
880 Break(_binding_0, ) => {
881 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400882 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400883 )
884 }
885 Continue(_binding_0, ) => {
886 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400887 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400888 )
889 }
David Tolnayc246cd32017-12-28 23:14:32 -0500890 Return(_binding_0, ) => {
891 Return (
892 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400893 )
894 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800895 Macro(_binding_0, ) => {
896 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500897 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400898 )
899 }
900 Struct(_binding_0, ) => {
901 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400902 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400903 )
904 }
905 Repeat(_binding_0, ) => {
906 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400907 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400908 )
909 }
910 Paren(_binding_0, ) => {
911 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500912 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400913 )
914 }
915 Group(_binding_0, ) => {
916 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500917 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400918 )
919 }
920 Try(_binding_0, ) => {
921 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400922 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400923 )
924 }
925 Catch(_binding_0, ) => {
926 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400927 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 )
929 }
930 Yield(_binding_0, ) => {
931 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400932 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400933 )
934 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500935 Verbatim(_binding_0, ) => {
936 Verbatim (
937 _visitor.fold_expr_verbatim(_binding_0),
938 )
939 }
Nika Layzell27726662017-10-24 23:16:35 -0400940 }
941}
942# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500943pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
944 ExprAddrOf {
945 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
946 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500947 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500948 expr: Box::new(_visitor.fold_expr(* _i . expr)),
949 }
950}
951# [ cfg ( feature = "full" ) ]
952pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
953 ExprArray {
954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
955 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500956 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500957 }
958}
959# [ cfg ( feature = "full" ) ]
960pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
961 ExprAssign {
962 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
963 left: Box::new(_visitor.fold_expr(* _i . left)),
964 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
965 right: Box::new(_visitor.fold_expr(* _i . right)),
966 }
967}
968# [ cfg ( feature = "full" ) ]
969pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
970 ExprAssignOp {
971 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
972 left: Box::new(_visitor.fold_expr(* _i . left)),
973 op: _visitor.fold_bin_op(_i . op),
974 right: Box::new(_visitor.fold_expr(* _i . right)),
975 }
976}
977
978pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
979 ExprBinary {
980 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
981 left: Box::new(_visitor.fold_expr(* _i . left)),
982 op: _visitor.fold_bin_op(_i . op),
983 right: Box::new(_visitor.fold_expr(* _i . right)),
984 }
985}
986# [ cfg ( feature = "full" ) ]
987pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
988 ExprBlock {
989 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
990 block: _visitor.fold_block(_i . block),
991 }
992}
993# [ cfg ( feature = "full" ) ]
994pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
995 ExprBox {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
998 expr: Box::new(_visitor.fold_expr(* _i . expr)),
999 }
1000}
1001# [ cfg ( feature = "full" ) ]
1002pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1003 ExprBreak {
1004 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1005 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1006 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1007 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1008 }
1009}
1010
1011pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1012 ExprCall {
1013 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1014 func: Box::new(_visitor.fold_expr(* _i . func)),
1015 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1016 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1017 }
1018}
1019
1020pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1021 ExprCast {
1022 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1023 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1024 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1025 ty: Box::new(_visitor.fold_type(* _i . ty)),
1026 }
1027}
1028# [ cfg ( feature = "full" ) ]
1029pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1030 ExprCatch {
1031 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1032 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1033 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1034 block: _visitor.fold_block(_i . block),
1035 }
1036}
1037# [ cfg ( feature = "full" ) ]
1038pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1039 ExprClosure {
1040 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001041 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001042 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1043 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1044 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1045 output: _visitor.fold_return_type(_i . output),
1046 body: Box::new(_visitor.fold_expr(* _i . body)),
1047 }
1048}
1049# [ cfg ( feature = "full" ) ]
1050pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1051 ExprContinue {
1052 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1053 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1054 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1055 }
1056}
1057# [ cfg ( feature = "full" ) ]
1058pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1059 ExprField {
1060 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1061 base: Box::new(_visitor.fold_expr(* _i . base)),
1062 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1063 member: _visitor.fold_member(_i . member),
1064 }
1065}
1066# [ cfg ( feature = "full" ) ]
1067pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1068 ExprForLoop {
1069 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001070 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001071 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1072 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1073 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1074 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1075 body: _visitor.fold_block(_i . body),
1076 }
1077}
David Tolnaye98775f2017-12-28 23:17:00 -05001078# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001079pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1080 ExprGroup {
1081 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1082 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1083 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1084 }
1085}
1086# [ cfg ( feature = "full" ) ]
1087pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1088 ExprIf {
1089 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1090 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1091 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001092 then_branch: _visitor.fold_block(_i . then_branch),
1093 else_branch: (_i . else_branch).map(|it| { (
1094 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1095 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1096 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001097 }
1098}
1099# [ cfg ( feature = "full" ) ]
1100pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1101 ExprIfLet {
1102 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1103 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1104 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1105 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1106 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1107 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001108 then_branch: _visitor.fold_block(_i . then_branch),
1109 else_branch: (_i . else_branch).map(|it| { (
1110 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1111 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1112 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001113 }
1114}
1115# [ cfg ( feature = "full" ) ]
1116pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1117 ExprInPlace {
1118 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1119 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001120 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001121 value: Box::new(_visitor.fold_expr(* _i . value)),
1122 }
1123}
1124
1125pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1126 ExprIndex {
1127 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1128 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1129 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1130 index: Box::new(_visitor.fold_expr(* _i . index)),
1131 }
1132}
1133
1134pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1135 ExprLit {
1136 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1137 lit: _visitor.fold_lit(_i . lit),
1138 }
1139}
1140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001141pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001142 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001143 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001144 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001145 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1146 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001147 }
1148}
1149# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001150pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1151 ExprMacro {
1152 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1153 mac: _visitor.fold_macro(_i . mac),
1154 }
1155}
1156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001157pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001158 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001159 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001160 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001161 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001162 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1164 }
1165}
1166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001167pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001168 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001170 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001171 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001172 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001173 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001174 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1175 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
1177}
David Tolnaye98775f2017-12-28 23:17:00 -05001178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001179pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001180 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001181 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001182 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001183 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
1185}
1186
Nika Layzella6f46c42017-10-26 15:26:16 -04001187pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001188 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001189 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001190 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001191 path: _visitor.fold_path(_i . path),
1192 }
1193}
1194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001195pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001198 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001199 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
1202}
1203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001207 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001208 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001209 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1211 }
1212}
1213# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001214pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1215 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001216 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001217 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001218 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
1220}
1221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001222pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001225 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001226 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001227 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1228 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1229 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
1231}
1232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001233pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001235 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001237 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
1240# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001241pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1242 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001243 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001244 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001245 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001246 }
1247}
David Tolnay0cf94f22017-12-28 23:46:26 -05001248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001251 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001253 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001254 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257
Nika Layzella6f46c42017-10-26 15:26:16 -04001258pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001259 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001261 op: _visitor.fold_un_op(_i . op),
1262 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1263 }
1264}
1265# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001266pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1267 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001268 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001269 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001270 block: _visitor.fold_block(_i . block),
1271 }
1272}
David Tolnay2ae520a2017-12-29 11:19:50 -05001273
1274pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1275 ExprVerbatim {
1276 tts: _i . tts,
1277 }
1278}
Nika Layzell640832a2017-12-04 13:37:09 -05001279# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001280pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001281 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001282 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001283 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001284 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001285 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1286 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001287 }
1288}
1289# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001290pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001291 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001292 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001293 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001294 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1295 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001296 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001297 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001298 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1299 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001300 }
1301}
1302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001303pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001304 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001305 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001306 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001307 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001308 }
1309}
1310
Nika Layzella6f46c42017-10-26 15:26:16 -04001311pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001312 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001313 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001314 vis: _visitor.fold_visibility(_i . vis),
1315 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001316 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001317 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001318 }
1319}
1320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001321pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001322 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001323 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001324 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001325 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001326 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001327 }
1328}
1329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001330pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001331 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001332 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1333 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001334 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001335 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001336 }
1337}
1338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001340 File {
1341 shebang: _i . shebang,
1342 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1343 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1344 }
1345}
1346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001347pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001348 use ::FnArg::*;
1349 match _i {
1350 SelfRef(_binding_0, ) => {
1351 SelfRef (
1352 _visitor.fold_arg_self_ref(_binding_0),
1353 )
1354 }
1355 SelfValue(_binding_0, ) => {
1356 SelfValue (
1357 _visitor.fold_arg_self(_binding_0),
1358 )
1359 }
1360 Captured(_binding_0, ) => {
1361 Captured (
1362 _visitor.fold_arg_captured(_binding_0),
1363 )
1364 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001365 Inferred(_binding_0, ) => {
1366 Inferred (
1367 _visitor.fold_pat(_binding_0),
1368 )
1369 }
Nika Layzell27726662017-10-24 23:16:35 -04001370 Ignored(_binding_0, ) => {
1371 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001372 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001373 )
1374 }
1375 }
1376}
1377# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001378pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001379 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001380 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001381 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001382 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001383 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001384 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001385 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001386 }
1387}
1388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001389pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001390 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001391 match _i {
1392 Fn(_binding_0, ) => {
1393 Fn (
1394 _visitor.fold_foreign_item_fn(_binding_0),
1395 )
1396 }
1397 Static(_binding_0, ) => {
1398 Static (
1399 _visitor.fold_foreign_item_static(_binding_0),
1400 )
1401 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001402 Type(_binding_0, ) => {
1403 Type (
1404 _visitor.fold_foreign_item_type(_binding_0),
1405 )
1406 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001407 Verbatim(_binding_0, ) => {
1408 Verbatim (
1409 _visitor.fold_foreign_item_verbatim(_binding_0),
1410 )
1411 }
Nika Layzell27726662017-10-24 23:16:35 -04001412 }
1413}
1414# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001415pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1416 ForeignItemFn {
1417 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1418 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001419 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001420 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001421 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001422 }
1423}
1424# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001425pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001426 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001427 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1428 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001429 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001430 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001431 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001432 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001433 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001434 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001435 }
1436}
David Tolnay199bcbb2017-11-12 10:33:52 -08001437# [ cfg ( feature = "full" ) ]
1438pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1439 ForeignItemType {
1440 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1441 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001442 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001443 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001444 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001445 }
1446}
David Tolnay2ae520a2017-12-29 11:19:50 -05001447# [ cfg ( feature = "full" ) ]
1448pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1449 ForeignItemVerbatim {
1450 tts: _i . tts,
1451 }
1452}
Nika Layzell27726662017-10-24 23:16:35 -04001453
Nika Layzellc08227a2017-12-04 16:30:17 -05001454pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1455 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001456 match _i {
1457 Lifetime(_binding_0, ) => {
1458 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001459 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001460 )
1461 }
1462 Type(_binding_0, ) => {
1463 Type (
1464 _visitor.fold_type(_binding_0),
1465 )
1466 }
David Tolnay506e43a2017-12-29 11:34:36 -05001467 Binding(_binding_0, ) => {
1468 Binding (
1469 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001470 )
1471 }
Nika Layzellc680e612017-12-04 19:07:20 -05001472 Const(_binding_0, ) => {
1473 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001474 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001475 )
1476 }
Nika Layzell357885a2017-12-04 15:47:07 -05001477 }
1478}
David Tolnayd60cfec2017-12-29 00:21:38 -05001479# [ cfg ( feature = "full" ) ]
1480pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1481 use ::GenericMethodArgument::*;
1482 match _i {
1483 Type(_binding_0, ) => {
1484 Type (
1485 _visitor.fold_type(_binding_0),
1486 )
1487 }
1488 Const(_binding_0, ) => {
1489 Const (
1490 _visitor.fold_expr(_binding_0),
1491 )
1492 }
1493 }
1494}
Nika Layzell357885a2017-12-04 15:47:07 -05001495
David Tolnayc2f1aba2017-11-12 20:29:22 -08001496pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1497 use ::GenericParam::*;
1498 match _i {
1499 Lifetime(_binding_0, ) => {
1500 Lifetime (
1501 _visitor.fold_lifetime_def(_binding_0),
1502 )
1503 }
1504 Type(_binding_0, ) => {
1505 Type (
1506 _visitor.fold_type_param(_binding_0),
1507 )
1508 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001509 Const(_binding_0, ) => {
1510 Const (
1511 _visitor.fold_const_param(_binding_0),
1512 )
1513 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001514 }
1515}
1516
Nika Layzella6f46c42017-10-26 15:26:16 -04001517pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001518 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001519 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001520 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001521 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001522 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001523 }
1524}
1525# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001526pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001527 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001528 match _i {
1529 Const(_binding_0, ) => {
1530 Const (
1531 _visitor.fold_impl_item_const(_binding_0),
1532 )
1533 }
1534 Method(_binding_0, ) => {
1535 Method (
1536 _visitor.fold_impl_item_method(_binding_0),
1537 )
1538 }
1539 Type(_binding_0, ) => {
1540 Type (
1541 _visitor.fold_impl_item_type(_binding_0),
1542 )
1543 }
1544 Macro(_binding_0, ) => {
1545 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001546 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001547 )
1548 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001549 Verbatim(_binding_0, ) => {
1550 Verbatim (
1551 _visitor.fold_impl_item_verbatim(_binding_0),
1552 )
1553 }
Nika Layzell27726662017-10-24 23:16:35 -04001554 }
1555}
1556# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001557pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1558 ImplItemConst {
1559 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1560 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001561 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001562 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001563 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001564 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001565 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001566 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001567 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001568 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001569 }
1570}
1571# [ cfg ( feature = "full" ) ]
1572pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1573 ImplItemMacro {
1574 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1575 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001576 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001577 }
1578}
1579# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001580pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001581 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001582 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001583 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001584 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001585 sig: _visitor.fold_method_sig(_i . sig),
1586 block: _visitor.fold_block(_i . block),
1587 }
1588}
1589# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001590pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001591 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001592 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001593 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001594 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001595 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001596 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001597 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001598 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001599 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001600 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001601 }
1602}
David Tolnay2ae520a2017-12-29 11:19:50 -05001603# [ cfg ( feature = "full" ) ]
1604pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1605 ImplItemVerbatim {
1606 tts: _i . tts,
1607 }
1608}
David Tolnay14982012017-12-29 00:49:51 -05001609
David Tolnay85b69a42017-12-27 20:43:10 -05001610pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1611 Index {
1612 index: _i . index,
1613 span: _visitor.fold_span(_i . span),
1614 }
1615}
1616# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001617pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001618 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001619 match _i {
1620 ExternCrate(_binding_0, ) => {
1621 ExternCrate (
1622 _visitor.fold_item_extern_crate(_binding_0),
1623 )
1624 }
1625 Use(_binding_0, ) => {
1626 Use (
1627 _visitor.fold_item_use(_binding_0),
1628 )
1629 }
1630 Static(_binding_0, ) => {
1631 Static (
1632 _visitor.fold_item_static(_binding_0),
1633 )
1634 }
1635 Const(_binding_0, ) => {
1636 Const (
1637 _visitor.fold_item_const(_binding_0),
1638 )
1639 }
1640 Fn(_binding_0, ) => {
1641 Fn (
1642 _visitor.fold_item_fn(_binding_0),
1643 )
1644 }
1645 Mod(_binding_0, ) => {
1646 Mod (
1647 _visitor.fold_item_mod(_binding_0),
1648 )
1649 }
1650 ForeignMod(_binding_0, ) => {
1651 ForeignMod (
1652 _visitor.fold_item_foreign_mod(_binding_0),
1653 )
1654 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001655 Type(_binding_0, ) => {
1656 Type (
1657 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001658 )
1659 }
1660 Enum(_binding_0, ) => {
1661 Enum (
1662 _visitor.fold_item_enum(_binding_0),
1663 )
1664 }
1665 Struct(_binding_0, ) => {
1666 Struct (
1667 _visitor.fold_item_struct(_binding_0),
1668 )
1669 }
1670 Union(_binding_0, ) => {
1671 Union (
1672 _visitor.fold_item_union(_binding_0),
1673 )
1674 }
1675 Trait(_binding_0, ) => {
1676 Trait (
1677 _visitor.fold_item_trait(_binding_0),
1678 )
1679 }
Nika Layzell27726662017-10-24 23:16:35 -04001680 Impl(_binding_0, ) => {
1681 Impl (
1682 _visitor.fold_item_impl(_binding_0),
1683 )
1684 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001685 Macro(_binding_0, ) => {
1686 Macro (
1687 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001688 )
1689 }
David Tolnay500d8322017-12-18 00:32:51 -08001690 Macro2(_binding_0, ) => {
1691 Macro2 (
1692 _visitor.fold_item_macro2(_binding_0),
1693 )
1694 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001695 Verbatim(_binding_0, ) => {
1696 Verbatim (
1697 _visitor.fold_item_verbatim(_binding_0),
1698 )
1699 }
Nika Layzell27726662017-10-24 23:16:35 -04001700 }
1701}
1702# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001703pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1704 ItemConst {
1705 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1706 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001707 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001708 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001709 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001710 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001711 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001712 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001713 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001714 }
1715}
1716# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001717pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1718 ItemEnum {
1719 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1720 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001721 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001722 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001723 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001724 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001725 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1726 }
1727}
1728# [ cfg ( feature = "full" ) ]
1729pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1730 ItemExternCrate {
1731 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1732 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001733 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1734 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001735 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001736 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001737 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001738 _visitor.fold_ident(( it ) . 1),
1739 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001740 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001741 }
1742}
1743# [ cfg ( feature = "full" ) ]
1744pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1745 ItemFn {
1746 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1747 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001748 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001749 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001750 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001751 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001752 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001753 block: Box::new(_visitor.fold_block(* _i . block)),
1754 }
1755}
1756# [ cfg ( feature = "full" ) ]
1757pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1758 ItemForeignMod {
1759 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1760 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001761 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001762 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1763 }
1764}
1765# [ cfg ( feature = "full" ) ]
1766pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1767 ItemImpl {
1768 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001769 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001770 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001771 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001772 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001773 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001774 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001775 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001776 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001777 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001778 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001779 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001780 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1781 }
1782}
1783# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001784pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1785 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001787 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001788 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001789 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001790 }
1791}
1792# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001793pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1794 ItemMacro2 {
1795 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1796 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001797 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001798 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001799 args: _i . args,
1800 body: _i . body,
1801 }
1802}
1803# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001804pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001805 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001806 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001807 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001809 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001810 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001811 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001812 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1813 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001814 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001815 }
1816}
1817# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001818pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001819 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001821 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001822 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001823 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001824 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001825 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001826 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001828 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001829 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001830 }
1831}
1832# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001833pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001834 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001836 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001837 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001838 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001839 generics: _visitor.fold_generics(_i . generics),
1840 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001841 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001842 }
1843}
1844# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001845pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001846 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001847 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001848 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001849 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1851 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001852 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001853 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001854 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001855 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001856 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001857 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1858 }
1859}
1860# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001861pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1862 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001863 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001864 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001865 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001866 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001867 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001868 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001869 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001870 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001871 }
1872}
1873# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001874pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001875 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001876 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001877 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001878 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001879 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001880 generics: _visitor.fold_generics(_i . generics),
1881 data: _visitor.fold_variant_data(_i . data),
1882 }
1883}
1884# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001885pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001886 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001887 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001888 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1890 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001891 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1892 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001893 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001894 }
1895}
David Tolnay2ae520a2017-12-29 11:19:50 -05001896# [ cfg ( feature = "full" ) ]
1897pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1898 ItemVerbatim {
1899 tts: _i . tts,
1900 }
1901}
David Tolnaybcd498f2017-12-29 12:02:33 -05001902# [ cfg ( feature = "full" ) ]
1903pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1904 Label {
1905 name: _visitor.fold_lifetime(_i . name),
1906 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1907 }
1908}
Nika Layzell27726662017-10-24 23:16:35 -04001909
Nika Layzella6f46c42017-10-26 15:26:16 -04001910pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001911 LifetimeDef {
1912 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001913 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001914 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001915 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1916 }
1917}
1918
1919pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1920 Lit {
1921 value: _i . value,
1922 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001923 }
1924}
1925# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001926pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001927 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001928 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001929 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1930 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1931 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1932 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1933 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1934 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1935 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001936 }
1937}
Nika Layzell27726662017-10-24 23:16:35 -04001938
David Tolnaydecf28d2017-11-11 11:56:45 -08001939pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1940 Macro {
1941 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001942 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayfe9d2782017-12-29 11:32:42 -05001943 tt: _i . tt,
David Tolnaydecf28d2017-11-11 11:56:45 -08001944 }
1945}
David Tolnay14982012017-12-29 00:49:51 -05001946
David Tolnay85b69a42017-12-27 20:43:10 -05001947pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1948 use ::Member::*;
1949 match _i {
1950 Named(_binding_0, ) => {
1951 Named (
1952 _visitor.fold_ident(_binding_0),
1953 )
1954 }
1955 Unnamed(_binding_0, ) => {
1956 Unnamed (
1957 _visitor.fold_index(_binding_0),
1958 )
1959 }
1960 }
1961}
David Tolnaydecf28d2017-11-11 11:56:45 -08001962
Nika Layzella6f46c42017-10-26 15:26:16 -04001963pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001964 use ::MetaItem::*;
1965 match _i {
1966 Term(_binding_0, ) => {
1967 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001968 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001969 )
1970 }
1971 List(_binding_0, ) => {
1972 List (
1973 _visitor.fold_meta_item_list(_binding_0),
1974 )
1975 }
1976 NameValue(_binding_0, ) => {
1977 NameValue (
1978 _visitor.fold_meta_name_value(_binding_0),
1979 )
1980 }
1981 }
1982}
1983
Nika Layzella6f46c42017-10-26 15:26:16 -04001984pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001985 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001986 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001987 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001988 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1989 }
1990}
1991
Nika Layzella6f46c42017-10-26 15:26:16 -04001992pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001993 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001994 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001995 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001996 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001997 }
1998}
1999# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002000pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002001 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002002 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002003 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002004 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002005 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002006 decl: _visitor.fold_fn_decl(_i . decl),
2007 }
2008}
David Tolnayd60cfec2017-12-29 00:21:38 -05002009# [ cfg ( feature = "full" ) ]
2010pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2011 MethodTurbofish {
2012 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2013 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2014 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2015 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2016 }
2017}
Nika Layzell27726662017-10-24 23:16:35 -04002018
Nika Layzella6f46c42017-10-26 15:26:16 -04002019pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002020 use ::NestedMetaItem::*;
2021 match _i {
2022 MetaItem(_binding_0, ) => {
2023 MetaItem (
2024 _visitor.fold_meta_item(_binding_0),
2025 )
2026 }
2027 Literal(_binding_0, ) => {
2028 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002029 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002030 )
2031 }
2032 }
2033}
2034
Nika Layzellc08227a2017-12-04 16:30:17 -05002035pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2036 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002037 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002038 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002039 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002040 }
2041}
2042# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002043pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002044 use ::Pat::*;
2045 match _i {
2046 Wild(_binding_0, ) => {
2047 Wild (
2048 _visitor.fold_pat_wild(_binding_0),
2049 )
2050 }
2051 Ident(_binding_0, ) => {
2052 Ident (
2053 _visitor.fold_pat_ident(_binding_0),
2054 )
2055 }
2056 Struct(_binding_0, ) => {
2057 Struct (
2058 _visitor.fold_pat_struct(_binding_0),
2059 )
2060 }
2061 TupleStruct(_binding_0, ) => {
2062 TupleStruct (
2063 _visitor.fold_pat_tuple_struct(_binding_0),
2064 )
2065 }
2066 Path(_binding_0, ) => {
2067 Path (
2068 _visitor.fold_pat_path(_binding_0),
2069 )
2070 }
2071 Tuple(_binding_0, ) => {
2072 Tuple (
2073 _visitor.fold_pat_tuple(_binding_0),
2074 )
2075 }
2076 Box(_binding_0, ) => {
2077 Box (
2078 _visitor.fold_pat_box(_binding_0),
2079 )
2080 }
2081 Ref(_binding_0, ) => {
2082 Ref (
2083 _visitor.fold_pat_ref(_binding_0),
2084 )
2085 }
2086 Lit(_binding_0, ) => {
2087 Lit (
2088 _visitor.fold_pat_lit(_binding_0),
2089 )
2090 }
2091 Range(_binding_0, ) => {
2092 Range (
2093 _visitor.fold_pat_range(_binding_0),
2094 )
2095 }
2096 Slice(_binding_0, ) => {
2097 Slice (
2098 _visitor.fold_pat_slice(_binding_0),
2099 )
2100 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002101 Macro(_binding_0, ) => {
2102 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002103 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002104 )
2105 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002106 Verbatim(_binding_0, ) => {
2107 Verbatim (
2108 _visitor.fold_pat_verbatim(_binding_0),
2109 )
2110 }
Nika Layzell27726662017-10-24 23:16:35 -04002111 }
2112}
2113# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002114pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002115 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002116 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002117 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002118 }
2119}
2120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002121pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002122 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002123 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2124 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002125 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002126 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002127 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002128 }
2129}
2130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002132 PatLit {
2133 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2134 }
2135}
2136# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002137pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2138 PatMacro {
2139 mac: _visitor.fold_macro(_i . mac),
2140 }
2141}
2142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002143pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002144 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002145 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002146 path: _visitor.fold_path(_i . path),
2147 }
2148}
2149# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002150pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002151 PatRange {
2152 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002153 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002154 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002155 }
2156}
2157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002158pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002159 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002160 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002161 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002162 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
2164}
2165# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002166pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002167 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002168 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002169 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002170 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002171 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002172 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002173 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002174 }
2175}
2176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002177pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002178 PatStruct {
2179 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002180 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002181 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002182 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002183 }
2184}
2185# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002186pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002187 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002188 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002189 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002190 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002191 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2192 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002193 }
2194}
2195# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002196pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002197 PatTupleStruct {
2198 path: _visitor.fold_path(_i . path),
2199 pat: _visitor.fold_pat_tuple(_i . pat),
2200 }
2201}
2202# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002203pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2204 PatVerbatim {
2205 tts: _i . tts,
2206 }
2207}
2208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002209pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002210 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002211 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002212 }
2213}
2214
Nika Layzella6f46c42017-10-26 15:26:16 -04002215pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002216 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002217 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002218 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2219 }
2220}
Nika Layzellc08227a2017-12-04 16:30:17 -05002221
2222pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2223 use ::PathArguments::*;
2224 match _i {
2225 None => { None }
2226 AngleBracketed(_binding_0, ) => {
2227 AngleBracketed (
2228 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2229 )
2230 }
2231 Parenthesized(_binding_0, ) => {
2232 Parenthesized (
2233 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2234 )
2235 }
2236 }
2237}
Nika Layzell27726662017-10-24 23:16:35 -04002238
Nika Layzella6f46c42017-10-26 15:26:16 -04002239pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002240 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002241 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002242 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002243 }
2244}
Nika Layzell27726662017-10-24 23:16:35 -04002245
Nika Layzella6f46c42017-10-26 15:26:16 -04002246pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002247 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002248 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002249 trait_ref: _visitor.fold_path(_i . trait_ref),
2250 }
2251}
2252
Nika Layzella6f46c42017-10-26 15:26:16 -04002253pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002254 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002255 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002256 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002257 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002258 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2259 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002260 }
2261}
2262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002263pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002264 use ::RangeLimits::*;
2265 match _i {
2266 HalfOpen(_binding_0, ) => {
2267 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002268 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002269 )
2270 }
2271 Closed(_binding_0, ) => {
2272 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002273 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002274 )
2275 }
2276 }
2277}
David Tolnayf93b90d2017-11-11 19:21:26 -08002278
2279pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2280 use ::ReturnType::*;
2281 match _i {
2282 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002283 Type(_binding_0, _binding_1, ) => {
2284 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002285 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2286 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002287 )
2288 }
2289 }
2290}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002291
2292pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2293 _i
2294}
Nika Layzell27726662017-10-24 23:16:35 -04002295# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002296pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002297 use ::Stmt::*;
2298 match _i {
2299 Local(_binding_0, ) => {
2300 Local (
2301 Box::new(_visitor.fold_local(* _binding_0)),
2302 )
2303 }
2304 Item(_binding_0, ) => {
2305 Item (
2306 Box::new(_visitor.fold_item(* _binding_0)),
2307 )
2308 }
2309 Expr(_binding_0, ) => {
2310 Expr (
2311 Box::new(_visitor.fold_expr(* _binding_0)),
2312 )
2313 }
2314 Semi(_binding_0, _binding_1, ) => {
2315 Semi (
2316 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002317 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002318 )
2319 }
Nika Layzell27726662017-10-24 23:16:35 -04002320 }
2321}
2322
Nika Layzella6f46c42017-10-26 15:26:16 -04002323pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002324 use ::TraitBoundModifier::*;
2325 match _i {
2326 None => { None }
2327 Maybe(_binding_0, ) => {
2328 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002329 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002330 )
2331 }
2332 }
2333}
2334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002335pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002336 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002337 match _i {
2338 Const(_binding_0, ) => {
2339 Const (
2340 _visitor.fold_trait_item_const(_binding_0),
2341 )
2342 }
2343 Method(_binding_0, ) => {
2344 Method (
2345 _visitor.fold_trait_item_method(_binding_0),
2346 )
2347 }
2348 Type(_binding_0, ) => {
2349 Type (
2350 _visitor.fold_trait_item_type(_binding_0),
2351 )
2352 }
2353 Macro(_binding_0, ) => {
2354 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002355 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002356 )
2357 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002358 Verbatim(_binding_0, ) => {
2359 Verbatim (
2360 _visitor.fold_trait_item_verbatim(_binding_0),
2361 )
2362 }
Nika Layzell27726662017-10-24 23:16:35 -04002363 }
2364}
2365# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002366pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2367 TraitItemConst {
2368 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002370 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002371 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002372 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002373 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002374 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002375 _visitor.fold_expr(( it ) . 1),
2376 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002377 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002378 }
2379}
2380# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002381pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2382 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002383 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002384 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002385 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002386 }
2387}
2388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002389pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002390 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002391 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002392 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002393 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002394 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002395 }
2396}
2397# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002398pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002399 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002400 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002401 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002402 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002403 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002404 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002405 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002406 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002407 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002408 _visitor.fold_type(( it ) . 1),
2409 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002410 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002411 }
2412}
David Tolnay2ae520a2017-12-29 11:19:50 -05002413# [ cfg ( feature = "full" ) ]
2414pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2415 TraitItemVerbatim {
2416 tts: _i . tts,
2417 }
2418}
Nika Layzell27726662017-10-24 23:16:35 -04002419
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002420pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2421 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002422 match _i {
2423 Slice(_binding_0, ) => {
2424 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002426 )
2427 }
2428 Array(_binding_0, ) => {
2429 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002430 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002431 )
2432 }
2433 Ptr(_binding_0, ) => {
2434 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002435 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002438 Reference(_binding_0, ) => {
2439 Reference (
2440 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002441 )
2442 }
2443 BareFn(_binding_0, ) => {
2444 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002445 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
2448 Never(_binding_0, ) => {
2449 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002450 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002451 )
2452 }
David Tolnay05362582017-12-26 01:33:57 -05002453 Tuple(_binding_0, ) => {
2454 Tuple (
2455 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002456 )
2457 }
2458 Path(_binding_0, ) => {
2459 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002460 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002461 )
2462 }
2463 TraitObject(_binding_0, ) => {
2464 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002465 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002466 )
2467 }
2468 ImplTrait(_binding_0, ) => {
2469 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002471 )
2472 }
2473 Paren(_binding_0, ) => {
2474 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
2478 Group(_binding_0, ) => {
2479 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
2483 Infer(_binding_0, ) => {
2484 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002486 )
2487 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002488 Macro(_binding_0, ) => {
2489 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002490 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002493 Verbatim(_binding_0, ) => {
2494 Verbatim (
2495 _visitor.fold_type_verbatim(_binding_0),
2496 )
2497 }
Nika Layzell27726662017-10-24 23:16:35 -04002498 }
2499}
2500
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002501pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2502 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002503 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002504 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002505 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002506 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002507 }
2508}
2509
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002510pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2511 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002512 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2513 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2514 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2515 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2516 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2517 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2518 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2519 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002520 }
2521}
2522
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2524 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002525 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002526 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002527 }
2528}
2529
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002530pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2531 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002532 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002534 }
2535}
2536
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002537pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2538 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002539 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002540 }
2541}
2542
David Tolnay323279a2017-12-29 11:26:32 -05002543pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2544 TypeMacro {
2545 mac: _visitor.fold_macro(_i . mac),
2546 }
2547}
2548
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2550 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002551 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002552 }
2553}
2554
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002555pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2556 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002557 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002558 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002559 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002560 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002562 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002563 }
2564}
2565
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002566pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2567 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002568 match _i {
2569 Trait(_binding_0, _binding_1, ) => {
2570 Trait (
2571 _visitor.fold_poly_trait_ref(_binding_0),
2572 _visitor.fold_trait_bound_modifier(_binding_1),
2573 )
2574 }
2575 Region(_binding_0, ) => {
2576 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002577 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002578 )
2579 }
2580 }
2581}
2582
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2584 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002585 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002586 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002587 }
2588}
2589
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002590pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2591 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002592 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002593 path: _visitor.fold_path(_i . path),
2594 }
2595}
2596
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2598 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002599 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2600 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002601 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2602 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002603 }
2604}
2605
David Tolnay0a89b4d2017-11-13 00:55:45 -08002606pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2607 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002608 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002609 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002610 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2611 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002612 }
2613}
2614
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002615pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2616 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002617 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002618 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002619 }
2620}
2621
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2623 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002624 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002625 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002626 }
2627}
2628
David Tolnay05362582017-12-26 01:33:57 -05002629pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2630 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002631 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002632 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002633 }
2634}
2635
David Tolnay2ae520a2017-12-29 11:19:50 -05002636pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2637 TypeVerbatim {
2638 tts: _i . tts,
2639 }
2640}
2641
Nika Layzella6f46c42017-10-26 15:26:16 -04002642pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002643 use ::UnOp::*;
2644 match _i {
2645 Deref(_binding_0, ) => {
2646 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002647 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002648 )
2649 }
2650 Not(_binding_0, ) => {
2651 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002652 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 )
2654 }
2655 Neg(_binding_0, ) => {
2656 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002657 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002658 )
2659 }
2660 }
2661}
David Tolnay5f332a92017-12-26 00:42:45 -05002662# [ cfg ( feature = "full" ) ]
2663pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2664 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002665 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002666 }
2667}
2668# [ cfg ( feature = "full" ) ]
2669pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2670 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002671 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002672 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2673 }
2674}
2675# [ cfg ( feature = "full" ) ]
2676pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2677 UsePath {
2678 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002679 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002680 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002681 _visitor.fold_ident(( it ) . 1),
2682 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002683 }
2684}
2685# [ cfg ( feature = "full" ) ]
2686pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2687 use ::UseTree::*;
2688 match _i {
2689 Path(_binding_0, ) => {
2690 Path (
2691 _visitor.fold_use_path(_binding_0),
2692 )
2693 }
2694 Glob(_binding_0, ) => {
2695 Glob (
2696 _visitor.fold_use_glob(_binding_0),
2697 )
2698 }
2699 List(_binding_0, ) => {
2700 List (
2701 _visitor.fold_use_list(_binding_0),
2702 )
2703 }
2704 }
2705}
Nika Layzell27726662017-10-24 23:16:35 -04002706
Nika Layzella6f46c42017-10-26 15:26:16 -04002707pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002708 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002709 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002710 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002711 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002712 discriminant: (_i . discriminant).map(|it| { (
2713 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2714 _visitor.fold_expr(( it ) . 1),
2715 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002716 }
2717}
2718
Nika Layzella6f46c42017-10-26 15:26:16 -04002719pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002720 use ::VariantData::*;
2721 match _i {
2722 Struct(_binding_0, _binding_1, ) => {
2723 Struct (
2724 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002725 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002726 )
2727 }
2728 Tuple(_binding_0, _binding_1, ) => {
2729 Tuple (
2730 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002731 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002732 )
2733 }
2734 Unit => { Unit }
2735 }
2736}
Nika Layzell27726662017-10-24 23:16:35 -04002737
Nika Layzella6f46c42017-10-26 15:26:16 -04002738pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002739 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002740 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002741 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002742 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002743 }
2744}
2745
Nika Layzella6f46c42017-10-26 15:26:16 -04002746pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002747 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002748 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002749 }
2750}
2751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002753 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002755 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002756 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002757 path: Box::new(_visitor.fold_path(* _i . path)),
2758 }
2759}
2760
Nika Layzella6f46c42017-10-26 15:26:16 -04002761pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002762 use ::Visibility::*;
2763 match _i {
2764 Public(_binding_0, ) => {
2765 Public (
2766 _visitor.fold_vis_public(_binding_0),
2767 )
2768 }
2769 Crate(_binding_0, ) => {
2770 Crate (
2771 _visitor.fold_vis_crate(_binding_0),
2772 )
2773 }
2774 Restricted(_binding_0, ) => {
2775 Restricted (
2776 _visitor.fold_vis_restricted(_binding_0),
2777 )
2778 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002779 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002780 }
2781}
2782
Nika Layzella6f46c42017-10-26 15:26:16 -04002783pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002784 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002785 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002786 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002787 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002788 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002789 }
2790}
2791
Nika Layzella6f46c42017-10-26 15:26:16 -04002792pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002793 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002795 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2796 }
2797}
2798
Nika Layzella6f46c42017-10-26 15:26:16 -04002799pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002800 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002801 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002802 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002803 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002804 }
2805}
2806
Nika Layzella6f46c42017-10-26 15:26:16 -04002807pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002808 use ::WherePredicate::*;
2809 match _i {
2810 BoundPredicate(_binding_0, ) => {
2811 BoundPredicate (
2812 _visitor.fold_where_bound_predicate(_binding_0),
2813 )
2814 }
2815 RegionPredicate(_binding_0, ) => {
2816 RegionPredicate (
2817 _visitor.fold_where_region_predicate(_binding_0),
2818 )
2819 }
2820 EqPredicate(_binding_0, ) => {
2821 EqPredicate (
2822 _visitor.fold_where_eq_predicate(_binding_0),
2823 )
2824 }
2825 }
2826}
2827
Nika Layzella6f46c42017-10-26 15:26:16 -04002828pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002829 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002830 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002831 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002832 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002833 }
2834}
2835