blob: 09ec5ca408b4e847bde9d8cc82b4cefcff9a4127 [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 Layzella6f46c42017-10-26 15:26:16 -040045fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046
Nika Layzellc08227a2017-12-04 16:30:17 -050047fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
David Tolnayfd6bf5c2017-11-12 09:41:14 -080065fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050082
83fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_kind(&mut self, i: ExprKind) -> ExprKind { fold_expr_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500155fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500161fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800186# [ cfg ( feature = "full" ) ]
187fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188
Nika Layzellc08227a2017-12-04 16:30:17 -0500189fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500190
David Tolnayc2f1aba2017-11-12 20:29:22 -0800191fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
192
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500194
195fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800201fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500211fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800229fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800231fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800241fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246
David Tolnay4ba63a02017-12-28 15:53:05 -0500247fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
248
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500250
251fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254
David Tolnaydecf28d2017-11-11 11:56:45 -0800255fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay85b69a42017-12-27 20:43:10 -0500256# [ cfg ( feature = "full" ) ]
257fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800267fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzellc08227a2017-12-04 16:30:17 -0500273fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500300
301fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800310
311fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500312
313fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800323fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
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
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
338
339fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
340
341fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
342
343fn 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
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(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_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
399}
400
401
Nika Layzella6f46c42017-10-26 15:26:16 -0400402pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400403 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500404 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400405 kind: _visitor.fold_abi_kind(_i . kind),
406 }
407}
408
Nika Layzella6f46c42017-10-26 15:26:16 -0400409pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400410 use ::AbiKind::*;
411 match _i {
412 Named(_binding_0, ) => {
413 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500414 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400415 )
416 }
417 Default => { Default }
418 }
419}
420
Nika Layzellc08227a2017-12-04 16:30:17 -0500421pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
422 AngleBracketedGenericArguments {
David Tolnaycc0f0372017-12-28 19:11:04 -0500423 turbofish: (_i . turbofish).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
424 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500425 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500426 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400427 }
428}
429# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400430pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400431 ArgCaptured {
432 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500433 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800434 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400435 }
436}
437# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400438pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400439 ArgSelf {
440 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400442 }
443}
444# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400445pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400446 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500447 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500448 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400449 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500450 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400451 }
452}
453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400454pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400455 Arm {
456 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
457 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400459 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400461 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400463 }
464}
465
Nika Layzella6f46c42017-10-26 15:26:16 -0400466pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400467 use ::AttrStyle::*;
468 match _i {
469 Outer => { Outer }
470 Inner(_binding_0, ) => {
471 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500472 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400473 )
474 }
475 }
476}
477
Nika Layzella6f46c42017-10-26 15:26:16 -0400478pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400479 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500480 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500481 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500482 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400483 path: _visitor.fold_path(_i . path),
484 tts: _i . tts,
485 is_sugared_doc: _i . is_sugared_doc,
486 }
487}
488
Nika Layzella6f46c42017-10-26 15:26:16 -0400489pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400490 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500491 name: (_i . name).map(|it| { (
492 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500493 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500494 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800495 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400496 }
497}
498
Nika Layzella6f46c42017-10-26 15:26:16 -0400499pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400500 use ::BareFnArgName::*;
501 match _i {
502 Named(_binding_0, ) => {
503 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500504 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400505 )
506 }
507 Wild(_binding_0, ) => {
508 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500509 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400510 )
511 }
512 }
513}
514
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800515pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
516 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400517 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400518 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500520 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500521 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400522 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500523 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800524 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400525 }
526}
527
Nika Layzella6f46c42017-10-26 15:26:16 -0400528pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400529 use ::BinOp::*;
530 match _i {
531 Add(_binding_0, ) => {
532 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500533 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400534 )
535 }
536 Sub(_binding_0, ) => {
537 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500538 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400539 )
540 }
541 Mul(_binding_0, ) => {
542 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500543 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400544 )
545 }
546 Div(_binding_0, ) => {
547 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500548 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400549 )
550 }
551 Rem(_binding_0, ) => {
552 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
556 And(_binding_0, ) => {
557 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
561 Or(_binding_0, ) => {
562 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
566 BitXor(_binding_0, ) => {
567 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
571 BitAnd(_binding_0, ) => {
572 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
576 BitOr(_binding_0, ) => {
577 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
581 Shl(_binding_0, ) => {
582 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
586 Shr(_binding_0, ) => {
587 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
591 Eq(_binding_0, ) => {
592 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
596 Lt(_binding_0, ) => {
597 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
601 Le(_binding_0, ) => {
602 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
606 Ne(_binding_0, ) => {
607 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
611 Ge(_binding_0, ) => {
612 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
616 Gt(_binding_0, ) => {
617 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
621 AddEq(_binding_0, ) => {
622 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
626 SubEq(_binding_0, ) => {
627 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
631 MulEq(_binding_0, ) => {
632 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
636 DivEq(_binding_0, ) => {
637 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
641 RemEq(_binding_0, ) => {
642 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
646 BitXorEq(_binding_0, ) => {
647 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
651 BitAndEq(_binding_0, ) => {
652 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
656 BitOrEq(_binding_0, ) => {
657 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500658 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400659 )
660 }
661 ShlEq(_binding_0, ) => {
662 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500663 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400664 )
665 }
666 ShrEq(_binding_0, ) => {
667 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500668 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400669 )
670 }
671 }
672}
673# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400674pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400675 use ::BindingMode::*;
676 match _i {
677 ByRef(_binding_0, _binding_1, ) => {
678 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500679 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400680 _visitor.fold_mutability(_binding_1),
681 )
682 }
683 ByValue(_binding_0, ) => {
684 ByValue (
685 _visitor.fold_mutability(_binding_0),
686 )
687 }
688 }
689}
690# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400691pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400692 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500693 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400694 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
695 }
696}
697
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400699 use ::Body::*;
700 match _i {
701 Enum(_binding_0, ) => {
702 Enum (
703 _visitor.fold_body_enum(_binding_0),
704 )
705 }
706 Struct(_binding_0, ) => {
707 Struct (
708 _visitor.fold_body_struct(_binding_0),
709 )
710 }
711 }
712}
713
Nika Layzella6f46c42017-10-26 15:26:16 -0400714pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400715 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500717 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400718 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
719 }
720}
721
Nika Layzella6f46c42017-10-26 15:26:16 -0400722pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400723 BodyStruct {
724 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
726 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400727 }
728}
729
Nika Layzella6f46c42017-10-26 15:26:16 -0400730pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400731 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500732 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
733 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400734 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500735 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400736 }
737}
738# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400739pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400740 use ::CaptureBy::*;
741 match _i {
742 Value(_binding_0, ) => {
743 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500744 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400745 )
746 }
747 Ref => { Ref }
748 }
749}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500750
751pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
752 ConstParam {
753 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500754 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500755 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500757 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500758 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500759 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
760 }
761}
Nika Layzell27726662017-10-24 23:16:35 -0400762# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400763pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400764 use ::Constness::*;
765 match _i {
766 Const(_binding_0, ) => {
767 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500768 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400769 )
770 }
771 NotConst => { NotConst }
772 }
773}
774# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400775pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400776 use ::Defaultness::*;
777 match _i {
778 Default(_binding_0, ) => {
779 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500780 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 Final => { Final }
784 }
785}
786
Nika Layzella6f46c42017-10-26 15:26:16 -0400787pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400788 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400789 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500790 vis: _visitor.fold_visibility(_i . vis),
791 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400792 generics: _visitor.fold_generics(_i . generics),
793 body: _visitor.fold_body(_i . body),
794 }
795}
796
Nika Layzella6f46c42017-10-26 15:26:16 -0400797pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400798 Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400799 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500800 node: _visitor.fold_expr_kind(_i . node),
Nika Layzell27726662017-10-24 23:16:35 -0400801 }
802}
803# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400804pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400805 ExprAddrOf {
David Tolnaycc0f0372017-12-28 19:11:04 -0500806 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 mutbl: _visitor.fold_mutability(_i . mutbl),
808 expr: Box::new(_visitor.fold_expr(* _i . expr)),
809 }
810}
811# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400812pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400813 ExprArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500814 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500815 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400816 }
817}
818# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400819pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400820 ExprAssign {
821 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500822 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500823 right: Box::new(_visitor.fold_expr(* _i . right)),
Nika Layzell27726662017-10-24 23:16:35 -0400824 }
825}
826# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400827pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400828 ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400829 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500830 op: _visitor.fold_bin_op(_i . op),
Nika Layzell27726662017-10-24 23:16:35 -0400831 right: Box::new(_visitor.fold_expr(* _i . right)),
832 }
833}
834
Nika Layzella6f46c42017-10-26 15:26:16 -0400835pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400836 ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400837 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500838 op: _visitor.fold_bin_op(_i . op),
Nika Layzell27726662017-10-24 23:16:35 -0400839 right: Box::new(_visitor.fold_expr(* _i . right)),
840 }
841}
842# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400843pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400844 ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400845 block: _visitor.fold_block(_i . block),
846 }
847}
848# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400849pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400850 ExprBox {
David Tolnaycc0f0372017-12-28 19:11:04 -0500851 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500852 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -0400853 }
854}
855# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400856pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400857 ExprBreak {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500858 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500859 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400860 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400861 }
862}
863
Nika Layzella6f46c42017-10-26 15:26:16 -0400864pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400865 ExprCall {
866 func: Box::new(_visitor.fold_expr(* _i . func)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500867 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500868 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400869 }
870}
871
Nika Layzella6f46c42017-10-26 15:26:16 -0400872pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400873 ExprCast {
874 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500875 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800876 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400877 }
878}
879# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400880pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400881 ExprCatch {
David Tolnaycc0f0372017-12-28 19:11:04 -0500882 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
883 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400884 block: _visitor.fold_block(_i . block),
885 }
886}
887# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400888pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400889 ExprClosure {
890 capture: _visitor.fold_capture_by(_i . capture),
David Tolnaycc0f0372017-12-28 19:11:04 -0500891 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
David Tolnay7f675742017-12-27 22:43:21 -0500892 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500893 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
David Tolnay7f675742017-12-27 22:43:21 -0500894 output: _visitor.fold_return_type(_i . output),
895 body: Box::new(_visitor.fold_expr(* _i . body)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 }
897}
898# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400899pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400900 ExprContinue {
David Tolnaycc0f0372017-12-28 19:11:04 -0500901 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500902 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400903 }
904}
905# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400906pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400907 ExprField {
David Tolnay85b69a42017-12-27 20:43:10 -0500908 base: Box::new(_visitor.fold_expr(* _i . base)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500909 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay85b69a42017-12-27 20:43:10 -0500910 member: _visitor.fold_member(_i . member),
Nika Layzell27726662017-10-24 23:16:35 -0400911 }
912}
913# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400914pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400915 ExprForLoop {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500916 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
917 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
918 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400919 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500920 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 expr: Box::new(_visitor.fold_expr(* _i . expr)),
922 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -0400923 }
924}
925
Nika Layzella6f46c42017-10-26 15:26:16 -0400926pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400927 ExprGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500928 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500929 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 }
931}
932# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400933pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400934 ExprIf {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500935 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400936 cond: Box::new(_visitor.fold_expr(* _i . cond)),
937 if_true: _visitor.fold_block(_i . if_true),
David Tolnaycc0f0372017-12-28 19:11:04 -0500938 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500939 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400940 }
941}
942# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400943pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400944 ExprIfLet {
David Tolnaycc0f0372017-12-28 19:11:04 -0500945 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
946 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500947 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500948 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500949 expr: Box::new(_visitor.fold_expr(* _i . expr)),
950 if_true: _visitor.fold_block(_i . if_true),
David Tolnaycc0f0372017-12-28 19:11:04 -0500951 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500952 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400953 }
954}
955# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400956pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400957 ExprInPlace {
958 place: Box::new(_visitor.fold_expr(* _i . place)),
959 kind: _visitor.fold_in_place_kind(_i . kind),
960 value: Box::new(_visitor.fold_expr(* _i . value)),
961 }
962}
963
Nika Layzella6f46c42017-10-26 15:26:16 -0400964pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400965 ExprIndex {
966 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500967 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500968 index: Box::new(_visitor.fold_expr(* _i . index)),
Nika Layzell27726662017-10-24 23:16:35 -0400969 }
970}
971
Nika Layzella6f46c42017-10-26 15:26:16 -0400972pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400973 use ::ExprKind::*;
974 match _i {
975 Box(_binding_0, ) => {
976 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400977 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400978 )
979 }
980 InPlace(_binding_0, ) => {
981 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400982 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400983 )
984 }
985 Array(_binding_0, ) => {
986 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400987 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400988 )
989 }
990 Call(_binding_0, ) => {
991 Call (
992 _visitor.fold_expr_call(_binding_0),
993 )
994 }
995 MethodCall(_binding_0, ) => {
996 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400997 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400998 )
999 }
David Tolnay05362582017-12-26 01:33:57 -05001000 Tuple(_binding_0, ) => {
1001 Tuple (
1002 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001003 )
1004 }
1005 Binary(_binding_0, ) => {
1006 Binary (
1007 _visitor.fold_expr_binary(_binding_0),
1008 )
1009 }
1010 Unary(_binding_0, ) => {
1011 Unary (
1012 _visitor.fold_expr_unary(_binding_0),
1013 )
1014 }
1015 Lit(_binding_0, ) => {
1016 Lit (
David Tolnay4ba63a02017-12-28 15:53:05 -05001017 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001018 )
1019 }
1020 Cast(_binding_0, ) => {
1021 Cast (
1022 _visitor.fold_expr_cast(_binding_0),
1023 )
1024 }
1025 Type(_binding_0, ) => {
1026 Type (
1027 _visitor.fold_expr_type(_binding_0),
1028 )
1029 }
1030 If(_binding_0, ) => {
1031 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001032 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001033 )
1034 }
1035 IfLet(_binding_0, ) => {
1036 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001037 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001038 )
1039 }
1040 While(_binding_0, ) => {
1041 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001042 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001043 )
1044 }
1045 WhileLet(_binding_0, ) => {
1046 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001047 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001048 )
1049 }
1050 ForLoop(_binding_0, ) => {
1051 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001052 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001053 )
1054 }
1055 Loop(_binding_0, ) => {
1056 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001057 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001058 )
1059 }
1060 Match(_binding_0, ) => {
1061 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001062 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001063 )
1064 }
1065 Closure(_binding_0, ) => {
1066 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001067 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001068 )
1069 }
Nika Layzell640832a2017-12-04 13:37:09 -05001070 Unsafe(_binding_0, ) => {
1071 Unsafe (
1072 full!(_visitor.fold_expr_unsafe(_binding_0)),
1073 )
1074 }
Nika Layzell27726662017-10-24 23:16:35 -04001075 Block(_binding_0, ) => {
1076 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001077 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001078 )
1079 }
1080 Assign(_binding_0, ) => {
1081 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001082 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001083 )
1084 }
1085 AssignOp(_binding_0, ) => {
1086 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001087 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001088 )
1089 }
1090 Field(_binding_0, ) => {
1091 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001092 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001093 )
1094 }
Nika Layzell27726662017-10-24 23:16:35 -04001095 Index(_binding_0, ) => {
1096 Index (
1097 _visitor.fold_expr_index(_binding_0),
1098 )
1099 }
1100 Range(_binding_0, ) => {
1101 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001102 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001103 )
1104 }
1105 Path(_binding_0, ) => {
1106 Path (
1107 _visitor.fold_expr_path(_binding_0),
1108 )
1109 }
1110 AddrOf(_binding_0, ) => {
1111 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001112 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001113 )
1114 }
1115 Break(_binding_0, ) => {
1116 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001117 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001118 )
1119 }
1120 Continue(_binding_0, ) => {
1121 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001122 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001123 )
1124 }
1125 Ret(_binding_0, ) => {
1126 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001127 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001128 )
1129 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001130 Macro(_binding_0, ) => {
1131 Macro (
1132 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001133 )
1134 }
1135 Struct(_binding_0, ) => {
1136 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001137 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001138 )
1139 }
1140 Repeat(_binding_0, ) => {
1141 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001142 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001143 )
1144 }
1145 Paren(_binding_0, ) => {
1146 Paren (
1147 _visitor.fold_expr_paren(_binding_0),
1148 )
1149 }
1150 Group(_binding_0, ) => {
1151 Group (
1152 _visitor.fold_expr_group(_binding_0),
1153 )
1154 }
1155 Try(_binding_0, ) => {
1156 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001157 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001158 )
1159 }
1160 Catch(_binding_0, ) => {
1161 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001162 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 )
1164 }
1165 Yield(_binding_0, ) => {
1166 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001167 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001168 )
1169 }
1170 }
1171}
1172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001173pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001174 ExprLoop {
David Tolnay4ba63a02017-12-28 15:53:05 -05001175 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001176 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001177 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1178 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001179 }
1180}
1181# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001182pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001183 ExprMatch {
David Tolnaycc0f0372017-12-28 19:11:04 -05001184 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001185 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001186 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001187 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1188 }
1189}
1190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001191pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001192 ExprMethodCall {
1193 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001194 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001195 method: _visitor.fold_ident(_i . method),
David Tolnaycc0f0372017-12-28 19:11:04 -05001196 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001197 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
1198 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001199 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1201 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
1203}
1204
Nika Layzella6f46c42017-10-26 15:26:16 -04001205pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001206 ExprParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001207 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001208 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
1210}
1211
Nika Layzella6f46c42017-10-26 15:26:16 -04001212pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001213 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001214 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001215 path: _visitor.fold_path(_i . path),
1216 }
1217}
1218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001219pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001220 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001221 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001222 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001223 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001224 }
1225}
1226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001227pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001228 ExprRepeat {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001229 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001230 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001231 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001232 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1233 }
1234}
1235# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001236pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001237 ExprRet {
David Tolnaycc0f0372017-12-28 19:11:04 -05001238 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001239 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
1242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001243pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001244 ExprStruct {
1245 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001246 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001247 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1248 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1249 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001250 }
1251}
1252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001253pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001254 ExprTry {
1255 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001256 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
1258}
1259# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001260pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1261 ExprTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001262 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001263 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001264 }
1265}
Nika Layzell27726662017-10-24 23:16:35 -04001266
Nika Layzella6f46c42017-10-26 15:26:16 -04001267pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001268 ExprType {
1269 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001270 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001271 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
1273}
1274
Nika Layzella6f46c42017-10-26 15:26:16 -04001275pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001276 ExprUnary {
1277 op: _visitor.fold_un_op(_i . op),
1278 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1279 }
1280}
1281# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001282pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1283 ExprUnsafe {
David Tolnaycc0f0372017-12-28 19:11:04 -05001284 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001285 block: _visitor.fold_block(_i . block),
1286 }
1287}
1288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001289pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprWhile {
David Tolnay4ba63a02017-12-28 15:53:05 -05001291 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001292 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1293 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001294 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1295 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001296 }
1297}
1298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001299pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001300 ExprWhileLet {
David Tolnay4ba63a02017-12-28 15:53:05 -05001301 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001302 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1303 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1304 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001305 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001306 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001307 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1308 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001309 }
1310}
1311# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001312pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001313 ExprYield {
David Tolnaycc0f0372017-12-28 19:11:04 -05001314 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001315 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001316 }
1317}
1318
Nika Layzella6f46c42017-10-26 15:26:16 -04001319pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001320 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001321 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001322 vis: _visitor.fold_visibility(_i . vis),
1323 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001324 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001325 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001326 }
1327}
1328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001329pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001330 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001331 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001332 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001333 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001334 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1335 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001336 }
1337}
1338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001340 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001341 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1342 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001343 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001344 expr: _visitor.fold_expr(_i . expr),
1345 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001346 }
1347}
1348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001349pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001350 File {
1351 shebang: _i . shebang,
1352 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1353 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1354 }
1355}
1356# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001357pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001358 use ::FnArg::*;
1359 match _i {
1360 SelfRef(_binding_0, ) => {
1361 SelfRef (
1362 _visitor.fold_arg_self_ref(_binding_0),
1363 )
1364 }
1365 SelfValue(_binding_0, ) => {
1366 SelfValue (
1367 _visitor.fold_arg_self(_binding_0),
1368 )
1369 }
1370 Captured(_binding_0, ) => {
1371 Captured (
1372 _visitor.fold_arg_captured(_binding_0),
1373 )
1374 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001375 Inferred(_binding_0, ) => {
1376 Inferred (
1377 _visitor.fold_pat(_binding_0),
1378 )
1379 }
Nika Layzell27726662017-10-24 23:16:35 -04001380 Ignored(_binding_0, ) => {
1381 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001382 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001383 )
1384 }
1385 }
1386}
1387# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001388pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001389 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001390 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001391 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001392 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001393 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001394 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001395 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001396 }
1397}
1398# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001399pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001400 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001401 match _i {
1402 Fn(_binding_0, ) => {
1403 Fn (
1404 _visitor.fold_foreign_item_fn(_binding_0),
1405 )
1406 }
1407 Static(_binding_0, ) => {
1408 Static (
1409 _visitor.fold_foreign_item_static(_binding_0),
1410 )
1411 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001412 Type(_binding_0, ) => {
1413 Type (
1414 _visitor.fold_foreign_item_type(_binding_0),
1415 )
1416 }
Nika Layzell27726662017-10-24 23:16:35 -04001417 }
1418}
1419# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001420pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1421 ForeignItemFn {
1422 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1423 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001424 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001425 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001426 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001427 }
1428}
1429# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001430pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001431 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001432 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1433 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001434 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001435 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001436 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001438 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001439 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001440 }
1441}
David Tolnay199bcbb2017-11-12 10:33:52 -08001442# [ cfg ( feature = "full" ) ]
1443pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1444 ForeignItemType {
1445 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1446 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001447 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001448 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001449 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001450 }
1451}
Nika Layzell27726662017-10-24 23:16:35 -04001452
Nika Layzellc08227a2017-12-04 16:30:17 -05001453pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1454 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001455 match _i {
1456 Lifetime(_binding_0, ) => {
1457 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001458 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001459 )
1460 }
1461 Type(_binding_0, ) => {
1462 Type (
1463 _visitor.fold_type(_binding_0),
1464 )
1465 }
1466 TypeBinding(_binding_0, ) => {
1467 TypeBinding (
1468 _visitor.fold_type_binding(_binding_0),
1469 )
1470 }
Nika Layzellc680e612017-12-04 19:07:20 -05001471 Const(_binding_0, ) => {
1472 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001473 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001474 )
1475 }
Nika Layzell357885a2017-12-04 15:47:07 -05001476 }
1477}
1478
David Tolnayc2f1aba2017-11-12 20:29:22 -08001479pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1480 use ::GenericParam::*;
1481 match _i {
1482 Lifetime(_binding_0, ) => {
1483 Lifetime (
1484 _visitor.fold_lifetime_def(_binding_0),
1485 )
1486 }
1487 Type(_binding_0, ) => {
1488 Type (
1489 _visitor.fold_type_param(_binding_0),
1490 )
1491 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001492 Const(_binding_0, ) => {
1493 Const (
1494 _visitor.fold_const_param(_binding_0),
1495 )
1496 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001497 }
1498}
1499
Nika Layzella6f46c42017-10-26 15:26:16 -04001500pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001501 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001502 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001503 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001505 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001506 }
1507}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001508
1509pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001510 Ident {
1511 sym: _i . sym,
1512 span: _visitor.fold_span(_i . span),
1513 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001514}
Nika Layzell27726662017-10-24 23:16:35 -04001515# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001516pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001517 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001518 match _i {
1519 Const(_binding_0, ) => {
1520 Const (
1521 _visitor.fold_impl_item_const(_binding_0),
1522 )
1523 }
1524 Method(_binding_0, ) => {
1525 Method (
1526 _visitor.fold_impl_item_method(_binding_0),
1527 )
1528 }
1529 Type(_binding_0, ) => {
1530 Type (
1531 _visitor.fold_impl_item_type(_binding_0),
1532 )
1533 }
1534 Macro(_binding_0, ) => {
1535 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001536 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001537 )
1538 }
1539 }
1540}
1541# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001542pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1543 ImplItemConst {
1544 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1545 vis: _visitor.fold_visibility(_i . vis),
1546 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001547 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001548 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001549 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001550 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001551 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001552 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001553 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001554 }
1555}
1556# [ cfg ( feature = "full" ) ]
1557pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1558 ImplItemMacro {
1559 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1560 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001561 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001562 }
1563}
1564# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001565pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001566 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001568 vis: _visitor.fold_visibility(_i . vis),
1569 defaultness: _visitor.fold_defaultness(_i . defaultness),
1570 sig: _visitor.fold_method_sig(_i . sig),
1571 block: _visitor.fold_block(_i . block),
1572 }
1573}
1574# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001575pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001576 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001577 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001578 vis: _visitor.fold_visibility(_i . vis),
1579 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001581 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001582 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001583 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001584 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001585 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001586 }
1587}
1588# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001589pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001590 use ::ImplPolarity::*;
1591 match _i {
1592 Positive => { Positive }
1593 Negative(_binding_0, ) => {
1594 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001595 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001596 )
1597 }
1598 }
1599}
1600# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001601pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001602 use ::InPlaceKind::*;
1603 match _i {
1604 Arrow(_binding_0, ) => {
1605 Arrow (
David Tolnaycc0f0372017-12-28 19:11:04 -05001606 Token ! [ <- ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001607 )
1608 }
1609 In(_binding_0, ) => {
1610 In (
David Tolnaycc0f0372017-12-28 19:11:04 -05001611 Token ! [ in ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001612 )
1613 }
1614 }
1615}
1616# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001617pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1618 Index {
1619 index: _i . index,
1620 span: _visitor.fold_span(_i . span),
1621 }
1622}
1623# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001624pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001625 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001626 match _i {
1627 ExternCrate(_binding_0, ) => {
1628 ExternCrate (
1629 _visitor.fold_item_extern_crate(_binding_0),
1630 )
1631 }
1632 Use(_binding_0, ) => {
1633 Use (
1634 _visitor.fold_item_use(_binding_0),
1635 )
1636 }
1637 Static(_binding_0, ) => {
1638 Static (
1639 _visitor.fold_item_static(_binding_0),
1640 )
1641 }
1642 Const(_binding_0, ) => {
1643 Const (
1644 _visitor.fold_item_const(_binding_0),
1645 )
1646 }
1647 Fn(_binding_0, ) => {
1648 Fn (
1649 _visitor.fold_item_fn(_binding_0),
1650 )
1651 }
1652 Mod(_binding_0, ) => {
1653 Mod (
1654 _visitor.fold_item_mod(_binding_0),
1655 )
1656 }
1657 ForeignMod(_binding_0, ) => {
1658 ForeignMod (
1659 _visitor.fold_item_foreign_mod(_binding_0),
1660 )
1661 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001662 Type(_binding_0, ) => {
1663 Type (
1664 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001665 )
1666 }
1667 Enum(_binding_0, ) => {
1668 Enum (
1669 _visitor.fold_item_enum(_binding_0),
1670 )
1671 }
1672 Struct(_binding_0, ) => {
1673 Struct (
1674 _visitor.fold_item_struct(_binding_0),
1675 )
1676 }
1677 Union(_binding_0, ) => {
1678 Union (
1679 _visitor.fold_item_union(_binding_0),
1680 )
1681 }
1682 Trait(_binding_0, ) => {
1683 Trait (
1684 _visitor.fold_item_trait(_binding_0),
1685 )
1686 }
1687 DefaultImpl(_binding_0, ) => {
1688 DefaultImpl (
1689 _visitor.fold_item_default_impl(_binding_0),
1690 )
1691 }
1692 Impl(_binding_0, ) => {
1693 Impl (
1694 _visitor.fold_item_impl(_binding_0),
1695 )
1696 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001697 Macro(_binding_0, ) => {
1698 Macro (
1699 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001700 )
1701 }
David Tolnay500d8322017-12-18 00:32:51 -08001702 Macro2(_binding_0, ) => {
1703 Macro2 (
1704 _visitor.fold_item_macro2(_binding_0),
1705 )
1706 }
Nika Layzell27726662017-10-24 23:16:35 -04001707 }
1708}
1709# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001710pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1711 ItemConst {
1712 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1713 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001714 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001715 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001716 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001717 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001718 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001719 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001720 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001721 }
1722}
1723# [ cfg ( feature = "full" ) ]
1724pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1725 ItemDefaultImpl {
1726 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1727 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001728 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001729 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001730 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1731 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001732 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001733 }
1734}
1735# [ cfg ( feature = "full" ) ]
1736pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1737 ItemEnum {
1738 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1739 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001740 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001741 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001742 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001743 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001744 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1745 }
1746}
1747# [ cfg ( feature = "full" ) ]
1748pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1749 ItemExternCrate {
1750 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1751 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001752 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1753 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001754 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001755 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001756 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001757 _visitor.fold_ident(( it ) . 1),
1758 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001759 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001760 }
1761}
1762# [ cfg ( feature = "full" ) ]
1763pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1764 ItemFn {
1765 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1766 vis: _visitor.fold_visibility(_i . vis),
1767 constness: _visitor.fold_constness(_i . constness),
1768 unsafety: _visitor.fold_unsafety(_i . unsafety),
1769 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001770 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001771 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001772 block: Box::new(_visitor.fold_block(* _i . block)),
1773 }
1774}
1775# [ cfg ( feature = "full" ) ]
1776pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1777 ItemForeignMod {
1778 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1779 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001780 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1782 }
1783}
1784# [ cfg ( feature = "full" ) ]
1785pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1786 ItemImpl {
1787 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1788 defaultness: _visitor.fold_defaultness(_i . defaultness),
1789 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001790 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001792 trait_: (_i . trait_).map(|it| { (
1793 _visitor.fold_impl_polarity(( it ) . 0),
1794 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001795 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001796 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001797 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001798 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001799 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1800 }
1801}
1802# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001803pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1804 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001805 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001806 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001807 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001809 }
1810}
1811# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001812pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1813 ItemMacro2 {
1814 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1815 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001816 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001817 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001818 args: _i . args,
1819 body: _i . body,
1820 }
1821}
1822# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001823pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001824 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001826 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001828 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001829 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001830 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001831 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1832 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001833 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001834 }
1835}
1836# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001837pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001838 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001839 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001840 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001841 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001842 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001843 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001844 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001845 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001847 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001848 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001849 }
1850}
1851# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001852pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001853 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001854 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001855 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001857 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001858 generics: _visitor.fold_generics(_i . generics),
1859 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001861 }
1862}
1863# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001864pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001865 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001866 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001867 vis: _visitor.fold_visibility(_i . vis),
1868 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001869 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1870 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001871 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001872 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001873 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001874 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001875 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001876 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1877 }
1878}
1879# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001880pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1881 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001882 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001883 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001884 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001885 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001886 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001888 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001890 }
1891}
1892# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001893pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001894 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001895 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001896 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001897 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001898 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001899 generics: _visitor.fold_generics(_i . generics),
1900 data: _visitor.fold_variant_data(_i . data),
1901 }
1902}
1903# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001904pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001905 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001906 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001907 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001908 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1909 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001910 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1911 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001912 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001913 }
1914}
1915
David Tolnay4ba63a02017-12-28 15:53:05 -05001916pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1917 Lifetime {
1918 sym: _i . sym,
1919 span: _visitor.fold_span(_i . span),
1920 }
1921}
1922
Nika Layzella6f46c42017-10-26 15:26:16 -04001923pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001924 LifetimeDef {
1925 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001926 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001927 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001928 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1929 }
1930}
1931
1932pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1933 Lit {
1934 value: _i . value,
1935 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001936 }
1937}
1938# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001939pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001940 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001941 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001942 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1943 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1944 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1945 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1946 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1947 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1948 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001949 }
1950}
Nika Layzell27726662017-10-24 23:16:35 -04001951
David Tolnaydecf28d2017-11-11 11:56:45 -08001952pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1953 Macro {
1954 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001955 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001956 tokens: _i . tokens,
1957 }
1958}
David Tolnay85b69a42017-12-27 20:43:10 -05001959# [ cfg ( feature = "full" ) ]
1960pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1961 use ::Member::*;
1962 match _i {
1963 Named(_binding_0, ) => {
1964 Named (
1965 _visitor.fold_ident(_binding_0),
1966 )
1967 }
1968 Unnamed(_binding_0, ) => {
1969 Unnamed (
1970 _visitor.fold_index(_binding_0),
1971 )
1972 }
1973 }
1974}
David Tolnaydecf28d2017-11-11 11:56:45 -08001975
Nika Layzella6f46c42017-10-26 15:26:16 -04001976pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001977 use ::MetaItem::*;
1978 match _i {
1979 Term(_binding_0, ) => {
1980 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001981 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001982 )
1983 }
1984 List(_binding_0, ) => {
1985 List (
1986 _visitor.fold_meta_item_list(_binding_0),
1987 )
1988 }
1989 NameValue(_binding_0, ) => {
1990 NameValue (
1991 _visitor.fold_meta_name_value(_binding_0),
1992 )
1993 }
1994 }
1995}
1996
Nika Layzella6f46c42017-10-26 15:26:16 -04001997pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001998 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001999 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002000 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002001 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2002 }
2003}
2004
Nika Layzella6f46c42017-10-26 15:26:16 -04002005pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002006 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002007 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002008 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002009 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002010 }
2011}
2012# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002013pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002014 MethodSig {
2015 constness: _visitor.fold_constness(_i . constness),
2016 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002017 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002018 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002019 decl: _visitor.fold_fn_decl(_i . decl),
2020 }
2021}
2022
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002023pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2024 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002025 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002026 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002027 }
2028}
2029
Nika Layzella6f46c42017-10-26 15:26:16 -04002030pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002031 use ::Mutability::*;
2032 match _i {
2033 Mutable(_binding_0, ) => {
2034 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002035 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002036 )
2037 }
2038 Immutable => { Immutable }
2039 }
2040}
2041
Nika Layzella6f46c42017-10-26 15:26:16 -04002042pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002043 use ::NestedMetaItem::*;
2044 match _i {
2045 MetaItem(_binding_0, ) => {
2046 MetaItem (
2047 _visitor.fold_meta_item(_binding_0),
2048 )
2049 }
2050 Literal(_binding_0, ) => {
2051 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002052 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002053 )
2054 }
2055 }
2056}
2057
Nika Layzellc08227a2017-12-04 16:30:17 -05002058pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2059 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002060 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002061 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002062 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002063 }
2064}
2065# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002066pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002067 use ::Pat::*;
2068 match _i {
2069 Wild(_binding_0, ) => {
2070 Wild (
2071 _visitor.fold_pat_wild(_binding_0),
2072 )
2073 }
2074 Ident(_binding_0, ) => {
2075 Ident (
2076 _visitor.fold_pat_ident(_binding_0),
2077 )
2078 }
2079 Struct(_binding_0, ) => {
2080 Struct (
2081 _visitor.fold_pat_struct(_binding_0),
2082 )
2083 }
2084 TupleStruct(_binding_0, ) => {
2085 TupleStruct (
2086 _visitor.fold_pat_tuple_struct(_binding_0),
2087 )
2088 }
2089 Path(_binding_0, ) => {
2090 Path (
2091 _visitor.fold_pat_path(_binding_0),
2092 )
2093 }
2094 Tuple(_binding_0, ) => {
2095 Tuple (
2096 _visitor.fold_pat_tuple(_binding_0),
2097 )
2098 }
2099 Box(_binding_0, ) => {
2100 Box (
2101 _visitor.fold_pat_box(_binding_0),
2102 )
2103 }
2104 Ref(_binding_0, ) => {
2105 Ref (
2106 _visitor.fold_pat_ref(_binding_0),
2107 )
2108 }
2109 Lit(_binding_0, ) => {
2110 Lit (
2111 _visitor.fold_pat_lit(_binding_0),
2112 )
2113 }
2114 Range(_binding_0, ) => {
2115 Range (
2116 _visitor.fold_pat_range(_binding_0),
2117 )
2118 }
2119 Slice(_binding_0, ) => {
2120 Slice (
2121 _visitor.fold_pat_slice(_binding_0),
2122 )
2123 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002124 Macro(_binding_0, ) => {
2125 Macro (
2126 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002127 )
2128 }
2129 }
2130}
2131# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002132pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002133 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002134 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002135 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002136 }
2137}
2138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002140 PatIdent {
2141 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002142 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002143 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002144 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
2146}
2147# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002149 PatLit {
2150 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2151 }
2152}
2153# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002154pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002155 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002156 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002157 path: _visitor.fold_path(_i . path),
2158 }
2159}
2160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002161pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002162 PatRange {
2163 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002164 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002165 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
2167}
2168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002169pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002170 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002171 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002172 mutbl: _visitor.fold_mutability(_i . mutbl),
2173 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002174 }
2175}
2176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002177pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002178 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002179 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002180 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002181 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002182 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002183 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2184 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002185 }
2186}
2187# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002188pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002189 PatStruct {
2190 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002191 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002192 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002193 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002194 }
2195}
2196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002197pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002198 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002199 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002200 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002201 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002202 dots_pos: _i . dots_pos,
2203 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002204 }
2205}
2206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002207pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002208 PatTupleStruct {
2209 path: _visitor.fold_path(_i . path),
2210 pat: _visitor.fold_pat_tuple(_i . pat),
2211 }
2212}
2213# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002214pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002215 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002216 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002217 }
2218}
2219
Nika Layzella6f46c42017-10-26 15:26:16 -04002220pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002221 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002222 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002223 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2224 }
2225}
Nika Layzellc08227a2017-12-04 16:30:17 -05002226
2227pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2228 use ::PathArguments::*;
2229 match _i {
2230 None => { None }
2231 AngleBracketed(_binding_0, ) => {
2232 AngleBracketed (
2233 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2234 )
2235 }
2236 Parenthesized(_binding_0, ) => {
2237 Parenthesized (
2238 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2239 )
2240 }
2241 }
2242}
Nika Layzell27726662017-10-24 23:16:35 -04002243
Nika Layzella6f46c42017-10-26 15:26:16 -04002244pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002245 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002246 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002247 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002248 }
2249}
Nika Layzell27726662017-10-24 23:16:35 -04002250
Nika Layzella6f46c42017-10-26 15:26:16 -04002251pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002252 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002253 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002254 trait_ref: _visitor.fold_path(_i . trait_ref),
2255 }
2256}
2257
Nika Layzella6f46c42017-10-26 15:26:16 -04002258pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002259 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002260 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002261 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002262 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002263 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2264 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002265 }
2266}
2267# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002268pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002269 use ::RangeLimits::*;
2270 match _i {
2271 HalfOpen(_binding_0, ) => {
2272 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002273 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002274 )
2275 }
2276 Closed(_binding_0, ) => {
2277 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002278 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002279 )
2280 }
2281 }
2282}
David Tolnayf93b90d2017-11-11 19:21:26 -08002283
2284pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2285 use ::ReturnType::*;
2286 match _i {
2287 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002288 Type(_binding_0, _binding_1, ) => {
2289 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002290 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2291 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002292 )
2293 }
2294 }
2295}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002296
2297pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2298 _i
2299}
Nika Layzell27726662017-10-24 23:16:35 -04002300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002301pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002302 use ::Stmt::*;
2303 match _i {
2304 Local(_binding_0, ) => {
2305 Local (
2306 Box::new(_visitor.fold_local(* _binding_0)),
2307 )
2308 }
2309 Item(_binding_0, ) => {
2310 Item (
2311 Box::new(_visitor.fold_item(* _binding_0)),
2312 )
2313 }
2314 Expr(_binding_0, ) => {
2315 Expr (
2316 Box::new(_visitor.fold_expr(* _binding_0)),
2317 )
2318 }
2319 Semi(_binding_0, _binding_1, ) => {
2320 Semi (
2321 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002322 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002323 )
2324 }
Nika Layzell27726662017-10-24 23:16:35 -04002325 }
2326}
2327
Nika Layzella6f46c42017-10-26 15:26:16 -04002328pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002329 use ::TraitBoundModifier::*;
2330 match _i {
2331 None => { None }
2332 Maybe(_binding_0, ) => {
2333 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002334 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002335 )
2336 }
2337 }
2338}
2339# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002340pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002341 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002342 match _i {
2343 Const(_binding_0, ) => {
2344 Const (
2345 _visitor.fold_trait_item_const(_binding_0),
2346 )
2347 }
2348 Method(_binding_0, ) => {
2349 Method (
2350 _visitor.fold_trait_item_method(_binding_0),
2351 )
2352 }
2353 Type(_binding_0, ) => {
2354 Type (
2355 _visitor.fold_trait_item_type(_binding_0),
2356 )
2357 }
2358 Macro(_binding_0, ) => {
2359 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002360 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002361 )
2362 }
2363 }
2364}
2365# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002366pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2367 TraitItemConst {
2368 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002370 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002371 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002372 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002373 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002374 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002375 _visitor.fold_expr(( it ) . 1),
2376 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002377 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002378 }
2379}
2380# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002381pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2382 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002383 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002384 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002385 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002386 }
2387}
2388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002389pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002390 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002391 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002392 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002393 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002394 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002395 }
2396}
2397# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002398pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002399 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002400 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002401 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002402 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002403 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002404 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002405 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002406 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002407 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002408 _visitor.fold_type(( it ) . 1),
2409 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002410 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002411 }
2412}
2413
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002414pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2415 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002416 match _i {
2417 Slice(_binding_0, ) => {
2418 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002419 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002420 )
2421 }
2422 Array(_binding_0, ) => {
2423 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002425 )
2426 }
2427 Ptr(_binding_0, ) => {
2428 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002429 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002430 )
2431 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002432 Reference(_binding_0, ) => {
2433 Reference (
2434 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002435 )
2436 }
2437 BareFn(_binding_0, ) => {
2438 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002439 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
2442 Never(_binding_0, ) => {
2443 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002444 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002445 )
2446 }
David Tolnay05362582017-12-26 01:33:57 -05002447 Tuple(_binding_0, ) => {
2448 Tuple (
2449 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002450 )
2451 }
2452 Path(_binding_0, ) => {
2453 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002454 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002455 )
2456 }
2457 TraitObject(_binding_0, ) => {
2458 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002459 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002460 )
2461 }
2462 ImplTrait(_binding_0, ) => {
2463 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002464 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002465 )
2466 }
2467 Paren(_binding_0, ) => {
2468 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002469 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002470 )
2471 }
2472 Group(_binding_0, ) => {
2473 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002474 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002475 )
2476 }
2477 Infer(_binding_0, ) => {
2478 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002480 )
2481 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002482 Macro(_binding_0, ) => {
2483 Macro (
2484 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002485 )
2486 }
2487 }
2488}
2489
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2491 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002492 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002493 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002494 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002495 amt: _visitor.fold_expr(_i . amt),
2496 }
2497}
2498
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002499pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2500 TypeBareFn {
2501 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002502 }
2503}
2504
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002505pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2506 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002507 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002508 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509 ty: _visitor.fold_type(_i . ty),
2510 }
2511}
2512
2513pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2514 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002515 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002517 }
2518}
2519
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002520pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2521 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002522 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002524 }
2525}
2526
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002527pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2528 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002529 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002530 }
2531}
2532
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2534 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002535 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002536 }
2537}
2538
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002539pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2540 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002541 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002542 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002543 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002545 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002546 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002547 }
2548}
2549
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2551 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002552 match _i {
2553 Trait(_binding_0, _binding_1, ) => {
2554 Trait (
2555 _visitor.fold_poly_trait_ref(_binding_0),
2556 _visitor.fold_trait_bound_modifier(_binding_1),
2557 )
2558 }
2559 Region(_binding_0, ) => {
2560 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002561 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002562 )
2563 }
2564 }
2565}
2566
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2568 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002569 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002571 }
2572}
2573
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2575 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002576 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002577 path: _visitor.fold_path(_i . path),
2578 }
2579}
2580
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002581pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2582 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002583 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2584 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 }
2587}
2588
David Tolnay0a89b4d2017-11-13 00:55:45 -08002589pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2590 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002591 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002592 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002593 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002594 }
2595}
2596
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2598 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002599 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002600 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002601 }
2602}
2603
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002604pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2605 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002606 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002607 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002608 }
2609}
2610
David Tolnay05362582017-12-26 01:33:57 -05002611pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2612 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002613 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002614 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002615 }
2616}
2617
Nika Layzella6f46c42017-10-26 15:26:16 -04002618pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002619 use ::UnOp::*;
2620 match _i {
2621 Deref(_binding_0, ) => {
2622 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002623 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002624 )
2625 }
2626 Not(_binding_0, ) => {
2627 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002628 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002629 )
2630 }
2631 Neg(_binding_0, ) => {
2632 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002633 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002634 )
2635 }
2636 }
2637}
2638
Nika Layzella6f46c42017-10-26 15:26:16 -04002639pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002640 use ::Unsafety::*;
2641 match _i {
2642 Unsafe(_binding_0, ) => {
2643 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002644 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002645 )
2646 }
2647 Normal => { Normal }
2648 }
2649}
David Tolnay5f332a92017-12-26 00:42:45 -05002650# [ cfg ( feature = "full" ) ]
2651pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2652 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002653 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002654 }
2655}
2656# [ cfg ( feature = "full" ) ]
2657pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2658 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002659 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002660 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2661 }
2662}
2663# [ cfg ( feature = "full" ) ]
2664pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2665 UsePath {
2666 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002667 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002668 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002669 _visitor.fold_ident(( it ) . 1),
2670 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002671 }
2672}
2673# [ cfg ( feature = "full" ) ]
2674pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2675 use ::UseTree::*;
2676 match _i {
2677 Path(_binding_0, ) => {
2678 Path (
2679 _visitor.fold_use_path(_binding_0),
2680 )
2681 }
2682 Glob(_binding_0, ) => {
2683 Glob (
2684 _visitor.fold_use_glob(_binding_0),
2685 )
2686 }
2687 List(_binding_0, ) => {
2688 List (
2689 _visitor.fold_use_list(_binding_0),
2690 )
2691 }
2692 }
2693}
Nika Layzell27726662017-10-24 23:16:35 -04002694
Nika Layzella6f46c42017-10-26 15:26:16 -04002695pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002696 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002697 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002698 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002699 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05002700 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002701 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002702 }
2703}
2704
Nika Layzella6f46c42017-10-26 15:26:16 -04002705pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002706 use ::VariantData::*;
2707 match _i {
2708 Struct(_binding_0, _binding_1, ) => {
2709 Struct (
2710 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002711 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002712 )
2713 }
2714 Tuple(_binding_0, _binding_1, ) => {
2715 Tuple (
2716 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002717 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002718 )
2719 }
2720 Unit => { Unit }
2721 }
2722}
Nika Layzell27726662017-10-24 23:16:35 -04002723
Nika Layzella6f46c42017-10-26 15:26:16 -04002724pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002725 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002726 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002727 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002728 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002729 }
2730}
2731
Nika Layzella6f46c42017-10-26 15:26:16 -04002732pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002733 VisInherited {
2734 }
2735}
2736
Nika Layzella6f46c42017-10-26 15:26:16 -04002737pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002738 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002739 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
2741}
2742
Nika Layzella6f46c42017-10-26 15:26:16 -04002743pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002744 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002745 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002746 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002747 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002748 path: Box::new(_visitor.fold_path(* _i . path)),
2749 }
2750}
2751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002753 use ::Visibility::*;
2754 match _i {
2755 Public(_binding_0, ) => {
2756 Public (
2757 _visitor.fold_vis_public(_binding_0),
2758 )
2759 }
2760 Crate(_binding_0, ) => {
2761 Crate (
2762 _visitor.fold_vis_crate(_binding_0),
2763 )
2764 }
2765 Restricted(_binding_0, ) => {
2766 Restricted (
2767 _visitor.fold_vis_restricted(_binding_0),
2768 )
2769 }
2770 Inherited(_binding_0, ) => {
2771 Inherited (
2772 _visitor.fold_vis_inherited(_binding_0),
2773 )
2774 }
2775 }
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