blob: cdc1a47d17a93384988f34a2aa57a035561277c5 [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
David Tolnay8c91b882017-12-28 23:04:32 -0500133fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(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" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500137fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500157fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500163fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800188# [ cfg ( feature = "full" ) ]
189fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190
Nika Layzellc08227a2017-12-04 16:30:17 -0500191fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500192
David Tolnayc2f1aba2017-11-12 20:29:22 -0800193fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
194
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500196
197fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800203fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500213fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800231fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800233fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800243fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248
David Tolnay4ba63a02017-12-28 15:53:05 -0500249fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500252
253fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
David Tolnaydecf28d2017-11-11 11:56:45 -0800257fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay85b69a42017-12-27 20:43:10 -0500258# [ cfg ( feature = "full" ) ]
259fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800269fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzellc08227a2017-12-04 16:30:17 -0500275fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500302
303fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800312
313fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500314
315fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800325fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800339fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
340
341fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
342
343fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
344
345fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
346
347fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
348
349fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
350
351fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
352
353fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
354
355fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
356
David Tolnay0a89b4d2017-11-13 00:55:45 -0800357fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800358
359fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
360
361fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
362
David Tolnay05362582017-12-26 01:33:57 -0500363fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500368# [ cfg ( feature = "full" ) ]
369fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
399}
400
401
Nika Layzella6f46c42017-10-26 15:26:16 -0400402pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400403 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500404 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400405 kind: _visitor.fold_abi_kind(_i . kind),
406 }
407}
408
Nika Layzella6f46c42017-10-26 15:26:16 -0400409pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400410 use ::AbiKind::*;
411 match _i {
412 Named(_binding_0, ) => {
413 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500414 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400415 )
416 }
417 Default => { Default }
418 }
419}
420
Nika Layzellc08227a2017-12-04 16:30:17 -0500421pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
422 AngleBracketedGenericArguments {
David Tolnaycc0f0372017-12-28 19:11:04 -0500423 turbofish: (_i . turbofish).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
424 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500425 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500426 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400427 }
428}
429# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400430pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400431 ArgCaptured {
432 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500433 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800434 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400435 }
436}
437# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400438pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400439 ArgSelf {
440 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400442 }
443}
444# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400445pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400446 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500447 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500448 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400449 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500450 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400451 }
452}
453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400454pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400455 Arm {
456 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
457 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400459 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400461 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400463 }
464}
465
Nika Layzella6f46c42017-10-26 15:26:16 -0400466pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400467 use ::AttrStyle::*;
468 match _i {
469 Outer => { Outer }
470 Inner(_binding_0, ) => {
471 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500472 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400473 )
474 }
475 }
476}
477
Nika Layzella6f46c42017-10-26 15:26:16 -0400478pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400479 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500480 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500481 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500482 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400483 path: _visitor.fold_path(_i . path),
484 tts: _i . tts,
485 is_sugared_doc: _i . is_sugared_doc,
486 }
487}
488
Nika Layzella6f46c42017-10-26 15:26:16 -0400489pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400490 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500491 name: (_i . name).map(|it| { (
492 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500493 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500494 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800495 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400496 }
497}
498
Nika Layzella6f46c42017-10-26 15:26:16 -0400499pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400500 use ::BareFnArgName::*;
501 match _i {
502 Named(_binding_0, ) => {
503 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500504 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400505 )
506 }
507 Wild(_binding_0, ) => {
508 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500509 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400510 )
511 }
512 }
513}
514
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800515pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
516 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400517 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400518 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500520 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500521 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400522 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500523 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800524 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400525 }
526}
527
Nika Layzella6f46c42017-10-26 15:26:16 -0400528pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400529 use ::BinOp::*;
530 match _i {
531 Add(_binding_0, ) => {
532 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500533 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400534 )
535 }
536 Sub(_binding_0, ) => {
537 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500538 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400539 )
540 }
541 Mul(_binding_0, ) => {
542 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500543 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400544 )
545 }
546 Div(_binding_0, ) => {
547 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500548 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400549 )
550 }
551 Rem(_binding_0, ) => {
552 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500553 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400554 )
555 }
556 And(_binding_0, ) => {
557 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500558 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400559 )
560 }
561 Or(_binding_0, ) => {
562 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500563 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400564 )
565 }
566 BitXor(_binding_0, ) => {
567 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500568 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400569 )
570 }
571 BitAnd(_binding_0, ) => {
572 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500573 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400574 )
575 }
576 BitOr(_binding_0, ) => {
577 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500578 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400579 )
580 }
581 Shl(_binding_0, ) => {
582 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500583 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400584 )
585 }
586 Shr(_binding_0, ) => {
587 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500588 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400589 )
590 }
591 Eq(_binding_0, ) => {
592 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500593 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400594 )
595 }
596 Lt(_binding_0, ) => {
597 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500598 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400599 )
600 }
601 Le(_binding_0, ) => {
602 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500603 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400604 )
605 }
606 Ne(_binding_0, ) => {
607 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500608 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400609 )
610 }
611 Ge(_binding_0, ) => {
612 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500613 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400614 )
615 }
616 Gt(_binding_0, ) => {
617 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500618 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400619 )
620 }
621 AddEq(_binding_0, ) => {
622 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500623 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400624 )
625 }
626 SubEq(_binding_0, ) => {
627 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500628 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400629 )
630 }
631 MulEq(_binding_0, ) => {
632 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500633 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400634 )
635 }
636 DivEq(_binding_0, ) => {
637 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500638 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400639 )
640 }
641 RemEq(_binding_0, ) => {
642 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500643 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 )
645 }
646 BitXorEq(_binding_0, ) => {
647 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500648 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400649 )
650 }
651 BitAndEq(_binding_0, ) => {
652 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500653 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400654 )
655 }
656 BitOrEq(_binding_0, ) => {
657 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500658 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400659 )
660 }
661 ShlEq(_binding_0, ) => {
662 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500663 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400664 )
665 }
666 ShrEq(_binding_0, ) => {
667 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500668 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400669 )
670 }
671 }
672}
673# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400674pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400675 use ::BindingMode::*;
676 match _i {
677 ByRef(_binding_0, _binding_1, ) => {
678 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500679 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400680 _visitor.fold_mutability(_binding_1),
681 )
682 }
683 ByValue(_binding_0, ) => {
684 ByValue (
685 _visitor.fold_mutability(_binding_0),
686 )
687 }
688 }
689}
690# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400691pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400692 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500693 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400694 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
695 }
696}
697
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400699 use ::Body::*;
700 match _i {
701 Enum(_binding_0, ) => {
702 Enum (
703 _visitor.fold_body_enum(_binding_0),
704 )
705 }
706 Struct(_binding_0, ) => {
707 Struct (
708 _visitor.fold_body_struct(_binding_0),
709 )
710 }
711 }
712}
713
Nika Layzella6f46c42017-10-26 15:26:16 -0400714pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400715 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500717 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400718 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
719 }
720}
721
Nika Layzella6f46c42017-10-26 15:26:16 -0400722pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400723 BodyStruct {
724 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
726 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400727 }
728}
729
Nika Layzella6f46c42017-10-26 15:26:16 -0400730pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400731 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500732 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
733 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400734 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500735 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400736 }
737}
738# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400739pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400740 use ::CaptureBy::*;
741 match _i {
742 Value(_binding_0, ) => {
743 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500744 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400745 )
746 }
747 Ref => { Ref }
748 }
749}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500750
751pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
752 ConstParam {
753 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500754 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500755 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500757 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500758 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500759 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
760 }
761}
Nika Layzell27726662017-10-24 23:16:35 -0400762# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400763pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400764 use ::Constness::*;
765 match _i {
766 Const(_binding_0, ) => {
767 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500768 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400769 )
770 }
771 NotConst => { NotConst }
772 }
773}
774# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400775pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400776 use ::Defaultness::*;
777 match _i {
778 Default(_binding_0, ) => {
779 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500780 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 Final => { Final }
784 }
785}
786
Nika Layzella6f46c42017-10-26 15:26:16 -0400787pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400788 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400789 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500790 vis: _visitor.fold_visibility(_i . vis),
791 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400792 generics: _visitor.fold_generics(_i . generics),
793 body: _visitor.fold_body(_i . body),
794 }
795}
796
Nika Layzella6f46c42017-10-26 15:26:16 -0400797pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500798 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400799 match _i {
800 Box(_binding_0, ) => {
801 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400802 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400803 )
804 }
805 InPlace(_binding_0, ) => {
806 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400807 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400808 )
809 }
810 Array(_binding_0, ) => {
811 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400812 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400813 )
814 }
815 Call(_binding_0, ) => {
816 Call (
817 _visitor.fold_expr_call(_binding_0),
818 )
819 }
820 MethodCall(_binding_0, ) => {
821 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400822 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400823 )
824 }
David Tolnay05362582017-12-26 01:33:57 -0500825 Tuple(_binding_0, ) => {
826 Tuple (
827 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400828 )
829 }
830 Binary(_binding_0, ) => {
831 Binary (
832 _visitor.fold_expr_binary(_binding_0),
833 )
834 }
835 Unary(_binding_0, ) => {
836 Unary (
837 _visitor.fold_expr_unary(_binding_0),
838 )
839 }
840 Lit(_binding_0, ) => {
841 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500842 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400843 )
844 }
845 Cast(_binding_0, ) => {
846 Cast (
847 _visitor.fold_expr_cast(_binding_0),
848 )
849 }
850 Type(_binding_0, ) => {
851 Type (
852 _visitor.fold_expr_type(_binding_0),
853 )
854 }
855 If(_binding_0, ) => {
856 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400857 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400858 )
859 }
860 IfLet(_binding_0, ) => {
861 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400862 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400863 )
864 }
865 While(_binding_0, ) => {
866 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400867 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400868 )
869 }
870 WhileLet(_binding_0, ) => {
871 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400872 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400873 )
874 }
875 ForLoop(_binding_0, ) => {
876 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400877 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400878 )
879 }
880 Loop(_binding_0, ) => {
881 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400882 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400883 )
884 }
885 Match(_binding_0, ) => {
886 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400887 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400888 )
889 }
890 Closure(_binding_0, ) => {
891 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400892 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400893 )
894 }
Nika Layzell640832a2017-12-04 13:37:09 -0500895 Unsafe(_binding_0, ) => {
896 Unsafe (
897 full!(_visitor.fold_expr_unsafe(_binding_0)),
898 )
899 }
Nika Layzell27726662017-10-24 23:16:35 -0400900 Block(_binding_0, ) => {
901 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400902 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400903 )
904 }
905 Assign(_binding_0, ) => {
906 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400907 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400908 )
909 }
910 AssignOp(_binding_0, ) => {
911 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400912 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400913 )
914 }
915 Field(_binding_0, ) => {
916 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400917 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400918 )
919 }
Nika Layzell27726662017-10-24 23:16:35 -0400920 Index(_binding_0, ) => {
921 Index (
922 _visitor.fold_expr_index(_binding_0),
923 )
924 }
925 Range(_binding_0, ) => {
926 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400927 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 )
929 }
930 Path(_binding_0, ) => {
931 Path (
932 _visitor.fold_expr_path(_binding_0),
933 )
934 }
935 AddrOf(_binding_0, ) => {
936 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400937 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400938 )
939 }
940 Break(_binding_0, ) => {
941 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400942 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400943 )
944 }
945 Continue(_binding_0, ) => {
946 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400947 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400948 )
949 }
950 Ret(_binding_0, ) => {
951 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400952 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400953 )
954 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800955 Macro(_binding_0, ) => {
956 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500957 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400958 )
959 }
960 Struct(_binding_0, ) => {
961 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400962 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400963 )
964 }
965 Repeat(_binding_0, ) => {
966 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400967 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400968 )
969 }
970 Paren(_binding_0, ) => {
971 Paren (
972 _visitor.fold_expr_paren(_binding_0),
973 )
974 }
975 Group(_binding_0, ) => {
976 Group (
977 _visitor.fold_expr_group(_binding_0),
978 )
979 }
980 Try(_binding_0, ) => {
981 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400982 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400983 )
984 }
985 Catch(_binding_0, ) => {
986 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400987 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400988 )
989 }
990 Yield(_binding_0, ) => {
991 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400992 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400993 )
994 }
995 }
996}
997# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500998pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
999 ExprAddrOf {
1000 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1001 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1002 mutbl: _visitor.fold_mutability(_i . mutbl),
1003 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1004 }
1005}
1006# [ cfg ( feature = "full" ) ]
1007pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
1008 ExprArray {
1009 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1010 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1011 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
1012 }
1013}
1014# [ cfg ( feature = "full" ) ]
1015pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1016 ExprAssign {
1017 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1018 left: Box::new(_visitor.fold_expr(* _i . left)),
1019 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1020 right: Box::new(_visitor.fold_expr(* _i . right)),
1021 }
1022}
1023# [ cfg ( feature = "full" ) ]
1024pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1025 ExprAssignOp {
1026 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1027 left: Box::new(_visitor.fold_expr(* _i . left)),
1028 op: _visitor.fold_bin_op(_i . op),
1029 right: Box::new(_visitor.fold_expr(* _i . right)),
1030 }
1031}
1032
1033pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1034 ExprBinary {
1035 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1036 left: Box::new(_visitor.fold_expr(* _i . left)),
1037 op: _visitor.fold_bin_op(_i . op),
1038 right: Box::new(_visitor.fold_expr(* _i . right)),
1039 }
1040}
1041# [ cfg ( feature = "full" ) ]
1042pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1043 ExprBlock {
1044 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1045 block: _visitor.fold_block(_i . block),
1046 }
1047}
1048# [ cfg ( feature = "full" ) ]
1049pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1050 ExprBox {
1051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1052 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1053 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1054 }
1055}
1056# [ cfg ( feature = "full" ) ]
1057pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1058 ExprBreak {
1059 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1060 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1061 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1062 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1063 }
1064}
1065
1066pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1067 ExprCall {
1068 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1069 func: Box::new(_visitor.fold_expr(* _i . func)),
1070 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1071 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1072 }
1073}
1074
1075pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1076 ExprCast {
1077 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1078 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1079 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1080 ty: Box::new(_visitor.fold_type(* _i . ty)),
1081 }
1082}
1083# [ cfg ( feature = "full" ) ]
1084pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1085 ExprCatch {
1086 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1087 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1088 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1089 block: _visitor.fold_block(_i . block),
1090 }
1091}
1092# [ cfg ( feature = "full" ) ]
1093pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1094 ExprClosure {
1095 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1096 capture: _visitor.fold_capture_by(_i . capture),
1097 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1098 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1099 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1100 output: _visitor.fold_return_type(_i . output),
1101 body: Box::new(_visitor.fold_expr(* _i . body)),
1102 }
1103}
1104# [ cfg ( feature = "full" ) ]
1105pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1106 ExprContinue {
1107 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1108 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1109 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1110 }
1111}
1112# [ cfg ( feature = "full" ) ]
1113pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1114 ExprField {
1115 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1116 base: Box::new(_visitor.fold_expr(* _i . base)),
1117 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1118 member: _visitor.fold_member(_i . member),
1119 }
1120}
1121# [ cfg ( feature = "full" ) ]
1122pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1123 ExprForLoop {
1124 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1125 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1126 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1127 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1128 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1129 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1130 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1131 body: _visitor.fold_block(_i . body),
1132 }
1133}
1134
1135pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1136 ExprGroup {
1137 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1138 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1139 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1140 }
1141}
1142# [ cfg ( feature = "full" ) ]
1143pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1144 ExprIf {
1145 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1146 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1147 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1148 if_true: _visitor.fold_block(_i . if_true),
1149 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1150 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1151 }
1152}
1153# [ cfg ( feature = "full" ) ]
1154pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1155 ExprIfLet {
1156 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1157 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1158 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1159 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1160 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1161 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1162 if_true: _visitor.fold_block(_i . if_true),
1163 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1164 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1165 }
1166}
1167# [ cfg ( feature = "full" ) ]
1168pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1169 ExprInPlace {
1170 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1171 place: Box::new(_visitor.fold_expr(* _i . place)),
1172 kind: _visitor.fold_in_place_kind(_i . kind),
1173 value: Box::new(_visitor.fold_expr(* _i . value)),
1174 }
1175}
1176
1177pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1178 ExprIndex {
1179 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1180 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1181 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1182 index: Box::new(_visitor.fold_expr(* _i . index)),
1183 }
1184}
1185
1186pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1187 ExprLit {
1188 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1189 lit: _visitor.fold_lit(_i . lit),
1190 }
1191}
1192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001193pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001194 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001195 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001196 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001197 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001198 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1199 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001200 }
1201}
1202# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001203pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1204 ExprMacro {
1205 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1206 mac: _visitor.fold_macro(_i . mac),
1207 }
1208}
1209# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001210pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001211 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001212 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001213 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001214 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001215 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001216 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1217 }
1218}
1219# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001220pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001221 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001222 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001223 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001224 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001225 method: _visitor.fold_ident(_i . method),
David Tolnaycc0f0372017-12-28 19:11:04 -05001226 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001227 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
1228 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001229 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001230 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1231 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
1233}
1234
Nika Layzella6f46c42017-10-26 15:26:16 -04001235pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001236 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001237 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001238 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001239 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
1242
Nika Layzella6f46c42017-10-26 15:26:16 -04001243pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001244 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001246 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001247 path: _visitor.fold_path(_i . path),
1248 }
1249}
1250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001254 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001255 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001256 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
1258}
1259# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001260pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001261 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001262 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001263 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001264 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001265 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001266 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1267 }
1268}
1269# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001270pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001271 ExprRet {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001273 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001274 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001275 }
1276}
1277# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001278pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001279 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001280 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001281 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001282 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001283 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1284 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1285 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001286 }
1287}
1288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001289pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001291 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001292 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001294 }
1295}
1296# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001297pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1298 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001299 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001300 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001301 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001302 }
1303}
Nika Layzell27726662017-10-24 23:16:35 -04001304
Nika Layzella6f46c42017-10-26 15:26:16 -04001305pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001307 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001308 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001309 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001310 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001311 }
1312}
1313
Nika Layzella6f46c42017-10-26 15:26:16 -04001314pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001315 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001316 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001317 op: _visitor.fold_un_op(_i . op),
1318 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1319 }
1320}
1321# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001322pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1323 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001324 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001325 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001326 block: _visitor.fold_block(_i . block),
1327 }
1328}
1329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001330pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001331 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001332 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001333 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001334 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1335 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001336 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1337 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001338 }
1339}
1340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001341pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001342 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001343 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001344 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001345 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1346 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1347 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001348 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001349 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001350 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1351 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001352 }
1353}
1354# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001355pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001356 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001357 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001358 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001359 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001360 }
1361}
1362
Nika Layzella6f46c42017-10-26 15:26:16 -04001363pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001364 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001365 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001366 vis: _visitor.fold_visibility(_i . vis),
1367 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001368 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001369 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001370 }
1371}
1372# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001373pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001374 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001375 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001376 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001377 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001378 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1379 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001380 }
1381}
1382# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001383pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001384 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001385 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1386 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001387 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001388 expr: _visitor.fold_expr(_i . expr),
1389 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001390 }
1391}
1392# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001393pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001394 File {
1395 shebang: _i . shebang,
1396 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1397 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1398 }
1399}
1400# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001401pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001402 use ::FnArg::*;
1403 match _i {
1404 SelfRef(_binding_0, ) => {
1405 SelfRef (
1406 _visitor.fold_arg_self_ref(_binding_0),
1407 )
1408 }
1409 SelfValue(_binding_0, ) => {
1410 SelfValue (
1411 _visitor.fold_arg_self(_binding_0),
1412 )
1413 }
1414 Captured(_binding_0, ) => {
1415 Captured (
1416 _visitor.fold_arg_captured(_binding_0),
1417 )
1418 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001419 Inferred(_binding_0, ) => {
1420 Inferred (
1421 _visitor.fold_pat(_binding_0),
1422 )
1423 }
Nika Layzell27726662017-10-24 23:16:35 -04001424 Ignored(_binding_0, ) => {
1425 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001426 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001427 )
1428 }
1429 }
1430}
1431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001432pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001433 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001434 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001435 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001436 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001437 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001438 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001439 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001440 }
1441}
1442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001443pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001444 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001445 match _i {
1446 Fn(_binding_0, ) => {
1447 Fn (
1448 _visitor.fold_foreign_item_fn(_binding_0),
1449 )
1450 }
1451 Static(_binding_0, ) => {
1452 Static (
1453 _visitor.fold_foreign_item_static(_binding_0),
1454 )
1455 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001456 Type(_binding_0, ) => {
1457 Type (
1458 _visitor.fold_foreign_item_type(_binding_0),
1459 )
1460 }
Nika Layzell27726662017-10-24 23:16:35 -04001461 }
1462}
1463# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001464pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1465 ForeignItemFn {
1466 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1467 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001468 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001469 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001470 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001471 }
1472}
1473# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001474pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001475 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001476 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1477 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001478 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001479 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001480 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001481 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001482 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001483 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001484 }
1485}
David Tolnay199bcbb2017-11-12 10:33:52 -08001486# [ cfg ( feature = "full" ) ]
1487pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1488 ForeignItemType {
1489 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1490 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001491 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001492 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001493 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001494 }
1495}
Nika Layzell27726662017-10-24 23:16:35 -04001496
Nika Layzellc08227a2017-12-04 16:30:17 -05001497pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1498 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001499 match _i {
1500 Lifetime(_binding_0, ) => {
1501 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001502 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001503 )
1504 }
1505 Type(_binding_0, ) => {
1506 Type (
1507 _visitor.fold_type(_binding_0),
1508 )
1509 }
1510 TypeBinding(_binding_0, ) => {
1511 TypeBinding (
1512 _visitor.fold_type_binding(_binding_0),
1513 )
1514 }
Nika Layzellc680e612017-12-04 19:07:20 -05001515 Const(_binding_0, ) => {
1516 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001517 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001518 )
1519 }
Nika Layzell357885a2017-12-04 15:47:07 -05001520 }
1521}
1522
David Tolnayc2f1aba2017-11-12 20:29:22 -08001523pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1524 use ::GenericParam::*;
1525 match _i {
1526 Lifetime(_binding_0, ) => {
1527 Lifetime (
1528 _visitor.fold_lifetime_def(_binding_0),
1529 )
1530 }
1531 Type(_binding_0, ) => {
1532 Type (
1533 _visitor.fold_type_param(_binding_0),
1534 )
1535 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001536 Const(_binding_0, ) => {
1537 Const (
1538 _visitor.fold_const_param(_binding_0),
1539 )
1540 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001541 }
1542}
1543
Nika Layzella6f46c42017-10-26 15:26:16 -04001544pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001545 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001547 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001548 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001549 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001550 }
1551}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001552
1553pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001554 Ident {
1555 sym: _i . sym,
1556 span: _visitor.fold_span(_i . span),
1557 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001558}
Nika Layzell27726662017-10-24 23:16:35 -04001559# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001560pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001561 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001562 match _i {
1563 Const(_binding_0, ) => {
1564 Const (
1565 _visitor.fold_impl_item_const(_binding_0),
1566 )
1567 }
1568 Method(_binding_0, ) => {
1569 Method (
1570 _visitor.fold_impl_item_method(_binding_0),
1571 )
1572 }
1573 Type(_binding_0, ) => {
1574 Type (
1575 _visitor.fold_impl_item_type(_binding_0),
1576 )
1577 }
1578 Macro(_binding_0, ) => {
1579 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001580 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001581 )
1582 }
1583 }
1584}
1585# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001586pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1587 ImplItemConst {
1588 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1589 vis: _visitor.fold_visibility(_i . vis),
1590 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001592 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001594 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001595 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001596 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001597 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001598 }
1599}
1600# [ cfg ( feature = "full" ) ]
1601pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1602 ImplItemMacro {
1603 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1604 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001605 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001606 }
1607}
1608# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001609pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001610 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001611 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001612 vis: _visitor.fold_visibility(_i . vis),
1613 defaultness: _visitor.fold_defaultness(_i . defaultness),
1614 sig: _visitor.fold_method_sig(_i . sig),
1615 block: _visitor.fold_block(_i . block),
1616 }
1617}
1618# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001619pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001620 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001621 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001622 vis: _visitor.fold_visibility(_i . vis),
1623 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001624 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001625 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001626 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001627 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001628 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001629 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001630 }
1631}
1632# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001633pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001634 use ::ImplPolarity::*;
1635 match _i {
1636 Positive => { Positive }
1637 Negative(_binding_0, ) => {
1638 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001639 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001640 )
1641 }
1642 }
1643}
1644# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001645pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001646 use ::InPlaceKind::*;
1647 match _i {
1648 Arrow(_binding_0, ) => {
1649 Arrow (
David Tolnaycc0f0372017-12-28 19:11:04 -05001650 Token ! [ <- ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001651 )
1652 }
1653 In(_binding_0, ) => {
1654 In (
David Tolnaycc0f0372017-12-28 19:11:04 -05001655 Token ! [ in ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001656 )
1657 }
1658 }
1659}
1660# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001661pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1662 Index {
1663 index: _i . index,
1664 span: _visitor.fold_span(_i . span),
1665 }
1666}
1667# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001668pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001669 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001670 match _i {
1671 ExternCrate(_binding_0, ) => {
1672 ExternCrate (
1673 _visitor.fold_item_extern_crate(_binding_0),
1674 )
1675 }
1676 Use(_binding_0, ) => {
1677 Use (
1678 _visitor.fold_item_use(_binding_0),
1679 )
1680 }
1681 Static(_binding_0, ) => {
1682 Static (
1683 _visitor.fold_item_static(_binding_0),
1684 )
1685 }
1686 Const(_binding_0, ) => {
1687 Const (
1688 _visitor.fold_item_const(_binding_0),
1689 )
1690 }
1691 Fn(_binding_0, ) => {
1692 Fn (
1693 _visitor.fold_item_fn(_binding_0),
1694 )
1695 }
1696 Mod(_binding_0, ) => {
1697 Mod (
1698 _visitor.fold_item_mod(_binding_0),
1699 )
1700 }
1701 ForeignMod(_binding_0, ) => {
1702 ForeignMod (
1703 _visitor.fold_item_foreign_mod(_binding_0),
1704 )
1705 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001706 Type(_binding_0, ) => {
1707 Type (
1708 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001709 )
1710 }
1711 Enum(_binding_0, ) => {
1712 Enum (
1713 _visitor.fold_item_enum(_binding_0),
1714 )
1715 }
1716 Struct(_binding_0, ) => {
1717 Struct (
1718 _visitor.fold_item_struct(_binding_0),
1719 )
1720 }
1721 Union(_binding_0, ) => {
1722 Union (
1723 _visitor.fold_item_union(_binding_0),
1724 )
1725 }
1726 Trait(_binding_0, ) => {
1727 Trait (
1728 _visitor.fold_item_trait(_binding_0),
1729 )
1730 }
1731 DefaultImpl(_binding_0, ) => {
1732 DefaultImpl (
1733 _visitor.fold_item_default_impl(_binding_0),
1734 )
1735 }
1736 Impl(_binding_0, ) => {
1737 Impl (
1738 _visitor.fold_item_impl(_binding_0),
1739 )
1740 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001741 Macro(_binding_0, ) => {
1742 Macro (
1743 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001744 )
1745 }
David Tolnay500d8322017-12-18 00:32:51 -08001746 Macro2(_binding_0, ) => {
1747 Macro2 (
1748 _visitor.fold_item_macro2(_binding_0),
1749 )
1750 }
Nika Layzell27726662017-10-24 23:16:35 -04001751 }
1752}
1753# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1755 ItemConst {
1756 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1757 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001758 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001759 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001760 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001761 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001762 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001763 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001764 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001765 }
1766}
1767# [ cfg ( feature = "full" ) ]
1768pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1769 ItemDefaultImpl {
1770 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1771 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001772 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001773 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001774 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1775 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001776 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 }
1778}
1779# [ cfg ( feature = "full" ) ]
1780pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1781 ItemEnum {
1782 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1783 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001785 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001787 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001788 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1789 }
1790}
1791# [ cfg ( feature = "full" ) ]
1792pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1793 ItemExternCrate {
1794 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1795 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001796 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1797 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001798 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001799 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001801 _visitor.fold_ident(( it ) . 1),
1802 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 }
1805}
1806# [ cfg ( feature = "full" ) ]
1807pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1808 ItemFn {
1809 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1810 vis: _visitor.fold_visibility(_i . vis),
1811 constness: _visitor.fold_constness(_i . constness),
1812 unsafety: _visitor.fold_unsafety(_i . unsafety),
1813 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001814 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001815 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001816 block: Box::new(_visitor.fold_block(* _i . block)),
1817 }
1818}
1819# [ cfg ( feature = "full" ) ]
1820pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1821 ItemForeignMod {
1822 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1823 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001824 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1826 }
1827}
1828# [ cfg ( feature = "full" ) ]
1829pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1830 ItemImpl {
1831 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1832 defaultness: _visitor.fold_defaultness(_i . defaultness),
1833 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001834 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001836 trait_: (_i . trait_).map(|it| { (
1837 _visitor.fold_impl_polarity(( it ) . 0),
1838 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001839 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001840 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001841 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001842 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001843 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1844 }
1845}
1846# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001847pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1848 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001850 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001851 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001852 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 }
1854}
1855# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001856pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1857 ItemMacro2 {
1858 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1859 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001861 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001862 args: _i . args,
1863 body: _i . body,
1864 }
1865}
1866# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001867pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001868 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001869 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001870 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001872 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001873 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001874 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001875 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1876 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001877 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001878 }
1879}
1880# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001881pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001882 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001883 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001884 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001885 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001886 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001887 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001888 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001889 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001890 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001891 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001892 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001893 }
1894}
1895# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001896pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001897 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001898 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001899 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001900 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001901 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001902 generics: _visitor.fold_generics(_i . generics),
1903 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001904 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001905 }
1906}
1907# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001908pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001909 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001910 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001911 vis: _visitor.fold_visibility(_i . vis),
1912 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001913 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1914 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001915 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001916 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001917 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001918 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001919 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001920 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1921 }
1922}
1923# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001924pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1925 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001926 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001927 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001928 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001929 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001930 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001931 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001932 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001933 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001934 }
1935}
1936# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001937pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001938 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001939 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001940 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001941 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001942 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001943 generics: _visitor.fold_generics(_i . generics),
1944 data: _visitor.fold_variant_data(_i . data),
1945 }
1946}
1947# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001948pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001949 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001950 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001951 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001952 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1953 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001954 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1955 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001956 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001957 }
1958}
1959
David Tolnay4ba63a02017-12-28 15:53:05 -05001960pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1961 Lifetime {
1962 sym: _i . sym,
1963 span: _visitor.fold_span(_i . span),
1964 }
1965}
1966
Nika Layzella6f46c42017-10-26 15:26:16 -04001967pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001968 LifetimeDef {
1969 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001970 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001971 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001972 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1973 }
1974}
1975
1976pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1977 Lit {
1978 value: _i . value,
1979 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001980 }
1981}
1982# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001983pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001984 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001985 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001986 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1987 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1988 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1989 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1990 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1991 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1992 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001993 }
1994}
Nika Layzell27726662017-10-24 23:16:35 -04001995
David Tolnaydecf28d2017-11-11 11:56:45 -08001996pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1997 Macro {
1998 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001999 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08002000 tokens: _i . tokens,
2001 }
2002}
David Tolnay85b69a42017-12-27 20:43:10 -05002003# [ cfg ( feature = "full" ) ]
2004pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2005 use ::Member::*;
2006 match _i {
2007 Named(_binding_0, ) => {
2008 Named (
2009 _visitor.fold_ident(_binding_0),
2010 )
2011 }
2012 Unnamed(_binding_0, ) => {
2013 Unnamed (
2014 _visitor.fold_index(_binding_0),
2015 )
2016 }
2017 }
2018}
David Tolnaydecf28d2017-11-11 11:56:45 -08002019
Nika Layzella6f46c42017-10-26 15:26:16 -04002020pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002021 use ::MetaItem::*;
2022 match _i {
2023 Term(_binding_0, ) => {
2024 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002025 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002026 )
2027 }
2028 List(_binding_0, ) => {
2029 List (
2030 _visitor.fold_meta_item_list(_binding_0),
2031 )
2032 }
2033 NameValue(_binding_0, ) => {
2034 NameValue (
2035 _visitor.fold_meta_name_value(_binding_0),
2036 )
2037 }
2038 }
2039}
2040
Nika Layzella6f46c42017-10-26 15:26:16 -04002041pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002042 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002043 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002044 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002045 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2046 }
2047}
2048
Nika Layzella6f46c42017-10-26 15:26:16 -04002049pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002050 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002051 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002052 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002053 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002054 }
2055}
2056# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002057pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002058 MethodSig {
2059 constness: _visitor.fold_constness(_i . constness),
2060 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002061 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002062 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002063 decl: _visitor.fold_fn_decl(_i . decl),
2064 }
2065}
2066
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002067pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2068 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002069 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002070 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002071 }
2072}
2073
Nika Layzella6f46c42017-10-26 15:26:16 -04002074pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002075 use ::Mutability::*;
2076 match _i {
2077 Mutable(_binding_0, ) => {
2078 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002079 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002080 )
2081 }
2082 Immutable => { Immutable }
2083 }
2084}
2085
Nika Layzella6f46c42017-10-26 15:26:16 -04002086pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002087 use ::NestedMetaItem::*;
2088 match _i {
2089 MetaItem(_binding_0, ) => {
2090 MetaItem (
2091 _visitor.fold_meta_item(_binding_0),
2092 )
2093 }
2094 Literal(_binding_0, ) => {
2095 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002096 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002097 )
2098 }
2099 }
2100}
2101
Nika Layzellc08227a2017-12-04 16:30:17 -05002102pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2103 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002104 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002105 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002106 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002107 }
2108}
2109# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002110pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002111 use ::Pat::*;
2112 match _i {
2113 Wild(_binding_0, ) => {
2114 Wild (
2115 _visitor.fold_pat_wild(_binding_0),
2116 )
2117 }
2118 Ident(_binding_0, ) => {
2119 Ident (
2120 _visitor.fold_pat_ident(_binding_0),
2121 )
2122 }
2123 Struct(_binding_0, ) => {
2124 Struct (
2125 _visitor.fold_pat_struct(_binding_0),
2126 )
2127 }
2128 TupleStruct(_binding_0, ) => {
2129 TupleStruct (
2130 _visitor.fold_pat_tuple_struct(_binding_0),
2131 )
2132 }
2133 Path(_binding_0, ) => {
2134 Path (
2135 _visitor.fold_pat_path(_binding_0),
2136 )
2137 }
2138 Tuple(_binding_0, ) => {
2139 Tuple (
2140 _visitor.fold_pat_tuple(_binding_0),
2141 )
2142 }
2143 Box(_binding_0, ) => {
2144 Box (
2145 _visitor.fold_pat_box(_binding_0),
2146 )
2147 }
2148 Ref(_binding_0, ) => {
2149 Ref (
2150 _visitor.fold_pat_ref(_binding_0),
2151 )
2152 }
2153 Lit(_binding_0, ) => {
2154 Lit (
2155 _visitor.fold_pat_lit(_binding_0),
2156 )
2157 }
2158 Range(_binding_0, ) => {
2159 Range (
2160 _visitor.fold_pat_range(_binding_0),
2161 )
2162 }
2163 Slice(_binding_0, ) => {
2164 Slice (
2165 _visitor.fold_pat_slice(_binding_0),
2166 )
2167 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002168 Macro(_binding_0, ) => {
2169 Macro (
2170 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002171 )
2172 }
2173 }
2174}
2175# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002176pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002177 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002178 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002179 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002180 }
2181}
2182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002183pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002184 PatIdent {
2185 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002186 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002187 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002188 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
2190}
2191# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002192pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002193 PatLit {
2194 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2195 }
2196}
2197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002198pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002199 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002200 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002201 path: _visitor.fold_path(_i . path),
2202 }
2203}
2204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002205pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002206 PatRange {
2207 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002208 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002209 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002210 }
2211}
2212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002213pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002214 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002215 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002216 mutbl: _visitor.fold_mutability(_i . mutbl),
2217 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002218 }
2219}
2220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002221pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002222 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002223 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002224 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002225 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002226 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002227 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2228 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002229 }
2230}
2231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002232pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002233 PatStruct {
2234 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002235 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002236 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002237 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002238 }
2239}
2240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002241pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002242 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002243 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002244 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002245 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002246 dots_pos: _i . dots_pos,
2247 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002248 }
2249}
2250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002251pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002252 PatTupleStruct {
2253 path: _visitor.fold_path(_i . path),
2254 pat: _visitor.fold_pat_tuple(_i . pat),
2255 }
2256}
2257# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002258pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002259 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002260 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002261 }
2262}
2263
Nika Layzella6f46c42017-10-26 15:26:16 -04002264pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002265 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002266 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002267 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2268 }
2269}
Nika Layzellc08227a2017-12-04 16:30:17 -05002270
2271pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2272 use ::PathArguments::*;
2273 match _i {
2274 None => { None }
2275 AngleBracketed(_binding_0, ) => {
2276 AngleBracketed (
2277 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2278 )
2279 }
2280 Parenthesized(_binding_0, ) => {
2281 Parenthesized (
2282 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2283 )
2284 }
2285 }
2286}
Nika Layzell27726662017-10-24 23:16:35 -04002287
Nika Layzella6f46c42017-10-26 15:26:16 -04002288pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002289 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002290 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002291 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002292 }
2293}
Nika Layzell27726662017-10-24 23:16:35 -04002294
Nika Layzella6f46c42017-10-26 15:26:16 -04002295pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002296 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002297 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002298 trait_ref: _visitor.fold_path(_i . trait_ref),
2299 }
2300}
2301
Nika Layzella6f46c42017-10-26 15:26:16 -04002302pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002303 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002304 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002305 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002306 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002307 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2308 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002309 }
2310}
2311# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002312pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002313 use ::RangeLimits::*;
2314 match _i {
2315 HalfOpen(_binding_0, ) => {
2316 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002317 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002318 )
2319 }
2320 Closed(_binding_0, ) => {
2321 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002322 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002323 )
2324 }
2325 }
2326}
David Tolnayf93b90d2017-11-11 19:21:26 -08002327
2328pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2329 use ::ReturnType::*;
2330 match _i {
2331 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002332 Type(_binding_0, _binding_1, ) => {
2333 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002334 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2335 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002336 )
2337 }
2338 }
2339}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002340
2341pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2342 _i
2343}
Nika Layzell27726662017-10-24 23:16:35 -04002344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002345pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002346 use ::Stmt::*;
2347 match _i {
2348 Local(_binding_0, ) => {
2349 Local (
2350 Box::new(_visitor.fold_local(* _binding_0)),
2351 )
2352 }
2353 Item(_binding_0, ) => {
2354 Item (
2355 Box::new(_visitor.fold_item(* _binding_0)),
2356 )
2357 }
2358 Expr(_binding_0, ) => {
2359 Expr (
2360 Box::new(_visitor.fold_expr(* _binding_0)),
2361 )
2362 }
2363 Semi(_binding_0, _binding_1, ) => {
2364 Semi (
2365 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002366 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002367 )
2368 }
Nika Layzell27726662017-10-24 23:16:35 -04002369 }
2370}
2371
Nika Layzella6f46c42017-10-26 15:26:16 -04002372pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002373 use ::TraitBoundModifier::*;
2374 match _i {
2375 None => { None }
2376 Maybe(_binding_0, ) => {
2377 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002378 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002379 )
2380 }
2381 }
2382}
2383# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002384pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002385 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002386 match _i {
2387 Const(_binding_0, ) => {
2388 Const (
2389 _visitor.fold_trait_item_const(_binding_0),
2390 )
2391 }
2392 Method(_binding_0, ) => {
2393 Method (
2394 _visitor.fold_trait_item_method(_binding_0),
2395 )
2396 }
2397 Type(_binding_0, ) => {
2398 Type (
2399 _visitor.fold_trait_item_type(_binding_0),
2400 )
2401 }
2402 Macro(_binding_0, ) => {
2403 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002404 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002405 )
2406 }
2407 }
2408}
2409# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002410pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2411 TraitItemConst {
2412 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002413 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002414 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002415 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002416 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002417 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002418 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002419 _visitor.fold_expr(( it ) . 1),
2420 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002422 }
2423}
2424# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002425pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2426 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002427 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002428 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002429 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002430 }
2431}
2432# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002433pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002434 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002435 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002436 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002437 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002438 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002439 }
2440}
2441# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002442pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002443 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002444 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002445 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002446 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002447 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002448 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002450 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002451 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002452 _visitor.fold_type(( it ) . 1),
2453 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002454 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002455 }
2456}
2457
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002458pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2459 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002460 match _i {
2461 Slice(_binding_0, ) => {
2462 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002463 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002464 )
2465 }
2466 Array(_binding_0, ) => {
2467 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002468 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002469 )
2470 }
2471 Ptr(_binding_0, ) => {
2472 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002473 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002474 )
2475 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002476 Reference(_binding_0, ) => {
2477 Reference (
2478 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002479 )
2480 }
2481 BareFn(_binding_0, ) => {
2482 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002483 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002484 )
2485 }
2486 Never(_binding_0, ) => {
2487 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002488 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002489 )
2490 }
David Tolnay05362582017-12-26 01:33:57 -05002491 Tuple(_binding_0, ) => {
2492 Tuple (
2493 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002494 )
2495 }
2496 Path(_binding_0, ) => {
2497 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002498 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002499 )
2500 }
2501 TraitObject(_binding_0, ) => {
2502 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002504 )
2505 }
2506 ImplTrait(_binding_0, ) => {
2507 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002508 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002509 )
2510 }
2511 Paren(_binding_0, ) => {
2512 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002513 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002514 )
2515 }
2516 Group(_binding_0, ) => {
2517 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002519 )
2520 }
2521 Infer(_binding_0, ) => {
2522 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002524 )
2525 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002526 Macro(_binding_0, ) => {
2527 Macro (
2528 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002529 )
2530 }
2531 }
2532}
2533
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002534pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2535 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002536 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002537 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002538 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002539 amt: _visitor.fold_expr(_i . amt),
2540 }
2541}
2542
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2544 TypeBareFn {
2545 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002546 }
2547}
2548
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2550 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002551 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002552 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002553 ty: _visitor.fold_type(_i . ty),
2554 }
2555}
2556
2557pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2558 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002559 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002560 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002561 }
2562}
2563
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002564pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2565 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002566 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002571pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2572 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002573 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002574 }
2575}
2576
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002577pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2578 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002579 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002580 }
2581}
2582
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2584 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002585 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002586 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002588 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002589 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002590 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002591 }
2592}
2593
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002594pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2595 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002596 match _i {
2597 Trait(_binding_0, _binding_1, ) => {
2598 Trait (
2599 _visitor.fold_poly_trait_ref(_binding_0),
2600 _visitor.fold_trait_bound_modifier(_binding_1),
2601 )
2602 }
2603 Region(_binding_0, ) => {
2604 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002605 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002606 )
2607 }
2608 }
2609}
2610
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2612 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002613 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002614 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002615 }
2616}
2617
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002618pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2619 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002620 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002621 path: _visitor.fold_path(_i . path),
2622 }
2623}
2624
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002625pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2626 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002627 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2628 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002629 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002630 }
2631}
2632
David Tolnay0a89b4d2017-11-13 00:55:45 -08002633pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2634 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002635 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002636 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002638 }
2639}
2640
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2642 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002643 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002644 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002645 }
2646}
2647
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002648pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2649 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002650 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002651 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002652 }
2653}
2654
David Tolnay05362582017-12-26 01:33:57 -05002655pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2656 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002657 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002658 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002659 }
2660}
2661
Nika Layzella6f46c42017-10-26 15:26:16 -04002662pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002663 use ::UnOp::*;
2664 match _i {
2665 Deref(_binding_0, ) => {
2666 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002667 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002668 )
2669 }
2670 Not(_binding_0, ) => {
2671 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002672 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002673 )
2674 }
2675 Neg(_binding_0, ) => {
2676 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002677 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002678 )
2679 }
2680 }
2681}
2682
Nika Layzella6f46c42017-10-26 15:26:16 -04002683pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002684 use ::Unsafety::*;
2685 match _i {
2686 Unsafe(_binding_0, ) => {
2687 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002688 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002689 )
2690 }
2691 Normal => { Normal }
2692 }
2693}
David Tolnay5f332a92017-12-26 00:42:45 -05002694# [ cfg ( feature = "full" ) ]
2695pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2696 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002697 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002698 }
2699}
2700# [ cfg ( feature = "full" ) ]
2701pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2702 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002703 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002704 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2705 }
2706}
2707# [ cfg ( feature = "full" ) ]
2708pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2709 UsePath {
2710 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002711 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002712 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002713 _visitor.fold_ident(( it ) . 1),
2714 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002715 }
2716}
2717# [ cfg ( feature = "full" ) ]
2718pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2719 use ::UseTree::*;
2720 match _i {
2721 Path(_binding_0, ) => {
2722 Path (
2723 _visitor.fold_use_path(_binding_0),
2724 )
2725 }
2726 Glob(_binding_0, ) => {
2727 Glob (
2728 _visitor.fold_use_glob(_binding_0),
2729 )
2730 }
2731 List(_binding_0, ) => {
2732 List (
2733 _visitor.fold_use_list(_binding_0),
2734 )
2735 }
2736 }
2737}
Nika Layzell27726662017-10-24 23:16:35 -04002738
Nika Layzella6f46c42017-10-26 15:26:16 -04002739pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002740 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002741 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002742 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002743 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002744 discriminant: (_i . discriminant).map(|it| { (
2745 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2746 _visitor.fold_expr(( it ) . 1),
2747 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002748 }
2749}
2750
Nika Layzella6f46c42017-10-26 15:26:16 -04002751pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002752 use ::VariantData::*;
2753 match _i {
2754 Struct(_binding_0, _binding_1, ) => {
2755 Struct (
2756 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002757 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002758 )
2759 }
2760 Tuple(_binding_0, _binding_1, ) => {
2761 Tuple (
2762 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002763 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002764 )
2765 }
2766 Unit => { Unit }
2767 }
2768}
Nika Layzell27726662017-10-24 23:16:35 -04002769
Nika Layzella6f46c42017-10-26 15:26:16 -04002770pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002771 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002772 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002773 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002774 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002775 }
2776}
2777
Nika Layzella6f46c42017-10-26 15:26:16 -04002778pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002779 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002780 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
2782}
2783
Nika Layzella6f46c42017-10-26 15:26:16 -04002784pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002785 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002786 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002787 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002789 path: Box::new(_visitor.fold_path(* _i . path)),
2790 }
2791}
2792
Nika Layzella6f46c42017-10-26 15:26:16 -04002793pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002794 use ::Visibility::*;
2795 match _i {
2796 Public(_binding_0, ) => {
2797 Public (
2798 _visitor.fold_vis_public(_binding_0),
2799 )
2800 }
2801 Crate(_binding_0, ) => {
2802 Crate (
2803 _visitor.fold_vis_crate(_binding_0),
2804 )
2805 }
2806 Restricted(_binding_0, ) => {
2807 Restricted (
2808 _visitor.fold_vis_restricted(_binding_0),
2809 )
2810 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002811 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002812 }
2813}
2814
Nika Layzella6f46c42017-10-26 15:26:16 -04002815pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002816 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002817 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002818 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002819 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002820 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002821 }
2822}
2823
Nika Layzella6f46c42017-10-26 15:26:16 -04002824pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002825 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002826 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002827 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2828 }
2829}
2830
Nika Layzella6f46c42017-10-26 15:26:16 -04002831pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002832 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002833 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002834 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002835 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002836 }
2837}
2838
Nika Layzella6f46c42017-10-26 15:26:16 -04002839pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002840 use ::WherePredicate::*;
2841 match _i {
2842 BoundPredicate(_binding_0, ) => {
2843 BoundPredicate (
2844 _visitor.fold_where_bound_predicate(_binding_0),
2845 )
2846 }
2847 RegionPredicate(_binding_0, ) => {
2848 RegionPredicate (
2849 _visitor.fold_where_region_predicate(_binding_0),
2850 )
2851 }
2852 EqPredicate(_binding_0, ) => {
2853 EqPredicate (
2854 _visitor.fold_where_eq_predicate(_binding_0),
2855 )
2856 }
2857 }
2858}
2859
Nika Layzella6f46c42017-10-26 15:26:16 -04002860pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002861 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002862 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002863 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002864 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002865 }
2866}
2867