blob: a33d1d635670dfe72b880b2ebbd7cc745ad20004 [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) }
Nika Layzell27726662017-10-24 23:16:35 -0400242
David Tolnay4ba63a02017-12-28 15:53:05 -0500243fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
244
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500246
247fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250
David Tolnaydecf28d2017-11-11 11:56:45 -0800251fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500252
David Tolnay85b69a42017-12-27 20:43:10 -0500253fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500262# [ cfg ( feature = "full" ) ]
263fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
Nika Layzellc08227a2017-12-04 16:30:17 -0500267fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -0500277fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -0500293fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500298
299fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800308
309fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500310
311fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800321fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
David Tolnay2ae520a2017-12-29 11:19:50 -0500326# [ cfg ( feature = "full" ) ]
327fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
336
337fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
338
339fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
340
David Tolnay323279a2017-12-29 11:26:32 -0500341fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
342
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800343fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
344
345fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
346
347fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
348
349fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
350
351fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
352
353fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
354
David Tolnay0a89b4d2017-11-13 00:55:45 -0800355fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800356
357fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
358
359fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
360
David Tolnay05362582017-12-26 01:33:57 -0500361fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800362
David Tolnay2ae520a2017-12-29 11:19:50 -0500363fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500366# [ cfg ( feature = "full" ) ]
367fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
368# [ cfg ( feature = "full" ) ]
369fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
397}
398
David Tolnayd0adf522017-12-29 01:30:07 -0500399pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
400 _i.span = _visitor.fold_span(_i.span);
401 _i
402}
403
404pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
405 _i.span = _visitor.fold_span(_i.span);
406 _i
407}
408
Nika Layzell27726662017-10-24 23:16:35 -0400409
Nika Layzella6f46c42017-10-26 15:26:16 -0400410pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400411 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500412 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500413 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400414 }
415}
416
Nika Layzellc08227a2017-12-04 16:30:17 -0500417pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
418 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500419 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500420 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500421 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400423 }
424}
425# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400426pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400427 ArgCaptured {
428 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500429 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800430 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400431 }
432}
433# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400434pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400435 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500436 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500437 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400438 }
439}
440# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400441pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400442 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500443 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500444 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500445 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500446 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400447 }
448}
449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400450pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400451 Arm {
452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
453 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500454 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400455 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400457 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400459 }
460}
461
Nika Layzella6f46c42017-10-26 15:26:16 -0400462pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400463 use ::AttrStyle::*;
464 match _i {
465 Outer => { Outer }
466 Inner(_binding_0, ) => {
467 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400469 )
470 }
471 }
472}
473
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400475 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500476 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500477 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500478 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400479 path: _visitor.fold_path(_i . path),
480 tts: _i . tts,
481 is_sugared_doc: _i . is_sugared_doc,
482 }
483}
484
Nika Layzella6f46c42017-10-26 15:26:16 -0400485pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400486 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500487 name: (_i . name).map(|it| { (
488 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500489 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500490 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800491 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400492 }
493}
494
Nika Layzella6f46c42017-10-26 15:26:16 -0400495pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400496 use ::BareFnArgName::*;
497 match _i {
498 Named(_binding_0, ) => {
499 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500500 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400501 )
502 }
503 Wild(_binding_0, ) => {
504 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500505 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400506 )
507 }
508 }
509}
510
Nika Layzella6f46c42017-10-26 15:26:16 -0400511pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400512 use ::BinOp::*;
513 match _i {
514 Add(_binding_0, ) => {
515 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500516 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400517 )
518 }
519 Sub(_binding_0, ) => {
520 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400522 )
523 }
524 Mul(_binding_0, ) => {
525 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500526 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400527 )
528 }
529 Div(_binding_0, ) => {
530 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400532 )
533 }
534 Rem(_binding_0, ) => {
535 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500536 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400537 )
538 }
539 And(_binding_0, ) => {
540 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 Or(_binding_0, ) => {
545 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500546 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400547 )
548 }
549 BitXor(_binding_0, ) => {
550 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
554 BitAnd(_binding_0, ) => {
555 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
559 BitOr(_binding_0, ) => {
560 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
564 Shl(_binding_0, ) => {
565 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
569 Shr(_binding_0, ) => {
570 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
574 Eq(_binding_0, ) => {
575 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
579 Lt(_binding_0, ) => {
580 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
584 Le(_binding_0, ) => {
585 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
589 Ne(_binding_0, ) => {
590 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
594 Ge(_binding_0, ) => {
595 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
599 Gt(_binding_0, ) => {
600 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
604 AddEq(_binding_0, ) => {
605 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
609 SubEq(_binding_0, ) => {
610 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
614 MulEq(_binding_0, ) => {
615 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
619 DivEq(_binding_0, ) => {
620 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
624 RemEq(_binding_0, ) => {
625 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
629 BitXorEq(_binding_0, ) => {
630 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
634 BitAndEq(_binding_0, ) => {
635 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
639 BitOrEq(_binding_0, ) => {
640 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
644 ShlEq(_binding_0, ) => {
645 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
649 ShrEq(_binding_0, ) => {
650 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
654 }
655}
David Tolnay506e43a2017-12-29 11:34:36 -0500656
657pub fn fold_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
658 Binding {
659 ident: _visitor.fold_ident(_i . ident),
660 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
661 ty: _visitor.fold_type(_i . ty),
662 }
663}
Nika Layzell27726662017-10-24 23:16:35 -0400664# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400665pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400666 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500667 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400668 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
669 }
670}
671
Nika Layzella6f46c42017-10-26 15:26:16 -0400672pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400673 use ::Body::*;
674 match _i {
675 Enum(_binding_0, ) => {
676 Enum (
677 _visitor.fold_body_enum(_binding_0),
678 )
679 }
680 Struct(_binding_0, ) => {
681 Struct (
682 _visitor.fold_body_struct(_binding_0),
683 )
684 }
685 }
686}
687
Nika Layzella6f46c42017-10-26 15:26:16 -0400688pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400689 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500690 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500691 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400692 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
693 }
694}
695
Nika Layzella6f46c42017-10-26 15:26:16 -0400696pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400697 BodyStruct {
698 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500699 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
700 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400701 }
702}
703
Nika Layzella6f46c42017-10-26 15:26:16 -0400704pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400705 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500706 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
707 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400708 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500709 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400710 }
711}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500712
713pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
714 ConstParam {
715 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500717 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500719 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500720 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
722 }
723}
Nika Layzell27726662017-10-24 23:16:35 -0400724
Nika Layzella6f46c42017-10-26 15:26:16 -0400725pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400726 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400727 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500728 vis: _visitor.fold_visibility(_i . vis),
729 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400730 generics: _visitor.fold_generics(_i . generics),
731 body: _visitor.fold_body(_i . body),
732 }
733}
734
Nika Layzella6f46c42017-10-26 15:26:16 -0400735pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500736 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400737 match _i {
738 Box(_binding_0, ) => {
739 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400740 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400741 )
742 }
743 InPlace(_binding_0, ) => {
744 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400745 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400746 )
747 }
748 Array(_binding_0, ) => {
749 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400750 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400751 )
752 }
753 Call(_binding_0, ) => {
754 Call (
755 _visitor.fold_expr_call(_binding_0),
756 )
757 }
758 MethodCall(_binding_0, ) => {
759 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400760 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400761 )
762 }
David Tolnay05362582017-12-26 01:33:57 -0500763 Tuple(_binding_0, ) => {
764 Tuple (
765 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400766 )
767 }
768 Binary(_binding_0, ) => {
769 Binary (
770 _visitor.fold_expr_binary(_binding_0),
771 )
772 }
773 Unary(_binding_0, ) => {
774 Unary (
775 _visitor.fold_expr_unary(_binding_0),
776 )
777 }
778 Lit(_binding_0, ) => {
779 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500780 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 Cast(_binding_0, ) => {
784 Cast (
785 _visitor.fold_expr_cast(_binding_0),
786 )
787 }
788 Type(_binding_0, ) => {
789 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500790 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400791 )
792 }
793 If(_binding_0, ) => {
794 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400795 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400796 )
797 }
798 IfLet(_binding_0, ) => {
799 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400800 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400801 )
802 }
803 While(_binding_0, ) => {
804 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
808 WhileLet(_binding_0, ) => {
809 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400810 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
813 ForLoop(_binding_0, ) => {
814 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400815 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400816 )
817 }
818 Loop(_binding_0, ) => {
819 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400820 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400821 )
822 }
823 Match(_binding_0, ) => {
824 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400825 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400826 )
827 }
828 Closure(_binding_0, ) => {
829 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400830 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400831 )
832 }
Nika Layzell640832a2017-12-04 13:37:09 -0500833 Unsafe(_binding_0, ) => {
834 Unsafe (
835 full!(_visitor.fold_expr_unsafe(_binding_0)),
836 )
837 }
Nika Layzell27726662017-10-24 23:16:35 -0400838 Block(_binding_0, ) => {
839 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400840 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400841 )
842 }
843 Assign(_binding_0, ) => {
844 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400845 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400846 )
847 }
848 AssignOp(_binding_0, ) => {
849 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400850 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400851 )
852 }
853 Field(_binding_0, ) => {
854 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
Nika Layzell27726662017-10-24 23:16:35 -0400858 Index(_binding_0, ) => {
859 Index (
860 _visitor.fold_expr_index(_binding_0),
861 )
862 }
863 Range(_binding_0, ) => {
864 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400865 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400866 )
867 }
868 Path(_binding_0, ) => {
869 Path (
870 _visitor.fold_expr_path(_binding_0),
871 )
872 }
873 AddrOf(_binding_0, ) => {
874 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400875 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400876 )
877 }
878 Break(_binding_0, ) => {
879 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400880 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400881 )
882 }
883 Continue(_binding_0, ) => {
884 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400885 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
David Tolnayc246cd32017-12-28 23:14:32 -0500888 Return(_binding_0, ) => {
889 Return (
890 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800893 Macro(_binding_0, ) => {
894 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500895 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 )
897 }
898 Struct(_binding_0, ) => {
899 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400900 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
903 Repeat(_binding_0, ) => {
904 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400905 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400906 )
907 }
908 Paren(_binding_0, ) => {
909 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500910 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
913 Group(_binding_0, ) => {
914 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500915 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400916 )
917 }
918 Try(_binding_0, ) => {
919 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400920 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 )
922 }
923 Catch(_binding_0, ) => {
924 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400925 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400926 )
927 }
928 Yield(_binding_0, ) => {
929 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400930 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400931 )
932 }
David Tolnay2ae520a2017-12-29 11:19:50 -0500933 Verbatim(_binding_0, ) => {
934 Verbatim (
935 _visitor.fold_expr_verbatim(_binding_0),
936 )
937 }
Nika Layzell27726662017-10-24 23:16:35 -0400938 }
939}
940# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500941pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
942 ExprAddrOf {
943 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
944 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500945 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500946 expr: Box::new(_visitor.fold_expr(* _i . expr)),
947 }
948}
949# [ cfg ( feature = "full" ) ]
950pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
951 ExprArray {
952 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
953 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500954 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500955 }
956}
957# [ cfg ( feature = "full" ) ]
958pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
959 ExprAssign {
960 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
961 left: Box::new(_visitor.fold_expr(* _i . left)),
962 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
963 right: Box::new(_visitor.fold_expr(* _i . right)),
964 }
965}
966# [ cfg ( feature = "full" ) ]
967pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
968 ExprAssignOp {
969 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
970 left: Box::new(_visitor.fold_expr(* _i . left)),
971 op: _visitor.fold_bin_op(_i . op),
972 right: Box::new(_visitor.fold_expr(* _i . right)),
973 }
974}
975
976pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
977 ExprBinary {
978 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
979 left: Box::new(_visitor.fold_expr(* _i . left)),
980 op: _visitor.fold_bin_op(_i . op),
981 right: Box::new(_visitor.fold_expr(* _i . right)),
982 }
983}
984# [ cfg ( feature = "full" ) ]
985pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
986 ExprBlock {
987 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
988 block: _visitor.fold_block(_i . block),
989 }
990}
991# [ cfg ( feature = "full" ) ]
992pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
993 ExprBox {
994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
995 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
996 expr: Box::new(_visitor.fold_expr(* _i . expr)),
997 }
998}
999# [ cfg ( feature = "full" ) ]
1000pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1001 ExprBreak {
1002 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1003 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1004 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1005 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1006 }
1007}
1008
1009pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1010 ExprCall {
1011 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1012 func: Box::new(_visitor.fold_expr(* _i . func)),
1013 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1014 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1015 }
1016}
1017
1018pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1019 ExprCast {
1020 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1021 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1022 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1023 ty: Box::new(_visitor.fold_type(* _i . ty)),
1024 }
1025}
1026# [ cfg ( feature = "full" ) ]
1027pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1028 ExprCatch {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1031 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1032 block: _visitor.fold_block(_i . block),
1033 }
1034}
1035# [ cfg ( feature = "full" ) ]
1036pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1037 ExprClosure {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001039 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001040 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1041 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1042 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1043 output: _visitor.fold_return_type(_i . output),
1044 body: Box::new(_visitor.fold_expr(* _i . body)),
1045 }
1046}
1047# [ cfg ( feature = "full" ) ]
1048pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1049 ExprContinue {
1050 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1051 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1052 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1053 }
1054}
1055# [ cfg ( feature = "full" ) ]
1056pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1057 ExprField {
1058 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1059 base: Box::new(_visitor.fold_expr(* _i . base)),
1060 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1061 member: _visitor.fold_member(_i . member),
1062 }
1063}
1064# [ cfg ( feature = "full" ) ]
1065pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1066 ExprForLoop {
1067 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1068 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1069 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1070 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1071 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1072 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1073 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1074 body: _visitor.fold_block(_i . body),
1075 }
1076}
David Tolnaye98775f2017-12-28 23:17:00 -05001077# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001078pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1079 ExprGroup {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1081 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1082 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1083 }
1084}
1085# [ cfg ( feature = "full" ) ]
1086pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1087 ExprIf {
1088 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1089 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1090 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001091 then_branch: _visitor.fold_block(_i . then_branch),
1092 else_branch: (_i . else_branch).map(|it| { (
1093 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1094 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1095 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001096 }
1097}
1098# [ cfg ( feature = "full" ) ]
1099pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1100 ExprIfLet {
1101 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1102 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1103 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1104 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1105 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1106 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001107 then_branch: _visitor.fold_block(_i . then_branch),
1108 else_branch: (_i . else_branch).map(|it| { (
1109 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1110 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1111 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001112 }
1113}
1114# [ cfg ( feature = "full" ) ]
1115pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1116 ExprInPlace {
1117 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1118 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001119 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001120 value: Box::new(_visitor.fold_expr(* _i . value)),
1121 }
1122}
1123
1124pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1125 ExprIndex {
1126 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1127 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1128 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1129 index: Box::new(_visitor.fold_expr(* _i . index)),
1130 }
1131}
1132
1133pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1134 ExprLit {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 lit: _visitor.fold_lit(_i . lit),
1137 }
1138}
1139# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001140pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001141 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001142 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001143 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001144 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001145 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1146 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001147 }
1148}
1149# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001150pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1151 ExprMacro {
1152 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1153 mac: _visitor.fold_macro(_i . mac),
1154 }
1155}
1156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001157pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001158 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001159 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001160 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001161 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001162 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1164 }
1165}
1166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001167pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001168 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001170 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001171 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001172 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001173 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001174 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1175 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
1177}
David Tolnaye98775f2017-12-28 23:17:00 -05001178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001179pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001180 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001181 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001182 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001183 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
1185}
1186
Nika Layzella6f46c42017-10-26 15:26:16 -04001187pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001188 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001189 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001190 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001191 path: _visitor.fold_path(_i . path),
1192 }
1193}
1194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001195pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001198 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001199 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
1202}
1203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001207 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001208 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001209 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1211 }
1212}
1213# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001214pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1215 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001216 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001217 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001218 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
1220}
1221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001222pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001225 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001226 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001227 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1228 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1229 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
1231}
1232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001233pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001235 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001237 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
1240# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001241pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1242 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001243 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001244 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001245 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001246 }
1247}
David Tolnay0cf94f22017-12-28 23:46:26 -05001248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001251 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001253 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001254 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257
Nika Layzella6f46c42017-10-26 15:26:16 -04001258pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001259 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001261 op: _visitor.fold_un_op(_i . op),
1262 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1263 }
1264}
1265# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001266pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1267 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001268 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001269 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001270 block: _visitor.fold_block(_i . block),
1271 }
1272}
David Tolnay2ae520a2017-12-29 11:19:50 -05001273
1274pub fn fold_expr_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1275 ExprVerbatim {
1276 tts: _i . tts,
1277 }
1278}
Nika Layzell640832a2017-12-04 13:37:09 -05001279# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001280pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001281 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001282 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001283 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001284 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1285 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001286 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1287 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
1289}
1290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001291pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001292 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001293 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001294 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001295 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1296 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}
Nika Layzell27726662017-10-24 23:16:35 -04001904
Nika Layzella6f46c42017-10-26 15:26:16 -04001905pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001906 LifetimeDef {
1907 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001908 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001909 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001910 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1911 }
1912}
1913
1914pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1915 Lit {
1916 value: _i . value,
1917 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001918 }
1919}
1920# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001921pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001922 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001923 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001924 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1925 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1926 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1927 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1928 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1929 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1930 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001931 }
1932}
Nika Layzell27726662017-10-24 23:16:35 -04001933
David Tolnaydecf28d2017-11-11 11:56:45 -08001934pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1935 Macro {
1936 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001937 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnayfe9d2782017-12-29 11:32:42 -05001938 tt: _i . tt,
David Tolnaydecf28d2017-11-11 11:56:45 -08001939 }
1940}
David Tolnay14982012017-12-29 00:49:51 -05001941
David Tolnay85b69a42017-12-27 20:43:10 -05001942pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1943 use ::Member::*;
1944 match _i {
1945 Named(_binding_0, ) => {
1946 Named (
1947 _visitor.fold_ident(_binding_0),
1948 )
1949 }
1950 Unnamed(_binding_0, ) => {
1951 Unnamed (
1952 _visitor.fold_index(_binding_0),
1953 )
1954 }
1955 }
1956}
David Tolnaydecf28d2017-11-11 11:56:45 -08001957
Nika Layzella6f46c42017-10-26 15:26:16 -04001958pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001959 use ::MetaItem::*;
1960 match _i {
1961 Term(_binding_0, ) => {
1962 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001963 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001964 )
1965 }
1966 List(_binding_0, ) => {
1967 List (
1968 _visitor.fold_meta_item_list(_binding_0),
1969 )
1970 }
1971 NameValue(_binding_0, ) => {
1972 NameValue (
1973 _visitor.fold_meta_name_value(_binding_0),
1974 )
1975 }
1976 }
1977}
1978
Nika Layzella6f46c42017-10-26 15:26:16 -04001979pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001980 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001981 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001982 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001983 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1984 }
1985}
1986
Nika Layzella6f46c42017-10-26 15:26:16 -04001987pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001988 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001989 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001990 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001991 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001992 }
1993}
1994# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001995pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001996 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001997 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001998 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001999 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002000 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002001 decl: _visitor.fold_fn_decl(_i . decl),
2002 }
2003}
David Tolnayd60cfec2017-12-29 00:21:38 -05002004# [ cfg ( feature = "full" ) ]
2005pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2006 MethodTurbofish {
2007 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2008 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2009 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2010 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2011 }
2012}
Nika Layzell27726662017-10-24 23:16:35 -04002013
Nika Layzella6f46c42017-10-26 15:26:16 -04002014pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002015 use ::NestedMetaItem::*;
2016 match _i {
2017 MetaItem(_binding_0, ) => {
2018 MetaItem (
2019 _visitor.fold_meta_item(_binding_0),
2020 )
2021 }
2022 Literal(_binding_0, ) => {
2023 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002024 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002025 )
2026 }
2027 }
2028}
2029
Nika Layzellc08227a2017-12-04 16:30:17 -05002030pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2031 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002032 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002033 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002034 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002035 }
2036}
2037# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002038pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002039 use ::Pat::*;
2040 match _i {
2041 Wild(_binding_0, ) => {
2042 Wild (
2043 _visitor.fold_pat_wild(_binding_0),
2044 )
2045 }
2046 Ident(_binding_0, ) => {
2047 Ident (
2048 _visitor.fold_pat_ident(_binding_0),
2049 )
2050 }
2051 Struct(_binding_0, ) => {
2052 Struct (
2053 _visitor.fold_pat_struct(_binding_0),
2054 )
2055 }
2056 TupleStruct(_binding_0, ) => {
2057 TupleStruct (
2058 _visitor.fold_pat_tuple_struct(_binding_0),
2059 )
2060 }
2061 Path(_binding_0, ) => {
2062 Path (
2063 _visitor.fold_pat_path(_binding_0),
2064 )
2065 }
2066 Tuple(_binding_0, ) => {
2067 Tuple (
2068 _visitor.fold_pat_tuple(_binding_0),
2069 )
2070 }
2071 Box(_binding_0, ) => {
2072 Box (
2073 _visitor.fold_pat_box(_binding_0),
2074 )
2075 }
2076 Ref(_binding_0, ) => {
2077 Ref (
2078 _visitor.fold_pat_ref(_binding_0),
2079 )
2080 }
2081 Lit(_binding_0, ) => {
2082 Lit (
2083 _visitor.fold_pat_lit(_binding_0),
2084 )
2085 }
2086 Range(_binding_0, ) => {
2087 Range (
2088 _visitor.fold_pat_range(_binding_0),
2089 )
2090 }
2091 Slice(_binding_0, ) => {
2092 Slice (
2093 _visitor.fold_pat_slice(_binding_0),
2094 )
2095 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002096 Macro(_binding_0, ) => {
2097 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002098 _visitor.fold_pat_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002099 )
2100 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002101 Verbatim(_binding_0, ) => {
2102 Verbatim (
2103 _visitor.fold_pat_verbatim(_binding_0),
2104 )
2105 }
Nika Layzell27726662017-10-24 23:16:35 -04002106 }
2107}
2108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002109pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002110 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002111 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002112 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002113 }
2114}
2115# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002116pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002117 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002118 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2119 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002120 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002121 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002122 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002123 }
2124}
2125# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002126pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002127 PatLit {
2128 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2129 }
2130}
2131# [ cfg ( feature = "full" ) ]
David Tolnay323279a2017-12-29 11:26:32 -05002132pub fn fold_pat_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2133 PatMacro {
2134 mac: _visitor.fold_macro(_i . mac),
2135 }
2136}
2137# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002138pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002139 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002140 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002141 path: _visitor.fold_path(_i . path),
2142 }
2143}
2144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002145pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002146 PatRange {
2147 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002148 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002149 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002150 }
2151}
2152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002153pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002154 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002155 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002156 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002157 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002158 }
2159}
2160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002161pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002162 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002163 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002164 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002165 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002166 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002167 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002168 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002169 }
2170}
2171# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002172pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002173 PatStruct {
2174 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002175 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002176 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002177 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
2179}
2180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002181pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002182 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002183 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002184 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002185 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002186 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2187 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002188 }
2189}
2190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002191pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002192 PatTupleStruct {
2193 path: _visitor.fold_path(_i . path),
2194 pat: _visitor.fold_pat_tuple(_i . pat),
2195 }
2196}
2197# [ cfg ( feature = "full" ) ]
David Tolnay2ae520a2017-12-29 11:19:50 -05002198pub fn fold_pat_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2199 PatVerbatim {
2200 tts: _i . tts,
2201 }
2202}
2203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002206 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002207 }
2208}
2209
Nika Layzella6f46c42017-10-26 15:26:16 -04002210pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002211 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002212 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002213 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2214 }
2215}
Nika Layzellc08227a2017-12-04 16:30:17 -05002216
2217pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2218 use ::PathArguments::*;
2219 match _i {
2220 None => { None }
2221 AngleBracketed(_binding_0, ) => {
2222 AngleBracketed (
2223 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2224 )
2225 }
2226 Parenthesized(_binding_0, ) => {
2227 Parenthesized (
2228 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2229 )
2230 }
2231 }
2232}
Nika Layzell27726662017-10-24 23:16:35 -04002233
Nika Layzella6f46c42017-10-26 15:26:16 -04002234pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002235 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002236 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002237 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002238 }
2239}
Nika Layzell27726662017-10-24 23:16:35 -04002240
Nika Layzella6f46c42017-10-26 15:26:16 -04002241pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002242 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002243 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002244 trait_ref: _visitor.fold_path(_i . trait_ref),
2245 }
2246}
2247
Nika Layzella6f46c42017-10-26 15:26:16 -04002248pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002249 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002250 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002251 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002252 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002253 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2254 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002255 }
2256}
2257# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002258pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002259 use ::RangeLimits::*;
2260 match _i {
2261 HalfOpen(_binding_0, ) => {
2262 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002263 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002264 )
2265 }
2266 Closed(_binding_0, ) => {
2267 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002268 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002269 )
2270 }
2271 }
2272}
David Tolnayf93b90d2017-11-11 19:21:26 -08002273
2274pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2275 use ::ReturnType::*;
2276 match _i {
2277 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002278 Type(_binding_0, _binding_1, ) => {
2279 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002280 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2281 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002282 )
2283 }
2284 }
2285}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002286
2287pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2288 _i
2289}
Nika Layzell27726662017-10-24 23:16:35 -04002290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002291pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002292 use ::Stmt::*;
2293 match _i {
2294 Local(_binding_0, ) => {
2295 Local (
2296 Box::new(_visitor.fold_local(* _binding_0)),
2297 )
2298 }
2299 Item(_binding_0, ) => {
2300 Item (
2301 Box::new(_visitor.fold_item(* _binding_0)),
2302 )
2303 }
2304 Expr(_binding_0, ) => {
2305 Expr (
2306 Box::new(_visitor.fold_expr(* _binding_0)),
2307 )
2308 }
2309 Semi(_binding_0, _binding_1, ) => {
2310 Semi (
2311 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002312 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002313 )
2314 }
Nika Layzell27726662017-10-24 23:16:35 -04002315 }
2316}
2317
Nika Layzella6f46c42017-10-26 15:26:16 -04002318pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002319 use ::TraitBoundModifier::*;
2320 match _i {
2321 None => { None }
2322 Maybe(_binding_0, ) => {
2323 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002324 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002325 )
2326 }
2327 }
2328}
2329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002330pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002331 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002332 match _i {
2333 Const(_binding_0, ) => {
2334 Const (
2335 _visitor.fold_trait_item_const(_binding_0),
2336 )
2337 }
2338 Method(_binding_0, ) => {
2339 Method (
2340 _visitor.fold_trait_item_method(_binding_0),
2341 )
2342 }
2343 Type(_binding_0, ) => {
2344 Type (
2345 _visitor.fold_trait_item_type(_binding_0),
2346 )
2347 }
2348 Macro(_binding_0, ) => {
2349 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002350 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002351 )
2352 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002353 Verbatim(_binding_0, ) => {
2354 Verbatim (
2355 _visitor.fold_trait_item_verbatim(_binding_0),
2356 )
2357 }
Nika Layzell27726662017-10-24 23:16:35 -04002358 }
2359}
2360# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002361pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2362 TraitItemConst {
2363 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002364 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002365 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002366 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002367 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002368 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002370 _visitor.fold_expr(( it ) . 1),
2371 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002372 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002373 }
2374}
2375# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002376pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2377 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002378 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002379 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002380 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002381 }
2382}
2383# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002384pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002385 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002386 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002387 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002388 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002389 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002390 }
2391}
2392# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002393pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002394 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002395 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002396 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002397 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002398 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002399 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002400 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002401 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002402 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002403 _visitor.fold_type(( it ) . 1),
2404 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002405 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002406 }
2407}
David Tolnay2ae520a2017-12-29 11:19:50 -05002408# [ cfg ( feature = "full" ) ]
2409pub fn fold_trait_item_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2410 TraitItemVerbatim {
2411 tts: _i . tts,
2412 }
2413}
Nika Layzell27726662017-10-24 23:16:35 -04002414
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2416 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002417 match _i {
2418 Slice(_binding_0, ) => {
2419 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002420 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002421 )
2422 }
2423 Array(_binding_0, ) => {
2424 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002426 )
2427 }
2428 Ptr(_binding_0, ) => {
2429 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002430 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002431 )
2432 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002433 Reference(_binding_0, ) => {
2434 Reference (
2435 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
2438 BareFn(_binding_0, ) => {
2439 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002440 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002441 )
2442 }
2443 Never(_binding_0, ) => {
2444 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002445 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
David Tolnay05362582017-12-26 01:33:57 -05002448 Tuple(_binding_0, ) => {
2449 Tuple (
2450 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002451 )
2452 }
2453 Path(_binding_0, ) => {
2454 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002456 )
2457 }
2458 TraitObject(_binding_0, ) => {
2459 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002460 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002461 )
2462 }
2463 ImplTrait(_binding_0, ) => {
2464 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002465 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002466 )
2467 }
2468 Paren(_binding_0, ) => {
2469 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002471 )
2472 }
2473 Group(_binding_0, ) => {
2474 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
2478 Infer(_binding_0, ) => {
2479 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002483 Macro(_binding_0, ) => {
2484 Macro (
David Tolnay323279a2017-12-29 11:26:32 -05002485 _visitor.fold_type_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002486 )
2487 }
David Tolnay2ae520a2017-12-29 11:19:50 -05002488 Verbatim(_binding_0, ) => {
2489 Verbatim (
2490 _visitor.fold_type_verbatim(_binding_0),
2491 )
2492 }
Nika Layzell27726662017-10-24 23:16:35 -04002493 }
2494}
2495
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2497 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002498 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002499 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002500 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002501 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002502 }
2503}
2504
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002505pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2506 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002507 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2508 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2509 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2510 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2511 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2512 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2513 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2514 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002515 }
2516}
2517
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2519 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002520 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002521 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002522 }
2523}
2524
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002525pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2526 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002527 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002528 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002529 }
2530}
2531
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002532pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2533 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002534 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002535 }
2536}
2537
David Tolnay323279a2017-12-29 11:26:32 -05002538pub fn fold_type_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2539 TypeMacro {
2540 mac: _visitor.fold_macro(_i . mac),
2541 }
2542}
2543
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2545 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002546 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002547 }
2548}
2549
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2551 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002552 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002553 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002554 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002555 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002556 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002558 }
2559}
2560
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002561pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2562 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002563 match _i {
2564 Trait(_binding_0, _binding_1, ) => {
2565 Trait (
2566 _visitor.fold_poly_trait_ref(_binding_0),
2567 _visitor.fold_trait_bound_modifier(_binding_1),
2568 )
2569 }
2570 Region(_binding_0, ) => {
2571 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002572 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002573 )
2574 }
2575 }
2576}
2577
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002578pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2579 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002580 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002581 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002582 }
2583}
2584
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2586 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002587 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002588 path: _visitor.fold_path(_i . path),
2589 }
2590}
2591
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002592pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2593 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002594 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2595 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002596 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2597 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002598 }
2599}
2600
David Tolnay0a89b4d2017-11-13 00:55:45 -08002601pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2602 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002603 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002604 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002605 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2606 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002607 }
2608}
2609
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002610pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2611 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002612 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002613 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002614 }
2615}
2616
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002617pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2618 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002619 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002620 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002621 }
2622}
2623
David Tolnay05362582017-12-26 01:33:57 -05002624pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2625 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002626 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002627 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002628 }
2629}
2630
David Tolnay2ae520a2017-12-29 11:19:50 -05002631pub fn fold_type_verbatim<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2632 TypeVerbatim {
2633 tts: _i . tts,
2634 }
2635}
2636
Nika Layzella6f46c42017-10-26 15:26:16 -04002637pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002638 use ::UnOp::*;
2639 match _i {
2640 Deref(_binding_0, ) => {
2641 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002642 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002643 )
2644 }
2645 Not(_binding_0, ) => {
2646 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002647 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002648 )
2649 }
2650 Neg(_binding_0, ) => {
2651 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002652 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 )
2654 }
2655 }
2656}
David Tolnay5f332a92017-12-26 00:42:45 -05002657# [ cfg ( feature = "full" ) ]
2658pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2659 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002660 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002661 }
2662}
2663# [ cfg ( feature = "full" ) ]
2664pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2665 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002666 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002667 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2668 }
2669}
2670# [ cfg ( feature = "full" ) ]
2671pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2672 UsePath {
2673 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002674 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002675 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002676 _visitor.fold_ident(( it ) . 1),
2677 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002678 }
2679}
2680# [ cfg ( feature = "full" ) ]
2681pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2682 use ::UseTree::*;
2683 match _i {
2684 Path(_binding_0, ) => {
2685 Path (
2686 _visitor.fold_use_path(_binding_0),
2687 )
2688 }
2689 Glob(_binding_0, ) => {
2690 Glob (
2691 _visitor.fold_use_glob(_binding_0),
2692 )
2693 }
2694 List(_binding_0, ) => {
2695 List (
2696 _visitor.fold_use_list(_binding_0),
2697 )
2698 }
2699 }
2700}
Nika Layzell27726662017-10-24 23:16:35 -04002701
Nika Layzella6f46c42017-10-26 15:26:16 -04002702pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002703 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002704 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002705 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002706 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002707 discriminant: (_i . discriminant).map(|it| { (
2708 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2709 _visitor.fold_expr(( it ) . 1),
2710 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002711 }
2712}
2713
Nika Layzella6f46c42017-10-26 15:26:16 -04002714pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002715 use ::VariantData::*;
2716 match _i {
2717 Struct(_binding_0, _binding_1, ) => {
2718 Struct (
2719 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002720 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002721 )
2722 }
2723 Tuple(_binding_0, _binding_1, ) => {
2724 Tuple (
2725 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002726 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002727 )
2728 }
2729 Unit => { Unit }
2730 }
2731}
Nika Layzell27726662017-10-24 23:16:35 -04002732
Nika Layzella6f46c42017-10-26 15:26:16 -04002733pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002734 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002735 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002736 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002737 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002738 }
2739}
2740
Nika Layzella6f46c42017-10-26 15:26:16 -04002741pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002742 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002743 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002744 }
2745}
2746
Nika Layzella6f46c42017-10-26 15:26:16 -04002747pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002748 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002749 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002750 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002751 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002752 path: Box::new(_visitor.fold_path(* _i . path)),
2753 }
2754}
2755
Nika Layzella6f46c42017-10-26 15:26:16 -04002756pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002757 use ::Visibility::*;
2758 match _i {
2759 Public(_binding_0, ) => {
2760 Public (
2761 _visitor.fold_vis_public(_binding_0),
2762 )
2763 }
2764 Crate(_binding_0, ) => {
2765 Crate (
2766 _visitor.fold_vis_crate(_binding_0),
2767 )
2768 }
2769 Restricted(_binding_0, ) => {
2770 Restricted (
2771 _visitor.fold_vis_restricted(_binding_0),
2772 )
2773 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002774 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002775 }
2776}
2777
Nika Layzella6f46c42017-10-26 15:26:16 -04002778pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002779 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002780 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002781 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002782 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002783 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002784 }
2785}
2786
Nika Layzella6f46c42017-10-26 15:26:16 -04002787pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002788 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002789 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002790 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2791 }
2792}
2793
Nika Layzella6f46c42017-10-26 15:26:16 -04002794pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002795 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002796 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002797 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002798 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002799 }
2800}
2801
Nika Layzella6f46c42017-10-26 15:26:16 -04002802pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002803 use ::WherePredicate::*;
2804 match _i {
2805 BoundPredicate(_binding_0, ) => {
2806 BoundPredicate (
2807 _visitor.fold_where_bound_predicate(_binding_0),
2808 )
2809 }
2810 RegionPredicate(_binding_0, ) => {
2811 RegionPredicate (
2812 _visitor.fold_where_region_predicate(_binding_0),
2813 )
2814 }
2815 EqPredicate(_binding_0, ) => {
2816 EqPredicate (
2817 _visitor.fold_where_eq_predicate(_binding_0),
2818 )
2819 }
2820 }
2821}
2822
Nika Layzella6f46c42017-10-26 15:26:16 -04002823pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002824 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002825 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002826 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002827 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002828 }
2829}
2830