blob: 3013ab56589b32ccad7bacb4337f0da2616a331d [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 Tolnay8b4d3022017-12-29 12:11:10 -0500456 guard: (_i . guard).map(|it| { (
457 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
458 Box::new(_visitor.fold_expr(* ( it ) . 1)),
459 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400461 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400463 }
464}
465
Nika Layzella6f46c42017-10-26 15:26:16 -0400466pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400467 use ::AttrStyle::*;
468 match _i {
469 Outer => { Outer }
470 Inner(_binding_0, ) => {
471 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500472 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400473 )
474 }
475 }
476}
477
Nika Layzella6f46c42017-10-26 15:26:16 -0400478pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400479 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500480 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500481 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500482 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400483 path: _visitor.fold_path(_i . path),
484 tts: _i . tts,
485 is_sugared_doc: _i . is_sugared_doc,
486 }
487}
488
Nika Layzella6f46c42017-10-26 15:26:16 -0400489pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400490 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500491 name: (_i . name).map(|it| { (
492 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500493 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500494 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800495 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400496 }
497}
498
Nika Layzella6f46c42017-10-26 15:26:16 -0400499pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400500 use ::BareFnArgName::*;
501 match _i {
502 Named(_binding_0, ) => {
503 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500504 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400505 )
506 }
507 Wild(_binding_0, ) => {
508 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500509 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400510 )
511 }
512 }
513}
514
Nika Layzella6f46c42017-10-26 15:26:16 -0400515pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400516 use ::BinOp::*;
517 match _i {
518 Add(_binding_0, ) => {
519 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500520 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400521 )
522 }
523 Sub(_binding_0, ) => {
524 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500525 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400526 )
527 }
528 Mul(_binding_0, ) => {
529 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500530 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400531 )
532 }
533 Div(_binding_0, ) => {
534 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500535 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400536 )
537 }
538 Rem(_binding_0, ) => {
539 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500540 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
543 And(_binding_0, ) => {
544 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 Or(_binding_0, ) => {
549 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500550 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400551 )
552 }
553 BitXor(_binding_0, ) => {
554 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
558 BitAnd(_binding_0, ) => {
559 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
563 BitOr(_binding_0, ) => {
564 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
568 Shl(_binding_0, ) => {
569 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
573 Shr(_binding_0, ) => {
574 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
578 Eq(_binding_0, ) => {
579 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
583 Lt(_binding_0, ) => {
584 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
588 Le(_binding_0, ) => {
589 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
593 Ne(_binding_0, ) => {
594 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
598 Ge(_binding_0, ) => {
599 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
603 Gt(_binding_0, ) => {
604 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
608 AddEq(_binding_0, ) => {
609 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
613 SubEq(_binding_0, ) => {
614 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
618 MulEq(_binding_0, ) => {
619 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
623 DivEq(_binding_0, ) => {
624 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
628 RemEq(_binding_0, ) => {
629 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
633 BitXorEq(_binding_0, ) => {
634 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
638 BitAndEq(_binding_0, ) => {
639 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
643 BitOrEq(_binding_0, ) => {
644 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
648 ShlEq(_binding_0, ) => {
649 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
653 ShrEq(_binding_0, ) => {
654 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
658 }
659}
David Tolnay506e43a2017-12-29 11:34:36 -0500660
661pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
662 Binding {
663 ident: _visitor.fold_ident(_i . ident),
664 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
665 ty: _visitor.fold_type(_i . ty),
666 }
667}
Nika Layzell27726662017-10-24 23:16:35 -0400668# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400669pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400670 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500671 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400672 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
673 }
674}
675
Nika Layzella6f46c42017-10-26 15:26:16 -0400676pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400677 use ::Body::*;
678 match _i {
679 Enum(_binding_0, ) => {
680 Enum (
681 _visitor.fold_body_enum(_binding_0),
682 )
683 }
684 Struct(_binding_0, ) => {
685 Struct (
686 _visitor.fold_body_struct(_binding_0),
687 )
688 }
689 }
690}
691
Nika Layzella6f46c42017-10-26 15:26:16 -0400692pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400693 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500694 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500695 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400696 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
697 }
698}
699
Nika Layzella6f46c42017-10-26 15:26:16 -0400700pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400701 BodyStruct {
702 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500703 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
704 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400705 }
706}
707
Nika Layzella6f46c42017-10-26 15:26:16 -0400708pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400709 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500710 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
711 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400712 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500713 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400714 }
715}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500716
717pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
718 ConstParam {
719 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500721 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500722 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500723 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500724 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500725 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
726 }
727}
Nika Layzell27726662017-10-24 23:16:35 -0400728
Nika Layzella6f46c42017-10-26 15:26:16 -0400729pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400730 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400731 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500732 vis: _visitor.fold_visibility(_i . vis),
733 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400734 generics: _visitor.fold_generics(_i . generics),
735 body: _visitor.fold_body(_i . body),
736 }
737}
738
Nika Layzella6f46c42017-10-26 15:26:16 -0400739pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500740 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400741 match _i {
742 Box(_binding_0, ) => {
743 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400744 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400745 )
746 }
747 InPlace(_binding_0, ) => {
748 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400749 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400750 )
751 }
752 Array(_binding_0, ) => {
753 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400754 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400755 )
756 }
757 Call(_binding_0, ) => {
758 Call (
759 _visitor.fold_expr_call(_binding_0),
760 )
761 }
762 MethodCall(_binding_0, ) => {
763 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400764 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400765 )
766 }
David Tolnay05362582017-12-26 01:33:57 -0500767 Tuple(_binding_0, ) => {
768 Tuple (
769 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400770 )
771 }
772 Binary(_binding_0, ) => {
773 Binary (
774 _visitor.fold_expr_binary(_binding_0),
775 )
776 }
777 Unary(_binding_0, ) => {
778 Unary (
779 _visitor.fold_expr_unary(_binding_0),
780 )
781 }
782 Lit(_binding_0, ) => {
783 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500784 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400785 )
786 }
787 Cast(_binding_0, ) => {
788 Cast (
789 _visitor.fold_expr_cast(_binding_0),
790 )
791 }
792 Type(_binding_0, ) => {
793 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500794 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400795 )
796 }
797 If(_binding_0, ) => {
798 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400799 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
802 IfLet(_binding_0, ) => {
803 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400804 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 )
806 }
807 While(_binding_0, ) => {
808 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
812 WhileLet(_binding_0, ) => {
813 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
817 ForLoop(_binding_0, ) => {
818 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400819 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
822 Loop(_binding_0, ) => {
823 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
827 Match(_binding_0, ) => {
828 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400829 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
832 Closure(_binding_0, ) => {
833 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
Nika Layzell640832a2017-12-04 13:37:09 -0500837 Unsafe(_binding_0, ) => {
838 Unsafe (
839 full!(_visitor.fold_expr_unsafe(_binding_0)),
840 )
841 }
Nika Layzell27726662017-10-24 23:16:35 -0400842 Block(_binding_0, ) => {
843 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
847 Assign(_binding_0, ) => {
848 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
852 AssignOp(_binding_0, ) => {
853 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400854 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
857 Field(_binding_0, ) => {
858 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
Nika Layzell27726662017-10-24 23:16:35 -0400862 Index(_binding_0, ) => {
863 Index (
864 _visitor.fold_expr_index(_binding_0),
865 )
866 }
867 Range(_binding_0, ) => {
868 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
872 Path(_binding_0, ) => {
873 Path (
874 _visitor.fold_expr_path(_binding_0),
875 )
876 }
877 AddrOf(_binding_0, ) => {
878 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
882 Break(_binding_0, ) => {
883 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
887 Continue(_binding_0, ) => {
888 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
David Tolnayc246cd32017-12-28 23:14:32 -0500892 Return(_binding_0, ) => {
893 Return (
894 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800897 Macro(_binding_0, ) => {
898 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500899 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
902 Struct(_binding_0, ) => {
903 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
907 Repeat(_binding_0, ) => {
908 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400909 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400910 )
911 }
912 Paren(_binding_0, ) => {
913 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500914 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Group(_binding_0, ) => {
918 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500919 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
922 Try(_binding_0, ) => {
923 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
927 Catch(_binding_0, ) => {
928 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
932 Yield(_binding_0, ) => {
933 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400934 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500937 Verbatim(_binding_0, ) => {
938 Verbatim (
939 _visitor.fold_expr_verbatim(_binding_0),
940 )
941 }
Nika Layzell27726662017-10-24 23:16:35 -0400942 }
943}
944# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500945pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
946 ExprAddrOf {
947 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
948 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500949 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500950 expr: Box::new(_visitor.fold_expr(* _i . expr)),
951 }
952}
953# [ cfg ( feature = "full" ) ]
954pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
955 ExprArray {
956 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
957 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500958 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500959 }
960}
961# [ cfg ( feature = "full" ) ]
962pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
963 ExprAssign {
964 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
965 left: Box::new(_visitor.fold_expr(* _i . left)),
966 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
967 right: Box::new(_visitor.fold_expr(* _i . right)),
968 }
969}
970# [ cfg ( feature = "full" ) ]
971pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
972 ExprAssignOp {
973 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
974 left: Box::new(_visitor.fold_expr(* _i . left)),
975 op: _visitor.fold_bin_op(_i . op),
976 right: Box::new(_visitor.fold_expr(* _i . right)),
977 }
978}
979
980pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
981 ExprBinary {
982 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
983 left: Box::new(_visitor.fold_expr(* _i . left)),
984 op: _visitor.fold_bin_op(_i . op),
985 right: Box::new(_visitor.fold_expr(* _i . right)),
986 }
987}
988# [ cfg ( feature = "full" ) ]
989pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
990 ExprBlock {
991 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
992 block: _visitor.fold_block(_i . block),
993 }
994}
995# [ cfg ( feature = "full" ) ]
996pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
997 ExprBox {
998 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
999 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1000 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1001 }
1002}
1003# [ cfg ( feature = "full" ) ]
1004pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1005 ExprBreak {
1006 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1007 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1008 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1009 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1010 }
1011}
1012
1013pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1014 ExprCall {
1015 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1016 func: Box::new(_visitor.fold_expr(* _i . func)),
1017 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1018 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1019 }
1020}
1021
1022pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1023 ExprCast {
1024 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1025 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1026 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1027 ty: Box::new(_visitor.fold_type(* _i . ty)),
1028 }
1029}
1030# [ cfg ( feature = "full" ) ]
1031pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1032 ExprCatch {
1033 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1034 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1035 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1036 block: _visitor.fold_block(_i . block),
1037 }
1038}
1039# [ cfg ( feature = "full" ) ]
1040pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1041 ExprClosure {
1042 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001043 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001044 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1045 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1046 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1047 output: _visitor.fold_return_type(_i . output),
1048 body: Box::new(_visitor.fold_expr(* _i . body)),
1049 }
1050}
1051# [ cfg ( feature = "full" ) ]
1052pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1053 ExprContinue {
1054 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1055 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1056 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1057 }
1058}
1059# [ cfg ( feature = "full" ) ]
1060pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1061 ExprField {
1062 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1063 base: Box::new(_visitor.fold_expr(* _i . base)),
1064 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1065 member: _visitor.fold_member(_i . member),
1066 }
1067}
1068# [ cfg ( feature = "full" ) ]
1069pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1070 ExprForLoop {
1071 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001072 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001073 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1074 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1075 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1076 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1077 body: _visitor.fold_block(_i . body),
1078 }
1079}
David Tolnaye98775f2017-12-28 23:17:00 -05001080# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001081pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1082 ExprGroup {
1083 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1084 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1085 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1086 }
1087}
1088# [ cfg ( feature = "full" ) ]
1089pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1090 ExprIf {
1091 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1092 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1093 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001094 then_branch: _visitor.fold_block(_i . then_branch),
1095 else_branch: (_i . else_branch).map(|it| { (
1096 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1097 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1098 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001099 }
1100}
1101# [ cfg ( feature = "full" ) ]
1102pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1103 ExprIfLet {
1104 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1105 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1106 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1107 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1108 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1109 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001110 then_branch: _visitor.fold_block(_i . then_branch),
1111 else_branch: (_i . else_branch).map(|it| { (
1112 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1113 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1114 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001115 }
1116}
1117# [ cfg ( feature = "full" ) ]
1118pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1119 ExprInPlace {
1120 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1121 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001122 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001123 value: Box::new(_visitor.fold_expr(* _i . value)),
1124 }
1125}
1126
1127pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1128 ExprIndex {
1129 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1130 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1131 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1132 index: Box::new(_visitor.fold_expr(* _i . index)),
1133 }
1134}
1135
1136pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1137 ExprLit {
1138 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1139 lit: _visitor.fold_lit(_i . lit),
1140 }
1141}
1142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001143pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001144 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001145 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001146 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001147 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1148 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001149 }
1150}
1151# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001152pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1153 ExprMacro {
1154 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1155 mac: _visitor.fold_macro(_i . mac),
1156 }
1157}
1158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001159pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001160 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001161 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001162 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001164 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001165 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1166 }
1167}
1168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001169pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001170 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001171 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001172 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001173 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001174 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001175 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001176 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1177 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
1179}
David Tolnaye98775f2017-12-28 23:17:00 -05001180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001181pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001182 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001183 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001184 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001185 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
1187}
1188
Nika Layzella6f46c42017-10-26 15:26:16 -04001189pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001190 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001191 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001192 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001193 path: _visitor.fold_path(_i . path),
1194 }
1195}
1196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001197pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001198 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001199 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001200 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001202 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
1204}
1205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001206pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001207 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001208 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001209 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001211 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001212 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1213 }
1214}
1215# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001216pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1217 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001218 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001219 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001220 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
1222}
1223# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001224pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001225 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001226 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001227 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001228 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001229 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1230 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1231 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
1233}
1234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001235pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001236 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001237 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001239 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
1242# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001243pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1244 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001246 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001247 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001248 }
1249}
David Tolnay0cf94f22017-12-28 23:46:26 -05001250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001254 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001255 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001256 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
1258}
1259
Nika Layzella6f46c42017-10-26 15:26:16 -04001260pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001261 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001262 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001263 op: _visitor.fold_un_op(_i . op),
1264 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1265 }
1266}
1267# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001268pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1269 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001270 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001271 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001272 block: _visitor.fold_block(_i . block),
1273 }
1274}
David Tolnay2ae520a2017-12-29 11:19:50 -05001275
1276pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1277 ExprVerbatim {
1278 tts: _i . tts,
1279 }
1280}
Nika Layzell640832a2017-12-04 13:37:09 -05001281# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001282pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001283 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001284 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001285 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001286 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001287 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1288 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001289 }
1290}
1291# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001292pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001293 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001294 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaybcd498f2017-12-29 12:02:33 -05001295 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001296 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1297 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001298 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001299 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001300 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1301 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001302 }
1303}
1304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001305pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001307 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001308 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001309 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001310 }
1311}
1312
Nika Layzella6f46c42017-10-26 15:26:16 -04001313pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001314 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001315 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001316 vis: _visitor.fold_visibility(_i . vis),
1317 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001318 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001319 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001320 }
1321}
1322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001323pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001324 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001325 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001326 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001327 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001328 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001329 }
1330}
1331# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001332pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001333 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001334 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1335 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001336 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001337 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001338 }
1339}
1340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001341pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001342 File {
1343 shebang: _i . shebang,
1344 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1345 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1346 }
1347}
1348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001349pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001350 use ::FnArg::*;
1351 match _i {
1352 SelfRef(_binding_0, ) => {
1353 SelfRef (
1354 _visitor.fold_arg_self_ref(_binding_0),
1355 )
1356 }
1357 SelfValue(_binding_0, ) => {
1358 SelfValue (
1359 _visitor.fold_arg_self(_binding_0),
1360 )
1361 }
1362 Captured(_binding_0, ) => {
1363 Captured (
1364 _visitor.fold_arg_captured(_binding_0),
1365 )
1366 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001367 Inferred(_binding_0, ) => {
1368 Inferred (
1369 _visitor.fold_pat(_binding_0),
1370 )
1371 }
Nika Layzell27726662017-10-24 23:16:35 -04001372 Ignored(_binding_0, ) => {
1373 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001374 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001375 )
1376 }
1377 }
1378}
1379# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001380pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001381 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001382 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001383 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001384 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001385 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001386 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001387 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001388 }
1389}
1390# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001391pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001392 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001393 match _i {
1394 Fn(_binding_0, ) => {
1395 Fn (
1396 _visitor.fold_foreign_item_fn(_binding_0),
1397 )
1398 }
1399 Static(_binding_0, ) => {
1400 Static (
1401 _visitor.fold_foreign_item_static(_binding_0),
1402 )
1403 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001404 Type(_binding_0, ) => {
1405 Type (
1406 _visitor.fold_foreign_item_type(_binding_0),
1407 )
1408 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001409 Verbatim(_binding_0, ) => {
1410 Verbatim (
1411 _visitor.fold_foreign_item_verbatim(_binding_0),
1412 )
1413 }
Nika Layzell27726662017-10-24 23:16:35 -04001414 }
1415}
1416# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001417pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1418 ForeignItemFn {
1419 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1420 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001421 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001422 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001423 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001424 }
1425}
1426# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001427pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001428 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001429 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1430 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001431 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001432 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001433 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001434 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001435 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001436 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001437 }
1438}
David Tolnay199bcbb2017-11-12 10:33:52 -08001439# [ cfg ( feature = "full" ) ]
1440pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1441 ForeignItemType {
1442 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1443 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001444 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001445 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001446 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001447 }
1448}
David Tolnay2ae520a2017-12-29 11:19:50 -05001449# [ cfg ( feature = "full" ) ]
1450pub fn fold_foreign_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1451 ForeignItemVerbatim {
1452 tts: _i . tts,
1453 }
1454}
Nika Layzell27726662017-10-24 23:16:35 -04001455
Nika Layzellc08227a2017-12-04 16:30:17 -05001456pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1457 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001458 match _i {
1459 Lifetime(_binding_0, ) => {
1460 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001461 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001462 )
1463 }
1464 Type(_binding_0, ) => {
1465 Type (
1466 _visitor.fold_type(_binding_0),
1467 )
1468 }
David Tolnay506e43a2017-12-29 11:34:36 -05001469 Binding(_binding_0, ) => {
1470 Binding (
1471 _visitor.fold_binding(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001472 )
1473 }
Nika Layzellc680e612017-12-04 19:07:20 -05001474 Const(_binding_0, ) => {
1475 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001476 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001477 )
1478 }
Nika Layzell357885a2017-12-04 15:47:07 -05001479 }
1480}
David Tolnayd60cfec2017-12-29 00:21:38 -05001481# [ cfg ( feature = "full" ) ]
1482pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1483 use ::GenericMethodArgument::*;
1484 match _i {
1485 Type(_binding_0, ) => {
1486 Type (
1487 _visitor.fold_type(_binding_0),
1488 )
1489 }
1490 Const(_binding_0, ) => {
1491 Const (
1492 _visitor.fold_expr(_binding_0),
1493 )
1494 }
1495 }
1496}
Nika Layzell357885a2017-12-04 15:47:07 -05001497
David Tolnayc2f1aba2017-11-12 20:29:22 -08001498pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1499 use ::GenericParam::*;
1500 match _i {
1501 Lifetime(_binding_0, ) => {
1502 Lifetime (
1503 _visitor.fold_lifetime_def(_binding_0),
1504 )
1505 }
1506 Type(_binding_0, ) => {
1507 Type (
1508 _visitor.fold_type_param(_binding_0),
1509 )
1510 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001511 Const(_binding_0, ) => {
1512 Const (
1513 _visitor.fold_const_param(_binding_0),
1514 )
1515 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001516 }
1517}
1518
Nika Layzella6f46c42017-10-26 15:26:16 -04001519pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001520 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001521 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001522 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001523 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001524 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001525 }
1526}
1527# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001528pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001529 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001530 match _i {
1531 Const(_binding_0, ) => {
1532 Const (
1533 _visitor.fold_impl_item_const(_binding_0),
1534 )
1535 }
1536 Method(_binding_0, ) => {
1537 Method (
1538 _visitor.fold_impl_item_method(_binding_0),
1539 )
1540 }
1541 Type(_binding_0, ) => {
1542 Type (
1543 _visitor.fold_impl_item_type(_binding_0),
1544 )
1545 }
1546 Macro(_binding_0, ) => {
1547 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001548 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001549 )
1550 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001551 Verbatim(_binding_0, ) => {
1552 Verbatim (
1553 _visitor.fold_impl_item_verbatim(_binding_0),
1554 )
1555 }
Nika Layzell27726662017-10-24 23:16:35 -04001556 }
1557}
1558# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001559pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1560 ImplItemConst {
1561 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1562 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001563 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001564 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001565 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001566 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001567 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001568 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001569 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001570 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001571 }
1572}
1573# [ cfg ( feature = "full" ) ]
1574pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1575 ImplItemMacro {
1576 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1577 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001578 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001579 }
1580}
1581# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001582pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001583 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001584 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001585 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001586 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001587 sig: _visitor.fold_method_sig(_i . sig),
1588 block: _visitor.fold_block(_i . block),
1589 }
1590}
1591# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001592pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001593 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001594 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001595 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001596 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001597 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001598 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001599 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001600 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001601 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001602 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001603 }
1604}
David Tolnay2ae520a2017-12-29 11:19:50 -05001605# [ cfg ( feature = "full" ) ]
1606pub fn fold_impl_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1607 ImplItemVerbatim {
1608 tts: _i . tts,
1609 }
1610}
David Tolnay14982012017-12-29 00:49:51 -05001611
David Tolnay85b69a42017-12-27 20:43:10 -05001612pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1613 Index {
1614 index: _i . index,
1615 span: _visitor.fold_span(_i . span),
1616 }
1617}
1618# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001619pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001620 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001621 match _i {
1622 ExternCrate(_binding_0, ) => {
1623 ExternCrate (
1624 _visitor.fold_item_extern_crate(_binding_0),
1625 )
1626 }
1627 Use(_binding_0, ) => {
1628 Use (
1629 _visitor.fold_item_use(_binding_0),
1630 )
1631 }
1632 Static(_binding_0, ) => {
1633 Static (
1634 _visitor.fold_item_static(_binding_0),
1635 )
1636 }
1637 Const(_binding_0, ) => {
1638 Const (
1639 _visitor.fold_item_const(_binding_0),
1640 )
1641 }
1642 Fn(_binding_0, ) => {
1643 Fn (
1644 _visitor.fold_item_fn(_binding_0),
1645 )
1646 }
1647 Mod(_binding_0, ) => {
1648 Mod (
1649 _visitor.fold_item_mod(_binding_0),
1650 )
1651 }
1652 ForeignMod(_binding_0, ) => {
1653 ForeignMod (
1654 _visitor.fold_item_foreign_mod(_binding_0),
1655 )
1656 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001657 Type(_binding_0, ) => {
1658 Type (
1659 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001660 )
1661 }
1662 Enum(_binding_0, ) => {
1663 Enum (
1664 _visitor.fold_item_enum(_binding_0),
1665 )
1666 }
1667 Struct(_binding_0, ) => {
1668 Struct (
1669 _visitor.fold_item_struct(_binding_0),
1670 )
1671 }
1672 Union(_binding_0, ) => {
1673 Union (
1674 _visitor.fold_item_union(_binding_0),
1675 )
1676 }
1677 Trait(_binding_0, ) => {
1678 Trait (
1679 _visitor.fold_item_trait(_binding_0),
1680 )
1681 }
Nika Layzell27726662017-10-24 23:16:35 -04001682 Impl(_binding_0, ) => {
1683 Impl (
1684 _visitor.fold_item_impl(_binding_0),
1685 )
1686 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001687 Macro(_binding_0, ) => {
1688 Macro (
1689 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001690 )
1691 }
David Tolnay500d8322017-12-18 00:32:51 -08001692 Macro2(_binding_0, ) => {
1693 Macro2 (
1694 _visitor.fold_item_macro2(_binding_0),
1695 )
1696 }
David Tolnay2ae520a2017-12-29 11:19:50 -05001697 Verbatim(_binding_0, ) => {
1698 Verbatim (
1699 _visitor.fold_item_verbatim(_binding_0),
1700 )
1701 }
Nika Layzell27726662017-10-24 23:16:35 -04001702 }
1703}
1704# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001705pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1706 ItemConst {
1707 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1708 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001709 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001710 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001711 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001712 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001713 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001714 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001715 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001716 }
1717}
1718# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001719pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1720 ItemEnum {
1721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1722 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001723 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001724 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001725 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001726 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001727 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1728 }
1729}
1730# [ cfg ( feature = "full" ) ]
1731pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1732 ItemExternCrate {
1733 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1734 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001735 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1736 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001737 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001738 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001739 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001740 _visitor.fold_ident(( it ) . 1),
1741 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001742 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743 }
1744}
1745# [ cfg ( feature = "full" ) ]
1746pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1747 ItemFn {
1748 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1749 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001750 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001751 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001752 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001753 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001754 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001755 block: Box::new(_visitor.fold_block(* _i . block)),
1756 }
1757}
1758# [ cfg ( feature = "full" ) ]
1759pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1760 ItemForeignMod {
1761 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1762 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001763 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001764 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1765 }
1766}
1767# [ cfg ( feature = "full" ) ]
1768pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1769 ItemImpl {
1770 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001771 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001772 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001773 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001774 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001775 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001776 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001777 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001779 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001780 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001781 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001782 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1783 }
1784}
1785# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001786pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1787 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001788 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001789 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001790 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001791 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 }
1793}
1794# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001795pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1796 ItemMacro2 {
1797 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1798 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001799 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001800 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001801 args: _i . args,
1802 body: _i . body,
1803 }
1804}
1805# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001806pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001807 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001809 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001811 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001812 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001813 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001814 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1815 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001816 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001817 }
1818}
1819# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001820pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001821 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001822 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001823 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001824 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001825 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001826 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001828 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001829 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001830 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001832 }
1833}
1834# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001835pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001836 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001837 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001838 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001839 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001840 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001841 generics: _visitor.fold_generics(_i . generics),
1842 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001843 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001844 }
1845}
1846# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001847pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001848 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001850 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001851 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001852 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1853 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001854 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001855 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001857 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001858 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001859 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1860 }
1861}
1862# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001863pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1864 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001865 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001866 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001868 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001869 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001870 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001871 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001872 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001873 }
1874}
1875# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001876pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001877 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001878 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001879 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001880 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001881 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001882 generics: _visitor.fold_generics(_i . generics),
1883 data: _visitor.fold_variant_data(_i . data),
1884 }
1885}
1886# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001888 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1892 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001893 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1894 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001896 }
1897}
David Tolnay2ae520a2017-12-29 11:19:50 -05001898# [ cfg ( feature = "full" ) ]
1899pub fn fold_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1900 ItemVerbatim {
1901 tts: _i . tts,
1902 }
1903}
David Tolnaybcd498f2017-12-29 12:02:33 -05001904# [ cfg ( feature = "full" ) ]
1905pub fn fold_label<V: Folder + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1906 Label {
1907 name: _visitor.fold_lifetime(_i . name),
1908 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1909 }
1910}
Nika Layzell27726662017-10-24 23:16:35 -04001911
Nika Layzella6f46c42017-10-26 15:26:16 -04001912pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001913 LifetimeDef {
1914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001915 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001917 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1918 }
1919}
1920
1921pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1922 Lit {
1923 value: _i . value,
1924 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001925 }
1926}
1927# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001928pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001929 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001930 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001931 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1932 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay8b4d3022017-12-29 12:11:10 -05001933 ty: (_i . ty).map(|it| { (
1934 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
1935 Box::new(_visitor.fold_type(* ( it ) . 1)),
1936 ) }),
1937 init: (_i . init).map(|it| { (
1938 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
1939 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1940 ) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001941 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001942 }
1943}
Nika Layzell27726662017-10-24 23:16:35 -04001944
David Tolnaydecf28d2017-11-11 11:56:45 -08001945pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1946 Macro {
1947 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001948 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayfe9d2782017-12-29 11:32:42 -05001949 tt: _i . tt,
David Tolnaydecf28d2017-11-11 11:56:45 -08001950 }
1951}
David Tolnay14982012017-12-29 00:49:51 -05001952
David Tolnay85b69a42017-12-27 20:43:10 -05001953pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1954 use ::Member::*;
1955 match _i {
1956 Named(_binding_0, ) => {
1957 Named (
1958 _visitor.fold_ident(_binding_0),
1959 )
1960 }
1961 Unnamed(_binding_0, ) => {
1962 Unnamed (
1963 _visitor.fold_index(_binding_0),
1964 )
1965 }
1966 }
1967}
David Tolnaydecf28d2017-11-11 11:56:45 -08001968
Nika Layzella6f46c42017-10-26 15:26:16 -04001969pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001970 use ::MetaItem::*;
1971 match _i {
1972 Term(_binding_0, ) => {
1973 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001974 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001975 )
1976 }
1977 List(_binding_0, ) => {
1978 List (
1979 _visitor.fold_meta_item_list(_binding_0),
1980 )
1981 }
1982 NameValue(_binding_0, ) => {
1983 NameValue (
1984 _visitor.fold_meta_name_value(_binding_0),
1985 )
1986 }
1987 }
1988}
1989
Nika Layzella6f46c42017-10-26 15:26:16 -04001990pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001991 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001992 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001993 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001994 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1995 }
1996}
1997
Nika Layzella6f46c42017-10-26 15:26:16 -04001998pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001999 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002000 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002001 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002002 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002003 }
2004}
2005# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002006pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002007 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05002008 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05002009 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002010 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002011 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002012 decl: _visitor.fold_fn_decl(_i . decl),
2013 }
2014}
David Tolnayd60cfec2017-12-29 00:21:38 -05002015# [ cfg ( feature = "full" ) ]
2016pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2017 MethodTurbofish {
2018 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2019 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2020 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2021 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2022 }
2023}
Nika Layzell27726662017-10-24 23:16:35 -04002024
Nika Layzella6f46c42017-10-26 15:26:16 -04002025pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002026 use ::NestedMetaItem::*;
2027 match _i {
2028 MetaItem(_binding_0, ) => {
2029 MetaItem (
2030 _visitor.fold_meta_item(_binding_0),
2031 )
2032 }
2033 Literal(_binding_0, ) => {
2034 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002035 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002036 )
2037 }
2038 }
2039}
2040
Nika Layzellc08227a2017-12-04 16:30:17 -05002041pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2042 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002043 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002044 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002045 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002046 }
2047}
2048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002049pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002050 use ::Pat::*;
2051 match _i {
2052 Wild(_binding_0, ) => {
2053 Wild (
2054 _visitor.fold_pat_wild(_binding_0),
2055 )
2056 }
2057 Ident(_binding_0, ) => {
2058 Ident (
2059 _visitor.fold_pat_ident(_binding_0),
2060 )
2061 }
2062 Struct(_binding_0, ) => {
2063 Struct (
2064 _visitor.fold_pat_struct(_binding_0),
2065 )
2066 }
2067 TupleStruct(_binding_0, ) => {
2068 TupleStruct (
2069 _visitor.fold_pat_tuple_struct(_binding_0),
2070 )
2071 }
2072 Path(_binding_0, ) => {
2073 Path (
2074 _visitor.fold_pat_path(_binding_0),
2075 )
2076 }
2077 Tuple(_binding_0, ) => {
2078 Tuple (
2079 _visitor.fold_pat_tuple(_binding_0),
2080 )
2081 }
2082 Box(_binding_0, ) => {
2083 Box (
2084 _visitor.fold_pat_box(_binding_0),
2085 )
2086 }
2087 Ref(_binding_0, ) => {
2088 Ref (
2089 _visitor.fold_pat_ref(_binding_0),
2090 )
2091 }
2092 Lit(_binding_0, ) => {
2093 Lit (
2094 _visitor.fold_pat_lit(_binding_0),
2095 )
2096 }
2097 Range(_binding_0, ) => {
2098 Range (
2099 _visitor.fold_pat_range(_binding_0),
2100 )
2101 }
2102 Slice(_binding_0, ) => {
2103 Slice (
2104 _visitor.fold_pat_slice(_binding_0),
2105 )
2106 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002107 Macro(_binding_0, ) => {
2108 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002109 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002110 )
2111 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002112 Verbatim(_binding_0, ) => {
2113 Verbatim (
2114 _visitor.fold_pat_verbatim(_binding_0),
2115 )
2116 }
Nika Layzell27726662017-10-24 23:16:35 -04002117 }
2118}
2119# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002120pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002121 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002122 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002123 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002124 }
2125}
2126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002127pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002128 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002129 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2130 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002131 ident: _visitor.fold_ident(_i . ident),
David Tolnay8b4d3022017-12-29 12:11:10 -05002132 subpat: (_i . subpat).map(|it| { (
2133 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2134 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2135 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002136 }
2137}
2138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002140 PatLit {
2141 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2142 }
2143}
2144# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002145pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2146 PatMacro {
2147 mac: _visitor.fold_macro(_i . mac),
2148 }
2149}
2150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002151pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002152 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002153 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002154 path: _visitor.fold_path(_i . path),
2155 }
2156}
2157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002158pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002159 PatRange {
2160 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002161 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002162 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
2164}
2165# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002166pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002167 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002168 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002169 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002170 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002171 }
2172}
2173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002174pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002175 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002176 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002177 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002178 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002179 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002180 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002181 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002182 }
2183}
2184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002185pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002186 PatStruct {
2187 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002188 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002189 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002190 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002191 }
2192}
2193# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002194pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002195 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002196 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002197 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002198 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002199 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2200 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002201 }
2202}
2203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PatTupleStruct {
2206 path: _visitor.fold_path(_i . path),
2207 pat: _visitor.fold_pat_tuple(_i . pat),
2208 }
2209}
2210# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002211pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2212 PatVerbatim {
2213 tts: _i . tts,
2214 }
2215}
2216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002217pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002218 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002219 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002220 }
2221}
2222
Nika Layzella6f46c42017-10-26 15:26:16 -04002223pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002224 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002225 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002226 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2227 }
2228}
Nika Layzellc08227a2017-12-04 16:30:17 -05002229
2230pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2231 use ::PathArguments::*;
2232 match _i {
2233 None => { None }
2234 AngleBracketed(_binding_0, ) => {
2235 AngleBracketed (
2236 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2237 )
2238 }
2239 Parenthesized(_binding_0, ) => {
2240 Parenthesized (
2241 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2242 )
2243 }
2244 }
2245}
Nika Layzell27726662017-10-24 23:16:35 -04002246
Nika Layzella6f46c42017-10-26 15:26:16 -04002247pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002248 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002249 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002250 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002251 }
2252}
Nika Layzell27726662017-10-24 23:16:35 -04002253
Nika Layzella6f46c42017-10-26 15:26:16 -04002254pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002255 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002256 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002257 trait_ref: _visitor.fold_path(_i . trait_ref),
2258 }
2259}
2260
Nika Layzella6f46c42017-10-26 15:26:16 -04002261pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002262 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002263 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002264 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002265 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002266 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2267 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002268 }
2269}
2270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002271pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002272 use ::RangeLimits::*;
2273 match _i {
2274 HalfOpen(_binding_0, ) => {
2275 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002276 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002277 )
2278 }
2279 Closed(_binding_0, ) => {
2280 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002281 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002282 )
2283 }
2284 }
2285}
David Tolnayf93b90d2017-11-11 19:21:26 -08002286
2287pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2288 use ::ReturnType::*;
2289 match _i {
2290 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002291 Type(_binding_0, _binding_1, ) => {
2292 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002293 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2294 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002295 )
2296 }
2297 }
2298}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002299
2300pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2301 _i
2302}
Nika Layzell27726662017-10-24 23:16:35 -04002303# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002304pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002305 use ::Stmt::*;
2306 match _i {
2307 Local(_binding_0, ) => {
2308 Local (
2309 Box::new(_visitor.fold_local(* _binding_0)),
2310 )
2311 }
2312 Item(_binding_0, ) => {
2313 Item (
2314 Box::new(_visitor.fold_item(* _binding_0)),
2315 )
2316 }
2317 Expr(_binding_0, ) => {
2318 Expr (
2319 Box::new(_visitor.fold_expr(* _binding_0)),
2320 )
2321 }
2322 Semi(_binding_0, _binding_1, ) => {
2323 Semi (
2324 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002326 )
2327 }
Nika Layzell27726662017-10-24 23:16:35 -04002328 }
2329}
2330
Nika Layzella6f46c42017-10-26 15:26:16 -04002331pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002332 use ::TraitBoundModifier::*;
2333 match _i {
2334 None => { None }
2335 Maybe(_binding_0, ) => {
2336 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002337 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002338 )
2339 }
2340 }
2341}
2342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002343pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002344 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002345 match _i {
2346 Const(_binding_0, ) => {
2347 Const (
2348 _visitor.fold_trait_item_const(_binding_0),
2349 )
2350 }
2351 Method(_binding_0, ) => {
2352 Method (
2353 _visitor.fold_trait_item_method(_binding_0),
2354 )
2355 }
2356 Type(_binding_0, ) => {
2357 Type (
2358 _visitor.fold_trait_item_type(_binding_0),
2359 )
2360 }
2361 Macro(_binding_0, ) => {
2362 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002363 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002364 )
2365 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002366 Verbatim(_binding_0, ) => {
2367 Verbatim (
2368 _visitor.fold_trait_item_verbatim(_binding_0),
2369 )
2370 }
Nika Layzell27726662017-10-24 23:16:35 -04002371 }
2372}
2373# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002374pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2375 TraitItemConst {
2376 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002377 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002378 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002379 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002380 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002381 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002382 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002383 _visitor.fold_expr(( it ) . 1),
2384 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002385 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002386 }
2387}
2388# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002389pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2390 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002391 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002392 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002393 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002394 }
2395}
2396# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002397pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002398 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002399 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002400 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002401 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002402 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002403 }
2404}
2405# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002406pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002407 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002408 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002409 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002410 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002411 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002412 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002413 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002414 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002415 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002416 _visitor.fold_type(( it ) . 1),
2417 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002418 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002419 }
2420}
David Tolnay2ae520a2017-12-29 11:19:50 -05002421# [ cfg ( feature = "full" ) ]
2422pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2423 TraitItemVerbatim {
2424 tts: _i . tts,
2425 }
2426}
Nika Layzell27726662017-10-24 23:16:35 -04002427
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002428pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2429 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002430 match _i {
2431 Slice(_binding_0, ) => {
2432 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002433 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002434 )
2435 }
2436 Array(_binding_0, ) => {
2437 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002438 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002439 )
2440 }
2441 Ptr(_binding_0, ) => {
2442 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002443 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002444 )
2445 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002446 Reference(_binding_0, ) => {
2447 Reference (
2448 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002449 )
2450 }
2451 BareFn(_binding_0, ) => {
2452 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002453 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002454 )
2455 }
2456 Never(_binding_0, ) => {
2457 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002458 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002459 )
2460 }
David Tolnay05362582017-12-26 01:33:57 -05002461 Tuple(_binding_0, ) => {
2462 Tuple (
2463 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002464 )
2465 }
2466 Path(_binding_0, ) => {
2467 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002468 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002469 )
2470 }
2471 TraitObject(_binding_0, ) => {
2472 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002473 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002474 )
2475 }
2476 ImplTrait(_binding_0, ) => {
2477 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002478 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002479 )
2480 }
2481 Paren(_binding_0, ) => {
2482 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002483 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002484 )
2485 }
2486 Group(_binding_0, ) => {
2487 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002488 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002489 )
2490 }
2491 Infer(_binding_0, ) => {
2492 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002493 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002494 )
2495 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002496 Macro(_binding_0, ) => {
2497 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002498 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002499 )
2500 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002501 Verbatim(_binding_0, ) => {
2502 Verbatim (
2503 _visitor.fold_type_verbatim(_binding_0),
2504 )
2505 }
Nika Layzell27726662017-10-24 23:16:35 -04002506 }
2507}
2508
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2510 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002511 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002512 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002513 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002514 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002515 }
2516}
2517
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2519 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002520 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2521 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2522 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2523 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2524 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2525 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2526 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2527 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002528 }
2529}
2530
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2532 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002533 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002534 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002535 }
2536}
2537
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002538pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2539 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002540 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002541 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002542 }
2543}
2544
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002545pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2546 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002548 }
2549}
2550
David Tolnay323279a2017-12-29 11:26:32 -05002551pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2552 TypeMacro {
2553 mac: _visitor.fold_macro(_i . mac),
2554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2558 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002559 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002560 }
2561}
2562
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002563pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2564 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002565 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002566 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002567 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002569 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002571 }
2572}
2573
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2575 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002576 match _i {
2577 Trait(_binding_0, _binding_1, ) => {
2578 Trait (
2579 _visitor.fold_poly_trait_ref(_binding_0),
2580 _visitor.fold_trait_bound_modifier(_binding_1),
2581 )
2582 }
2583 Region(_binding_0, ) => {
2584 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002585 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002586 )
2587 }
2588 }
2589}
2590
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2592 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002593 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002594 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002595 }
2596}
2597
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002598pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2599 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002600 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002601 path: _visitor.fold_path(_i . path),
2602 }
2603}
2604
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002605pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2606 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002607 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2608 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002609 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2610 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002611 }
2612}
2613
David Tolnay0a89b4d2017-11-13 00:55:45 -08002614pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2615 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002616 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002617 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002618 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2619 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002620 }
2621}
2622
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002623pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2624 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002625 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002626 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002627 }
2628}
2629
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002630pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2631 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002632 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002633 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002634 }
2635}
2636
David Tolnay05362582017-12-26 01:33:57 -05002637pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2638 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002639 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002640 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002641 }
2642}
2643
David Tolnay2ae520a2017-12-29 11:19:50 -05002644pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2645 TypeVerbatim {
2646 tts: _i . tts,
2647 }
2648}
2649
Nika Layzella6f46c42017-10-26 15:26:16 -04002650pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002651 use ::UnOp::*;
2652 match _i {
2653 Deref(_binding_0, ) => {
2654 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002655 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002656 )
2657 }
2658 Not(_binding_0, ) => {
2659 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002660 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002661 )
2662 }
2663 Neg(_binding_0, ) => {
2664 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002665 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002666 )
2667 }
2668 }
2669}
David Tolnay5f332a92017-12-26 00:42:45 -05002670# [ cfg ( feature = "full" ) ]
2671pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2672 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002673 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002674 }
2675}
2676# [ cfg ( feature = "full" ) ]
2677pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2678 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002679 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002680 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2681 }
2682}
2683# [ cfg ( feature = "full" ) ]
2684pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2685 UsePath {
2686 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002687 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002688 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002689 _visitor.fold_ident(( it ) . 1),
2690 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002691 }
2692}
2693# [ cfg ( feature = "full" ) ]
2694pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2695 use ::UseTree::*;
2696 match _i {
2697 Path(_binding_0, ) => {
2698 Path (
2699 _visitor.fold_use_path(_binding_0),
2700 )
2701 }
2702 Glob(_binding_0, ) => {
2703 Glob (
2704 _visitor.fold_use_glob(_binding_0),
2705 )
2706 }
2707 List(_binding_0, ) => {
2708 List (
2709 _visitor.fold_use_list(_binding_0),
2710 )
2711 }
2712 }
2713}
Nika Layzell27726662017-10-24 23:16:35 -04002714
Nika Layzella6f46c42017-10-26 15:26:16 -04002715pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002716 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002718 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002719 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002720 discriminant: (_i . discriminant).map(|it| { (
2721 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2722 _visitor.fold_expr(( it ) . 1),
2723 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002724 }
2725}
2726
Nika Layzella6f46c42017-10-26 15:26:16 -04002727pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002728 use ::VariantData::*;
2729 match _i {
2730 Struct(_binding_0, _binding_1, ) => {
2731 Struct (
2732 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002733 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002734 )
2735 }
2736 Tuple(_binding_0, _binding_1, ) => {
2737 Tuple (
2738 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002739 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002740 )
2741 }
2742 Unit => { Unit }
2743 }
2744}
Nika Layzell27726662017-10-24 23:16:35 -04002745
Nika Layzella6f46c42017-10-26 15:26:16 -04002746pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002747 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002748 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002749 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002750 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002751 }
2752}
2753
Nika Layzella6f46c42017-10-26 15:26:16 -04002754pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002755 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002756 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002757 }
2758}
2759
Nika Layzella6f46c42017-10-26 15:26:16 -04002760pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002761 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002762 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002763 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002764 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002765 path: Box::new(_visitor.fold_path(* _i . path)),
2766 }
2767}
2768
Nika Layzella6f46c42017-10-26 15:26:16 -04002769pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002770 use ::Visibility::*;
2771 match _i {
2772 Public(_binding_0, ) => {
2773 Public (
2774 _visitor.fold_vis_public(_binding_0),
2775 )
2776 }
2777 Crate(_binding_0, ) => {
2778 Crate (
2779 _visitor.fold_vis_crate(_binding_0),
2780 )
2781 }
2782 Restricted(_binding_0, ) => {
2783 Restricted (
2784 _visitor.fold_vis_restricted(_binding_0),
2785 )
2786 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002787 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002788 }
2789}
2790
Nika Layzella6f46c42017-10-26 15:26:16 -04002791pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002792 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002793 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002794 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002795 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002796 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002797 }
2798}
2799
Nika Layzella6f46c42017-10-26 15:26:16 -04002800pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002801 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002802 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002803 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2804 }
2805}
2806
Nika Layzella6f46c42017-10-26 15:26:16 -04002807pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002808 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002809 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002810 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002811 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002812 }
2813}
2814
Nika Layzella6f46c42017-10-26 15:26:16 -04002815pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002816 use ::WherePredicate::*;
2817 match _i {
2818 BoundPredicate(_binding_0, ) => {
2819 BoundPredicate (
2820 _visitor.fold_where_bound_predicate(_binding_0),
2821 )
2822 }
2823 RegionPredicate(_binding_0, ) => {
2824 RegionPredicate (
2825 _visitor.fold_where_region_predicate(_binding_0),
2826 )
2827 }
2828 EqPredicate(_binding_0, ) => {
2829 EqPredicate (
2830 _visitor.fold_where_eq_predicate(_binding_0),
2831 )
2832 }
2833 }
2834}
2835
Nika Layzella6f46c42017-10-26 15:26:16 -04002836pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002837 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002838 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002839 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002840 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002841 }
2842}
2843