blob: 4c54cb3571ce44158db7ea1b266c18394e85728e [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_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
397}
398
399
Nika Layzella6f46c42017-10-26 15:26:16 -0400400pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400401 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500402 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400403 kind: _visitor.fold_abi_kind(_i . kind),
404 }
405}
406
Nika Layzella6f46c42017-10-26 15:26:16 -0400407pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400408 use ::AbiKind::*;
409 match _i {
410 Named(_binding_0, ) => {
411 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500412 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400413 )
414 }
415 Default => { Default }
416 }
417}
418
Nika Layzellc08227a2017-12-04 16:30:17 -0500419pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
420 AngleBracketedGenericArguments {
David Tolnaycc0f0372017-12-28 19:11:04 -0500421 turbofish: (_i . turbofish).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
422 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500423 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400425 }
426}
427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400428pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400429 ArgCaptured {
430 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500431 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800432 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgSelf {
438 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400440 }
441}
442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400443pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400444 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500446 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400447 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500448 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400449 }
450}
451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400452pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400453 Arm {
454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
455 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400457 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400465 use ::AttrStyle::*;
466 match _i {
467 Outer => { Outer }
468 Inner(_binding_0, ) => {
469 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 )
472 }
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400477 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500480 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 path: _visitor.fold_path(_i . path),
482 tts: _i . tts,
483 is_sugared_doc: _i . is_sugared_doc,
484 }
485}
486
Nika Layzella6f46c42017-10-26 15:26:16 -0400487pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400488 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500489 name: (_i . name).map(|it| { (
490 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800493 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400498 use ::BareFnArgName::*;
499 match _i {
500 Named(_binding_0, ) => {
501 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500502 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 Wild(_binding_0, ) => {
506 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
512
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800513pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
514 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400515 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400516 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500518 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500519 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800522 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400523 }
524}
525
Nika Layzella6f46c42017-10-26 15:26:16 -0400526pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400527 use ::BinOp::*;
528 match _i {
529 Add(_binding_0, ) => {
530 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400532 )
533 }
534 Sub(_binding_0, ) => {
535 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500536 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400537 )
538 }
539 Mul(_binding_0, ) => {
540 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 Div(_binding_0, ) => {
545 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500546 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400547 )
548 }
549 Rem(_binding_0, ) => {
550 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
554 And(_binding_0, ) => {
555 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
559 Or(_binding_0, ) => {
560 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
564 BitXor(_binding_0, ) => {
565 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
569 BitAnd(_binding_0, ) => {
570 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
574 BitOr(_binding_0, ) => {
575 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
579 Shl(_binding_0, ) => {
580 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
584 Shr(_binding_0, ) => {
585 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
589 Eq(_binding_0, ) => {
590 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
594 Lt(_binding_0, ) => {
595 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
599 Le(_binding_0, ) => {
600 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
604 Ne(_binding_0, ) => {
605 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
609 Ge(_binding_0, ) => {
610 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
614 Gt(_binding_0, ) => {
615 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
619 AddEq(_binding_0, ) => {
620 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
624 SubEq(_binding_0, ) => {
625 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
629 MulEq(_binding_0, ) => {
630 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
634 DivEq(_binding_0, ) => {
635 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
639 RemEq(_binding_0, ) => {
640 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
644 BitXorEq(_binding_0, ) => {
645 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
649 BitAndEq(_binding_0, ) => {
650 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
654 BitOrEq(_binding_0, ) => {
655 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500656 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400657 )
658 }
659 ShlEq(_binding_0, ) => {
660 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500661 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 )
663 }
664 ShrEq(_binding_0, ) => {
665 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400667 )
668 }
669 }
670}
671# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400672pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400673 use ::BindingMode::*;
674 match _i {
675 ByRef(_binding_0, _binding_1, ) => {
676 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500677 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400678 _visitor.fold_mutability(_binding_1),
679 )
680 }
681 ByValue(_binding_0, ) => {
682 ByValue (
683 _visitor.fold_mutability(_binding_0),
684 )
685 }
686 }
687}
688# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400689pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400690 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500691 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400692 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
693 }
694}
695
Nika Layzella6f46c42017-10-26 15:26:16 -0400696pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400697 use ::Body::*;
698 match _i {
699 Enum(_binding_0, ) => {
700 Enum (
701 _visitor.fold_body_enum(_binding_0),
702 )
703 }
704 Struct(_binding_0, ) => {
705 Struct (
706 _visitor.fold_body_struct(_binding_0),
707 )
708 }
709 }
710}
711
Nika Layzella6f46c42017-10-26 15:26:16 -0400712pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400713 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500715 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400716 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
717 }
718}
719
Nika Layzella6f46c42017-10-26 15:26:16 -0400720pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400721 BodyStruct {
722 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
724 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400725 }
726}
727
Nika Layzella6f46c42017-10-26 15:26:16 -0400728pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400729 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500730 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
731 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400732 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500733 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400734 }
735}
736# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400737pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400738 use ::CaptureBy::*;
739 match _i {
740 Value(_binding_0, ) => {
741 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500742 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400743 )
744 }
745 Ref => { Ref }
746 }
747}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500748
749pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
750 ConstParam {
751 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500752 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500753 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500754 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500755 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500757 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
758 }
759}
Nika Layzell27726662017-10-24 23:16:35 -0400760# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400761pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400762 use ::Constness::*;
763 match _i {
764 Const(_binding_0, ) => {
765 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500766 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400767 )
768 }
769 NotConst => { NotConst }
770 }
771}
772# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400773pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400774 use ::Defaultness::*;
775 match _i {
776 Default(_binding_0, ) => {
777 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500778 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400779 )
780 }
781 Final => { Final }
782 }
783}
784
Nika Layzella6f46c42017-10-26 15:26:16 -0400785pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400786 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400787 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500788 vis: _visitor.fold_visibility(_i . vis),
789 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400790 generics: _visitor.fold_generics(_i . generics),
791 body: _visitor.fold_body(_i . body),
792 }
793}
794
Nika Layzella6f46c42017-10-26 15:26:16 -0400795pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400796 Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400797 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500798 node: _visitor.fold_expr_kind(_i . node),
Nika Layzell27726662017-10-24 23:16:35 -0400799 }
800}
801# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400802pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400803 ExprAddrOf {
David Tolnaycc0f0372017-12-28 19:11:04 -0500804 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 mutbl: _visitor.fold_mutability(_i . mutbl),
806 expr: Box::new(_visitor.fold_expr(* _i . expr)),
807 }
808}
809# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400810pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400811 ExprArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500812 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500813 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400814 }
815}
816# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400817pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400818 ExprAssign {
819 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500820 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500821 right: Box::new(_visitor.fold_expr(* _i . right)),
Nika Layzell27726662017-10-24 23:16:35 -0400822 }
823}
824# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400825pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400826 ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400827 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500828 op: _visitor.fold_bin_op(_i . op),
Nika Layzell27726662017-10-24 23:16:35 -0400829 right: Box::new(_visitor.fold_expr(* _i . right)),
830 }
831}
832
Nika Layzella6f46c42017-10-26 15:26:16 -0400833pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400834 ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400835 left: Box::new(_visitor.fold_expr(* _i . left)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500836 op: _visitor.fold_bin_op(_i . op),
Nika Layzell27726662017-10-24 23:16:35 -0400837 right: Box::new(_visitor.fold_expr(* _i . right)),
838 }
839}
840# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400841pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400842 ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400843 block: _visitor.fold_block(_i . block),
844 }
845}
846# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400847pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400848 ExprBox {
David Tolnaycc0f0372017-12-28 19:11:04 -0500849 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500850 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -0400851 }
852}
853# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400854pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400855 ExprBreak {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500856 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500857 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400858 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400859 }
860}
861
Nika Layzella6f46c42017-10-26 15:26:16 -0400862pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400863 ExprCall {
864 func: Box::new(_visitor.fold_expr(* _i . func)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500865 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500866 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400867 }
868}
869
Nika Layzella6f46c42017-10-26 15:26:16 -0400870pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400871 ExprCast {
872 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500873 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800874 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 }
876}
877# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400878pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400879 ExprCatch {
David Tolnaycc0f0372017-12-28 19:11:04 -0500880 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
881 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 block: _visitor.fold_block(_i . block),
883 }
884}
885# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400886pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400887 ExprClosure {
888 capture: _visitor.fold_capture_by(_i . capture),
David Tolnaycc0f0372017-12-28 19:11:04 -0500889 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
David Tolnay7f675742017-12-27 22:43:21 -0500890 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500891 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
David Tolnay7f675742017-12-27 22:43:21 -0500892 output: _visitor.fold_return_type(_i . output),
893 body: Box::new(_visitor.fold_expr(* _i . body)),
Nika Layzell27726662017-10-24 23:16:35 -0400894 }
895}
896# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400897pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400898 ExprContinue {
David Tolnaycc0f0372017-12-28 19:11:04 -0500899 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500900 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400901 }
902}
903# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400904pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400905 ExprField {
David Tolnay85b69a42017-12-27 20:43:10 -0500906 base: Box::new(_visitor.fold_expr(* _i . base)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500907 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay85b69a42017-12-27 20:43:10 -0500908 member: _visitor.fold_member(_i . member),
Nika Layzell27726662017-10-24 23:16:35 -0400909 }
910}
911# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400912pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400913 ExprForLoop {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500914 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
915 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
916 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400917 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500918 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400919 expr: Box::new(_visitor.fold_expr(* _i . expr)),
920 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -0400921 }
922}
923
Nika Layzella6f46c42017-10-26 15:26:16 -0400924pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400925 ExprGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500926 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500927 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 }
929}
930# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400931pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400932 ExprIf {
David Tolnay4a3f59a2017-12-28 21:21:12 -0500933 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400934 cond: Box::new(_visitor.fold_expr(* _i . cond)),
935 if_true: _visitor.fold_block(_i . if_true),
David Tolnaycc0f0372017-12-28 19:11:04 -0500936 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500937 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400938 }
939}
940# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400941pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400942 ExprIfLet {
David Tolnaycc0f0372017-12-28 19:11:04 -0500943 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
944 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500945 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500946 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500947 expr: Box::new(_visitor.fold_expr(* _i . expr)),
948 if_true: _visitor.fold_block(_i . if_true),
David Tolnaycc0f0372017-12-28 19:11:04 -0500949 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500950 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400951 }
952}
953# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400954pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400955 ExprInPlace {
956 place: Box::new(_visitor.fold_expr(* _i . place)),
957 kind: _visitor.fold_in_place_kind(_i . kind),
958 value: Box::new(_visitor.fold_expr(* _i . value)),
959 }
960}
961
Nika Layzella6f46c42017-10-26 15:26:16 -0400962pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400963 ExprIndex {
964 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500965 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500966 index: Box::new(_visitor.fold_expr(* _i . index)),
Nika Layzell27726662017-10-24 23:16:35 -0400967 }
968}
969
Nika Layzella6f46c42017-10-26 15:26:16 -0400970pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400971 use ::ExprKind::*;
972 match _i {
973 Box(_binding_0, ) => {
974 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400975 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400976 )
977 }
978 InPlace(_binding_0, ) => {
979 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400980 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400981 )
982 }
983 Array(_binding_0, ) => {
984 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400985 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400986 )
987 }
988 Call(_binding_0, ) => {
989 Call (
990 _visitor.fold_expr_call(_binding_0),
991 )
992 }
993 MethodCall(_binding_0, ) => {
994 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400995 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400996 )
997 }
David Tolnay05362582017-12-26 01:33:57 -0500998 Tuple(_binding_0, ) => {
999 Tuple (
1000 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001001 )
1002 }
1003 Binary(_binding_0, ) => {
1004 Binary (
1005 _visitor.fold_expr_binary(_binding_0),
1006 )
1007 }
1008 Unary(_binding_0, ) => {
1009 Unary (
1010 _visitor.fold_expr_unary(_binding_0),
1011 )
1012 }
1013 Lit(_binding_0, ) => {
1014 Lit (
David Tolnay4ba63a02017-12-28 15:53:05 -05001015 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001016 )
1017 }
1018 Cast(_binding_0, ) => {
1019 Cast (
1020 _visitor.fold_expr_cast(_binding_0),
1021 )
1022 }
1023 Type(_binding_0, ) => {
1024 Type (
1025 _visitor.fold_expr_type(_binding_0),
1026 )
1027 }
1028 If(_binding_0, ) => {
1029 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001030 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001031 )
1032 }
1033 IfLet(_binding_0, ) => {
1034 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001035 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001036 )
1037 }
1038 While(_binding_0, ) => {
1039 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001040 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001041 )
1042 }
1043 WhileLet(_binding_0, ) => {
1044 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001045 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001046 )
1047 }
1048 ForLoop(_binding_0, ) => {
1049 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001050 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001051 )
1052 }
1053 Loop(_binding_0, ) => {
1054 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001055 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001056 )
1057 }
1058 Match(_binding_0, ) => {
1059 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001060 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001061 )
1062 }
1063 Closure(_binding_0, ) => {
1064 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001065 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001066 )
1067 }
Nika Layzell640832a2017-12-04 13:37:09 -05001068 Unsafe(_binding_0, ) => {
1069 Unsafe (
1070 full!(_visitor.fold_expr_unsafe(_binding_0)),
1071 )
1072 }
Nika Layzell27726662017-10-24 23:16:35 -04001073 Block(_binding_0, ) => {
1074 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001075 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001076 )
1077 }
1078 Assign(_binding_0, ) => {
1079 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001080 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001081 )
1082 }
1083 AssignOp(_binding_0, ) => {
1084 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001085 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001086 )
1087 }
1088 Field(_binding_0, ) => {
1089 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001090 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001091 )
1092 }
Nika Layzell27726662017-10-24 23:16:35 -04001093 Index(_binding_0, ) => {
1094 Index (
1095 _visitor.fold_expr_index(_binding_0),
1096 )
1097 }
1098 Range(_binding_0, ) => {
1099 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001100 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001101 )
1102 }
1103 Path(_binding_0, ) => {
1104 Path (
1105 _visitor.fold_expr_path(_binding_0),
1106 )
1107 }
1108 AddrOf(_binding_0, ) => {
1109 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001110 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001111 )
1112 }
1113 Break(_binding_0, ) => {
1114 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001115 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001116 )
1117 }
1118 Continue(_binding_0, ) => {
1119 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001120 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001121 )
1122 }
1123 Ret(_binding_0, ) => {
1124 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001125 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001126 )
1127 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001128 Macro(_binding_0, ) => {
1129 Macro (
1130 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001131 )
1132 }
1133 Struct(_binding_0, ) => {
1134 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001135 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001136 )
1137 }
1138 Repeat(_binding_0, ) => {
1139 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001140 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001141 )
1142 }
1143 Paren(_binding_0, ) => {
1144 Paren (
1145 _visitor.fold_expr_paren(_binding_0),
1146 )
1147 }
1148 Group(_binding_0, ) => {
1149 Group (
1150 _visitor.fold_expr_group(_binding_0),
1151 )
1152 }
1153 Try(_binding_0, ) => {
1154 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001155 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001156 )
1157 }
1158 Catch(_binding_0, ) => {
1159 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001160 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001161 )
1162 }
1163 Yield(_binding_0, ) => {
1164 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001165 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001166 )
1167 }
1168 }
1169}
1170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001171pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001172 ExprLoop {
David Tolnay4ba63a02017-12-28 15:53:05 -05001173 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001174 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001175 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1176 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001177 }
1178}
1179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001180pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001181 ExprMatch {
David Tolnaycc0f0372017-12-28 19:11:04 -05001182 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001183 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001184 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001185 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1186 }
1187}
1188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001189pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001190 ExprMethodCall {
1191 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001192 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001193 method: _visitor.fold_ident(_i . method),
David Tolnaycc0f0372017-12-28 19:11:04 -05001194 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001195 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
1196 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001197 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001198 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1199 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
1201}
1202
Nika Layzella6f46c42017-10-26 15:26:16 -04001203pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001204 ExprParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001205 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001206 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001207 }
1208}
1209
Nika Layzella6f46c42017-10-26 15:26:16 -04001210pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001211 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001212 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001213 path: _visitor.fold_path(_i . path),
1214 }
1215}
1216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001217pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001218 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001219 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001220 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001221 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001222 }
1223}
1224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001225pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001226 ExprRepeat {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001227 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001228 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001229 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001230 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1231 }
1232}
1233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001234pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprRet {
David Tolnaycc0f0372017-12-28 19:11:04 -05001236 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001237 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
1240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001241pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001242 ExprStruct {
1243 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001244 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001245 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1246 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1247 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001248 }
1249}
1250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprTry {
1253 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001254 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001258pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1259 ExprTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001260 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001261 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001262 }
1263}
Nika Layzell27726662017-10-24 23:16:35 -04001264
Nika Layzella6f46c42017-10-26 15:26:16 -04001265pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001266 ExprType {
1267 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001268 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001269 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
1271}
1272
Nika Layzella6f46c42017-10-26 15:26:16 -04001273pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprUnary {
1275 op: _visitor.fold_un_op(_i . op),
1276 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1277 }
1278}
1279# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001280pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1281 ExprUnsafe {
David Tolnaycc0f0372017-12-28 19:11:04 -05001282 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001283 block: _visitor.fold_block(_i . block),
1284 }
1285}
1286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001287pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001288 ExprWhile {
David Tolnay4ba63a02017-12-28 15:53:05 -05001289 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001290 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1291 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001292 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1293 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001294 }
1295}
1296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001297pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001298 ExprWhileLet {
David Tolnay4ba63a02017-12-28 15:53:05 -05001299 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001300 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1301 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1302 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001303 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001304 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001305 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1306 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001307 }
1308}
1309# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001310pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001311 ExprYield {
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001313 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001314 }
1315}
1316
Nika Layzella6f46c42017-10-26 15:26:16 -04001317pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001318 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001320 vis: _visitor.fold_visibility(_i . vis),
1321 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001322 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001323 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001324 }
1325}
1326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001327pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001328 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001329 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001330 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001331 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001332 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1333 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001334 }
1335}
1336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001337pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001338 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001339 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1340 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001341 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001342 expr: _visitor.fold_expr(_i . expr),
1343 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001344 }
1345}
1346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001347pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001348 File {
1349 shebang: _i . shebang,
1350 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1351 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1352 }
1353}
1354# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001355pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001356 use ::FnArg::*;
1357 match _i {
1358 SelfRef(_binding_0, ) => {
1359 SelfRef (
1360 _visitor.fold_arg_self_ref(_binding_0),
1361 )
1362 }
1363 SelfValue(_binding_0, ) => {
1364 SelfValue (
1365 _visitor.fold_arg_self(_binding_0),
1366 )
1367 }
1368 Captured(_binding_0, ) => {
1369 Captured (
1370 _visitor.fold_arg_captured(_binding_0),
1371 )
1372 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001373 Inferred(_binding_0, ) => {
1374 Inferred (
1375 _visitor.fold_pat(_binding_0),
1376 )
1377 }
Nika Layzell27726662017-10-24 23:16:35 -04001378 Ignored(_binding_0, ) => {
1379 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001380 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001381 )
1382 }
1383 }
1384}
1385# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001386pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001387 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001388 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001389 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001390 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001391 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001392 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001393 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001394 }
1395}
1396# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001397pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001398 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001399 match _i {
1400 Fn(_binding_0, ) => {
1401 Fn (
1402 _visitor.fold_foreign_item_fn(_binding_0),
1403 )
1404 }
1405 Static(_binding_0, ) => {
1406 Static (
1407 _visitor.fold_foreign_item_static(_binding_0),
1408 )
1409 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001410 Type(_binding_0, ) => {
1411 Type (
1412 _visitor.fold_foreign_item_type(_binding_0),
1413 )
1414 }
Nika Layzell27726662017-10-24 23:16:35 -04001415 }
1416}
1417# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001418pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1419 ForeignItemFn {
1420 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1421 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001422 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001423 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001424 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001425 }
1426}
1427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001428pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001429 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001430 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1431 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001432 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001433 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001434 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001435 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001436 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001438 }
1439}
David Tolnay199bcbb2017-11-12 10:33:52 -08001440# [ cfg ( feature = "full" ) ]
1441pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1442 ForeignItemType {
1443 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1444 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001445 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001446 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001447 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001448 }
1449}
Nika Layzell27726662017-10-24 23:16:35 -04001450
Nika Layzellc08227a2017-12-04 16:30:17 -05001451pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1452 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001453 match _i {
1454 Lifetime(_binding_0, ) => {
1455 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001456 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001457 )
1458 }
1459 Type(_binding_0, ) => {
1460 Type (
1461 _visitor.fold_type(_binding_0),
1462 )
1463 }
1464 TypeBinding(_binding_0, ) => {
1465 TypeBinding (
1466 _visitor.fold_type_binding(_binding_0),
1467 )
1468 }
Nika Layzellc680e612017-12-04 19:07:20 -05001469 Const(_binding_0, ) => {
1470 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001471 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001472 )
1473 }
Nika Layzell357885a2017-12-04 15:47:07 -05001474 }
1475}
1476
David Tolnayc2f1aba2017-11-12 20:29:22 -08001477pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1478 use ::GenericParam::*;
1479 match _i {
1480 Lifetime(_binding_0, ) => {
1481 Lifetime (
1482 _visitor.fold_lifetime_def(_binding_0),
1483 )
1484 }
1485 Type(_binding_0, ) => {
1486 Type (
1487 _visitor.fold_type_param(_binding_0),
1488 )
1489 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001490 Const(_binding_0, ) => {
1491 Const (
1492 _visitor.fold_const_param(_binding_0),
1493 )
1494 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001495 }
1496}
1497
Nika Layzella6f46c42017-10-26 15:26:16 -04001498pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001499 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001500 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001501 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001502 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001503 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001504 }
1505}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001506
1507pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001508 Ident {
1509 sym: _i . sym,
1510 span: _visitor.fold_span(_i . span),
1511 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001512}
Nika Layzell27726662017-10-24 23:16:35 -04001513# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001514pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001515 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001516 match _i {
1517 Const(_binding_0, ) => {
1518 Const (
1519 _visitor.fold_impl_item_const(_binding_0),
1520 )
1521 }
1522 Method(_binding_0, ) => {
1523 Method (
1524 _visitor.fold_impl_item_method(_binding_0),
1525 )
1526 }
1527 Type(_binding_0, ) => {
1528 Type (
1529 _visitor.fold_impl_item_type(_binding_0),
1530 )
1531 }
1532 Macro(_binding_0, ) => {
1533 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001534 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001535 )
1536 }
1537 }
1538}
1539# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001540pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1541 ImplItemConst {
1542 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1543 vis: _visitor.fold_visibility(_i . vis),
1544 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001545 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001546 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001547 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001548 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001549 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001550 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001551 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001552 }
1553}
1554# [ cfg ( feature = "full" ) ]
1555pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1556 ImplItemMacro {
1557 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1558 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001559 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001560 }
1561}
1562# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001563pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001564 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001565 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001566 vis: _visitor.fold_visibility(_i . vis),
1567 defaultness: _visitor.fold_defaultness(_i . defaultness),
1568 sig: _visitor.fold_method_sig(_i . sig),
1569 block: _visitor.fold_block(_i . block),
1570 }
1571}
1572# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001573pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001574 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001575 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001576 vis: _visitor.fold_visibility(_i . vis),
1577 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001578 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001579 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001580 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001581 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001582 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001583 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001584 }
1585}
1586# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001587pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001588 use ::ImplPolarity::*;
1589 match _i {
1590 Positive => { Positive }
1591 Negative(_binding_0, ) => {
1592 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001594 )
1595 }
1596 }
1597}
1598# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001599pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001600 use ::InPlaceKind::*;
1601 match _i {
1602 Arrow(_binding_0, ) => {
1603 Arrow (
David Tolnaycc0f0372017-12-28 19:11:04 -05001604 Token ! [ <- ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001605 )
1606 }
1607 In(_binding_0, ) => {
1608 In (
David Tolnaycc0f0372017-12-28 19:11:04 -05001609 Token ! [ in ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001610 )
1611 }
1612 }
1613}
1614# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001615pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1616 Index {
1617 index: _i . index,
1618 span: _visitor.fold_span(_i . span),
1619 }
1620}
1621# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001622pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001623 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001624 match _i {
1625 ExternCrate(_binding_0, ) => {
1626 ExternCrate (
1627 _visitor.fold_item_extern_crate(_binding_0),
1628 )
1629 }
1630 Use(_binding_0, ) => {
1631 Use (
1632 _visitor.fold_item_use(_binding_0),
1633 )
1634 }
1635 Static(_binding_0, ) => {
1636 Static (
1637 _visitor.fold_item_static(_binding_0),
1638 )
1639 }
1640 Const(_binding_0, ) => {
1641 Const (
1642 _visitor.fold_item_const(_binding_0),
1643 )
1644 }
1645 Fn(_binding_0, ) => {
1646 Fn (
1647 _visitor.fold_item_fn(_binding_0),
1648 )
1649 }
1650 Mod(_binding_0, ) => {
1651 Mod (
1652 _visitor.fold_item_mod(_binding_0),
1653 )
1654 }
1655 ForeignMod(_binding_0, ) => {
1656 ForeignMod (
1657 _visitor.fold_item_foreign_mod(_binding_0),
1658 )
1659 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001660 Type(_binding_0, ) => {
1661 Type (
1662 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001663 )
1664 }
1665 Enum(_binding_0, ) => {
1666 Enum (
1667 _visitor.fold_item_enum(_binding_0),
1668 )
1669 }
1670 Struct(_binding_0, ) => {
1671 Struct (
1672 _visitor.fold_item_struct(_binding_0),
1673 )
1674 }
1675 Union(_binding_0, ) => {
1676 Union (
1677 _visitor.fold_item_union(_binding_0),
1678 )
1679 }
1680 Trait(_binding_0, ) => {
1681 Trait (
1682 _visitor.fold_item_trait(_binding_0),
1683 )
1684 }
1685 DefaultImpl(_binding_0, ) => {
1686 DefaultImpl (
1687 _visitor.fold_item_default_impl(_binding_0),
1688 )
1689 }
1690 Impl(_binding_0, ) => {
1691 Impl (
1692 _visitor.fold_item_impl(_binding_0),
1693 )
1694 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001695 Macro(_binding_0, ) => {
1696 Macro (
1697 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001698 )
1699 }
David Tolnay500d8322017-12-18 00:32:51 -08001700 Macro2(_binding_0, ) => {
1701 Macro2 (
1702 _visitor.fold_item_macro2(_binding_0),
1703 )
1704 }
Nika Layzell27726662017-10-24 23:16:35 -04001705 }
1706}
1707# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001708pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1709 ItemConst {
1710 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1711 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001712 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001713 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001714 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001715 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001716 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001717 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001718 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001719 }
1720}
1721# [ cfg ( feature = "full" ) ]
1722pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1723 ItemDefaultImpl {
1724 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1725 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001726 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001727 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001728 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1729 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001730 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001731 }
1732}
1733# [ cfg ( feature = "full" ) ]
1734pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1735 ItemEnum {
1736 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1737 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001738 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001739 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001740 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001741 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001742 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1743 }
1744}
1745# [ cfg ( feature = "full" ) ]
1746pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1747 ItemExternCrate {
1748 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1749 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001750 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1751 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001752 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001753 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001754 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001755 _visitor.fold_ident(( it ) . 1),
1756 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001757 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001758 }
1759}
1760# [ cfg ( feature = "full" ) ]
1761pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1762 ItemFn {
1763 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1764 vis: _visitor.fold_visibility(_i . vis),
1765 constness: _visitor.fold_constness(_i . constness),
1766 unsafety: _visitor.fold_unsafety(_i . unsafety),
1767 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001768 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001769 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001770 block: Box::new(_visitor.fold_block(* _i . block)),
1771 }
1772}
1773# [ cfg ( feature = "full" ) ]
1774pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1775 ItemForeignMod {
1776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1777 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001778 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001779 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1780 }
1781}
1782# [ cfg ( feature = "full" ) ]
1783pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1784 ItemImpl {
1785 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1786 defaultness: _visitor.fold_defaultness(_i . defaultness),
1787 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001788 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001790 trait_: (_i . trait_).map(|it| { (
1791 _visitor.fold_impl_polarity(( it ) . 0),
1792 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001793 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001794 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001795 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001796 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001797 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1798 }
1799}
1800# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001801pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1802 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001803 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001804 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001805 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001807 }
1808}
1809# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001810pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1811 ItemMacro2 {
1812 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1813 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001814 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001815 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001816 args: _i . args,
1817 body: _i . body,
1818 }
1819}
1820# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001821pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001822 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001823 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001824 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001825 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001826 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001827 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001828 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001829 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1830 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001832 }
1833}
1834# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001835pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001836 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001837 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001838 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001839 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001840 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001841 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001843 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001844 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001845 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001847 }
1848}
1849# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001850pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001851 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001852 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001853 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001854 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001855 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001856 generics: _visitor.fold_generics(_i . generics),
1857 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001858 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001859 }
1860}
1861# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001862pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001863 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001864 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001865 vis: _visitor.fold_visibility(_i . vis),
1866 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1868 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001869 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001870 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001872 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001873 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001874 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1875 }
1876}
1877# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001878pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1879 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001880 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001881 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001882 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001883 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001884 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001885 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001886 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001888 }
1889}
1890# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001891pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001892 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001893 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001894 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001896 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001897 generics: _visitor.fold_generics(_i . generics),
1898 data: _visitor.fold_variant_data(_i . data),
1899 }
1900}
1901# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001902pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001903 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001904 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001905 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1907 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001908 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1909 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001911 }
1912}
1913
David Tolnay4ba63a02017-12-28 15:53:05 -05001914pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1915 Lifetime {
1916 sym: _i . sym,
1917 span: _visitor.fold_span(_i . span),
1918 }
1919}
1920
Nika Layzella6f46c42017-10-26 15:26:16 -04001921pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001922 LifetimeDef {
1923 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001924 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001925 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001926 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1927 }
1928}
1929
1930pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1931 Lit {
1932 value: _i . value,
1933 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001934 }
1935}
1936# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001937pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001938 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001939 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001940 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1941 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1942 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1943 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1944 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1945 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1946 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001947 }
1948}
Nika Layzell27726662017-10-24 23:16:35 -04001949
David Tolnaydecf28d2017-11-11 11:56:45 -08001950pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1951 Macro {
1952 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001953 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001954 tokens: _i . tokens,
1955 }
1956}
David Tolnay85b69a42017-12-27 20:43:10 -05001957# [ cfg ( feature = "full" ) ]
1958pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1959 use ::Member::*;
1960 match _i {
1961 Named(_binding_0, ) => {
1962 Named (
1963 _visitor.fold_ident(_binding_0),
1964 )
1965 }
1966 Unnamed(_binding_0, ) => {
1967 Unnamed (
1968 _visitor.fold_index(_binding_0),
1969 )
1970 }
1971 }
1972}
David Tolnaydecf28d2017-11-11 11:56:45 -08001973
Nika Layzella6f46c42017-10-26 15:26:16 -04001974pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001975 use ::MetaItem::*;
1976 match _i {
1977 Term(_binding_0, ) => {
1978 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001979 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001980 )
1981 }
1982 List(_binding_0, ) => {
1983 List (
1984 _visitor.fold_meta_item_list(_binding_0),
1985 )
1986 }
1987 NameValue(_binding_0, ) => {
1988 NameValue (
1989 _visitor.fold_meta_name_value(_binding_0),
1990 )
1991 }
1992 }
1993}
1994
Nika Layzella6f46c42017-10-26 15:26:16 -04001995pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001996 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001997 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001998 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001999 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2000 }
2001}
2002
Nika Layzella6f46c42017-10-26 15:26:16 -04002003pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002004 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002005 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002006 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002007 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002008 }
2009}
2010# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002011pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002012 MethodSig {
2013 constness: _visitor.fold_constness(_i . constness),
2014 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002015 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002016 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002017 decl: _visitor.fold_fn_decl(_i . decl),
2018 }
2019}
2020
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002021pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2022 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002023 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002024 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002025 }
2026}
2027
Nika Layzella6f46c42017-10-26 15:26:16 -04002028pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002029 use ::Mutability::*;
2030 match _i {
2031 Mutable(_binding_0, ) => {
2032 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002033 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002034 )
2035 }
2036 Immutable => { Immutable }
2037 }
2038}
2039
Nika Layzella6f46c42017-10-26 15:26:16 -04002040pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002041 use ::NestedMetaItem::*;
2042 match _i {
2043 MetaItem(_binding_0, ) => {
2044 MetaItem (
2045 _visitor.fold_meta_item(_binding_0),
2046 )
2047 }
2048 Literal(_binding_0, ) => {
2049 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002050 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002051 )
2052 }
2053 }
2054}
2055
Nika Layzellc08227a2017-12-04 16:30:17 -05002056pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2057 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002058 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002059 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002060 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002061 }
2062}
2063# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002064pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002065 use ::Pat::*;
2066 match _i {
2067 Wild(_binding_0, ) => {
2068 Wild (
2069 _visitor.fold_pat_wild(_binding_0),
2070 )
2071 }
2072 Ident(_binding_0, ) => {
2073 Ident (
2074 _visitor.fold_pat_ident(_binding_0),
2075 )
2076 }
2077 Struct(_binding_0, ) => {
2078 Struct (
2079 _visitor.fold_pat_struct(_binding_0),
2080 )
2081 }
2082 TupleStruct(_binding_0, ) => {
2083 TupleStruct (
2084 _visitor.fold_pat_tuple_struct(_binding_0),
2085 )
2086 }
2087 Path(_binding_0, ) => {
2088 Path (
2089 _visitor.fold_pat_path(_binding_0),
2090 )
2091 }
2092 Tuple(_binding_0, ) => {
2093 Tuple (
2094 _visitor.fold_pat_tuple(_binding_0),
2095 )
2096 }
2097 Box(_binding_0, ) => {
2098 Box (
2099 _visitor.fold_pat_box(_binding_0),
2100 )
2101 }
2102 Ref(_binding_0, ) => {
2103 Ref (
2104 _visitor.fold_pat_ref(_binding_0),
2105 )
2106 }
2107 Lit(_binding_0, ) => {
2108 Lit (
2109 _visitor.fold_pat_lit(_binding_0),
2110 )
2111 }
2112 Range(_binding_0, ) => {
2113 Range (
2114 _visitor.fold_pat_range(_binding_0),
2115 )
2116 }
2117 Slice(_binding_0, ) => {
2118 Slice (
2119 _visitor.fold_pat_slice(_binding_0),
2120 )
2121 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002122 Macro(_binding_0, ) => {
2123 Macro (
2124 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002125 )
2126 }
2127 }
2128}
2129# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002130pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002131 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002132 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002133 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002134 }
2135}
2136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002137pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002138 PatIdent {
2139 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002140 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002141 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002142 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002143 }
2144}
2145# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002146pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002147 PatLit {
2148 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2149 }
2150}
2151# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002152pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002153 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002154 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002155 path: _visitor.fold_path(_i . path),
2156 }
2157}
2158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002159pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002160 PatRange {
2161 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002162 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002163 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002164 }
2165}
2166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002167pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002168 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002169 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002170 mutbl: _visitor.fold_mutability(_i . mutbl),
2171 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002172 }
2173}
2174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002175pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002176 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002177 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002178 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002179 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002180 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002181 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2182 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002183 }
2184}
2185# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002186pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002187 PatStruct {
2188 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002189 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002190 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002191 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
2193}
2194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002195pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002196 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002197 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002198 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002199 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002200 dots_pos: _i . dots_pos,
2201 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002202 }
2203}
2204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002205pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002206 PatTupleStruct {
2207 path: _visitor.fold_path(_i . path),
2208 pat: _visitor.fold_pat_tuple(_i . pat),
2209 }
2210}
2211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002212pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002213 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002214 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002215 }
2216}
2217
Nika Layzella6f46c42017-10-26 15:26:16 -04002218pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002219 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002220 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002221 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2222 }
2223}
Nika Layzellc08227a2017-12-04 16:30:17 -05002224
2225pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2226 use ::PathArguments::*;
2227 match _i {
2228 None => { None }
2229 AngleBracketed(_binding_0, ) => {
2230 AngleBracketed (
2231 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2232 )
2233 }
2234 Parenthesized(_binding_0, ) => {
2235 Parenthesized (
2236 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2237 )
2238 }
2239 }
2240}
Nika Layzell27726662017-10-24 23:16:35 -04002241
Nika Layzella6f46c42017-10-26 15:26:16 -04002242pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002243 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002244 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002245 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002246 }
2247}
Nika Layzell27726662017-10-24 23:16:35 -04002248
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002250 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002251 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002252 trait_ref: _visitor.fold_path(_i . trait_ref),
2253 }
2254}
2255
Nika Layzella6f46c42017-10-26 15:26:16 -04002256pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002257 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002258 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002259 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002260 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002261 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2262 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002263 }
2264}
2265# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002266pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002267 use ::RangeLimits::*;
2268 match _i {
2269 HalfOpen(_binding_0, ) => {
2270 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002271 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002272 )
2273 }
2274 Closed(_binding_0, ) => {
2275 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002276 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002277 )
2278 }
2279 }
2280}
David Tolnayf93b90d2017-11-11 19:21:26 -08002281
2282pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2283 use ::ReturnType::*;
2284 match _i {
2285 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002286 Type(_binding_0, _binding_1, ) => {
2287 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002288 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2289 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002290 )
2291 }
2292 }
2293}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002294
2295pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2296 _i
2297}
Nika Layzell27726662017-10-24 23:16:35 -04002298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002299pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002300 use ::Stmt::*;
2301 match _i {
2302 Local(_binding_0, ) => {
2303 Local (
2304 Box::new(_visitor.fold_local(* _binding_0)),
2305 )
2306 }
2307 Item(_binding_0, ) => {
2308 Item (
2309 Box::new(_visitor.fold_item(* _binding_0)),
2310 )
2311 }
2312 Expr(_binding_0, ) => {
2313 Expr (
2314 Box::new(_visitor.fold_expr(* _binding_0)),
2315 )
2316 }
2317 Semi(_binding_0, _binding_1, ) => {
2318 Semi (
2319 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002320 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002321 )
2322 }
Nika Layzell27726662017-10-24 23:16:35 -04002323 }
2324}
2325
Nika Layzella6f46c42017-10-26 15:26:16 -04002326pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002327 use ::TraitBoundModifier::*;
2328 match _i {
2329 None => { None }
2330 Maybe(_binding_0, ) => {
2331 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002332 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002333 )
2334 }
2335 }
2336}
2337# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002338pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002339 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002340 match _i {
2341 Const(_binding_0, ) => {
2342 Const (
2343 _visitor.fold_trait_item_const(_binding_0),
2344 )
2345 }
2346 Method(_binding_0, ) => {
2347 Method (
2348 _visitor.fold_trait_item_method(_binding_0),
2349 )
2350 }
2351 Type(_binding_0, ) => {
2352 Type (
2353 _visitor.fold_trait_item_type(_binding_0),
2354 )
2355 }
2356 Macro(_binding_0, ) => {
2357 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002358 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002359 )
2360 }
2361 }
2362}
2363# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002364pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2365 TraitItemConst {
2366 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002367 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002368 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002370 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002371 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002372 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002373 _visitor.fold_expr(( it ) . 1),
2374 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002375 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002376 }
2377}
2378# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002379pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2380 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002381 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002382 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002383 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002384 }
2385}
2386# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002387pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002388 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002389 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002390 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002391 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002392 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002393 }
2394}
2395# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002396pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002397 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002398 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002399 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002400 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002401 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002402 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002403 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002404 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002405 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002406 _visitor.fold_type(( it ) . 1),
2407 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002408 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002409 }
2410}
2411
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002412pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2413 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002414 match _i {
2415 Slice(_binding_0, ) => {
2416 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002417 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002418 )
2419 }
2420 Array(_binding_0, ) => {
2421 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002422 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002423 )
2424 }
2425 Ptr(_binding_0, ) => {
2426 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002427 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002428 )
2429 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002430 Reference(_binding_0, ) => {
2431 Reference (
2432 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002433 )
2434 }
2435 BareFn(_binding_0, ) => {
2436 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002437 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002438 )
2439 }
2440 Never(_binding_0, ) => {
2441 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002442 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002443 )
2444 }
David Tolnay05362582017-12-26 01:33:57 -05002445 Tuple(_binding_0, ) => {
2446 Tuple (
2447 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002448 )
2449 }
2450 Path(_binding_0, ) => {
2451 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002452 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002453 )
2454 }
2455 TraitObject(_binding_0, ) => {
2456 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002457 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002458 )
2459 }
2460 ImplTrait(_binding_0, ) => {
2461 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002462 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002463 )
2464 }
2465 Paren(_binding_0, ) => {
2466 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002467 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002468 )
2469 }
2470 Group(_binding_0, ) => {
2471 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002472 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002473 )
2474 }
2475 Infer(_binding_0, ) => {
2476 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002477 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002478 )
2479 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002480 Macro(_binding_0, ) => {
2481 Macro (
2482 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002483 )
2484 }
2485 }
2486}
2487
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002488pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2489 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002490 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002491 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002492 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002493 amt: _visitor.fold_expr(_i . amt),
2494 }
2495}
2496
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002497pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2498 TypeBareFn {
2499 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002500 }
2501}
2502
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2504 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002505 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002506 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002507 ty: _visitor.fold_type(_i . ty),
2508 }
2509}
2510
2511pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2512 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002513 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002514 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002515 }
2516}
2517
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2519 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002520 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002521 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002522 }
2523}
2524
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002525pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2526 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002527 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002528 }
2529}
2530
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2532 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002533 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002534 }
2535}
2536
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002537pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2538 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002539 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002540 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002541 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002543 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002545 }
2546}
2547
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002548pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2549 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002550 match _i {
2551 Trait(_binding_0, _binding_1, ) => {
2552 Trait (
2553 _visitor.fold_poly_trait_ref(_binding_0),
2554 _visitor.fold_trait_bound_modifier(_binding_1),
2555 )
2556 }
2557 Region(_binding_0, ) => {
2558 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002559 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002560 )
2561 }
2562 }
2563}
2564
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2566 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002567 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002569 }
2570}
2571
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2573 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002574 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002575 path: _visitor.fold_path(_i . path),
2576 }
2577}
2578
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002579pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2580 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002581 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2582 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002584 }
2585}
2586
David Tolnay0a89b4d2017-11-13 00:55:45 -08002587pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2588 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002589 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002590 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002592 }
2593}
2594
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002595pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2596 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002597 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002598 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002599 }
2600}
2601
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002602pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2603 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002604 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002605 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002606 }
2607}
2608
David Tolnay05362582017-12-26 01:33:57 -05002609pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2610 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002611 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002612 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002613 }
2614}
2615
Nika Layzella6f46c42017-10-26 15:26:16 -04002616pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002617 use ::UnOp::*;
2618 match _i {
2619 Deref(_binding_0, ) => {
2620 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002621 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002622 )
2623 }
2624 Not(_binding_0, ) => {
2625 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002626 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002627 )
2628 }
2629 Neg(_binding_0, ) => {
2630 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002631 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002632 )
2633 }
2634 }
2635}
2636
Nika Layzella6f46c42017-10-26 15:26:16 -04002637pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002638 use ::Unsafety::*;
2639 match _i {
2640 Unsafe(_binding_0, ) => {
2641 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002642 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002643 )
2644 }
2645 Normal => { Normal }
2646 }
2647}
David Tolnay5f332a92017-12-26 00:42:45 -05002648# [ cfg ( feature = "full" ) ]
2649pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2650 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002651 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002652 }
2653}
2654# [ cfg ( feature = "full" ) ]
2655pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2656 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002657 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002658 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2659 }
2660}
2661# [ cfg ( feature = "full" ) ]
2662pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2663 UsePath {
2664 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002665 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002666 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002667 _visitor.fold_ident(( it ) . 1),
2668 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002669 }
2670}
2671# [ cfg ( feature = "full" ) ]
2672pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2673 use ::UseTree::*;
2674 match _i {
2675 Path(_binding_0, ) => {
2676 Path (
2677 _visitor.fold_use_path(_binding_0),
2678 )
2679 }
2680 Glob(_binding_0, ) => {
2681 Glob (
2682 _visitor.fold_use_glob(_binding_0),
2683 )
2684 }
2685 List(_binding_0, ) => {
2686 List (
2687 _visitor.fold_use_list(_binding_0),
2688 )
2689 }
2690 }
2691}
Nika Layzell27726662017-10-24 23:16:35 -04002692
Nika Layzella6f46c42017-10-26 15:26:16 -04002693pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002694 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002695 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002696 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002697 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05002698 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002699 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002700 }
2701}
2702
Nika Layzella6f46c42017-10-26 15:26:16 -04002703pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002704 use ::VariantData::*;
2705 match _i {
2706 Struct(_binding_0, _binding_1, ) => {
2707 Struct (
2708 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002709 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002710 )
2711 }
2712 Tuple(_binding_0, _binding_1, ) => {
2713 Tuple (
2714 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002715 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002716 )
2717 }
2718 Unit => { Unit }
2719 }
2720}
Nika Layzell27726662017-10-24 23:16:35 -04002721
Nika Layzella6f46c42017-10-26 15:26:16 -04002722pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002723 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002724 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002725 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002726 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002727 }
2728}
2729
Nika Layzella6f46c42017-10-26 15:26:16 -04002730pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002731 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002732 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002733 }
2734}
2735
Nika Layzella6f46c42017-10-26 15:26:16 -04002736pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002737 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002738 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002739 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002740 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002741 path: Box::new(_visitor.fold_path(* _i . path)),
2742 }
2743}
2744
Nika Layzella6f46c42017-10-26 15:26:16 -04002745pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002746 use ::Visibility::*;
2747 match _i {
2748 Public(_binding_0, ) => {
2749 Public (
2750 _visitor.fold_vis_public(_binding_0),
2751 )
2752 }
2753 Crate(_binding_0, ) => {
2754 Crate (
2755 _visitor.fold_vis_crate(_binding_0),
2756 )
2757 }
2758 Restricted(_binding_0, ) => {
2759 Restricted (
2760 _visitor.fold_vis_restricted(_binding_0),
2761 )
2762 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002763 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002764 }
2765}
2766
Nika Layzella6f46c42017-10-26 15:26:16 -04002767pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002768 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002769 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002770 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002771 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002772 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002773 }
2774}
2775
Nika Layzella6f46c42017-10-26 15:26:16 -04002776pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002777 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002778 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002779 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2780 }
2781}
2782
Nika Layzella6f46c42017-10-26 15:26:16 -04002783pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002784 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002785 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002786 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002787 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002788 }
2789}
2790
Nika Layzella6f46c42017-10-26 15:26:16 -04002791pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002792 use ::WherePredicate::*;
2793 match _i {
2794 BoundPredicate(_binding_0, ) => {
2795 BoundPredicate (
2796 _visitor.fold_where_bound_predicate(_binding_0),
2797 )
2798 }
2799 RegionPredicate(_binding_0, ) => {
2800 RegionPredicate (
2801 _visitor.fold_where_region_predicate(_binding_0),
2802 )
2803 }
2804 EqPredicate(_binding_0, ) => {
2805 EqPredicate (
2806 _visitor.fold_where_eq_predicate(_binding_0),
2807 )
2808 }
2809 }
2810}
2811
Nika Layzella6f46c42017-10-26 15:26:16 -04002812pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002813 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002814 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002815 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002816 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002817 }
2818}
2819