blob: 3132fd40a3a2a17e97ca39bd3953ac5c725d24e4 [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_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050078
79fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500129fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500143fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500149fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500155fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800180# [ cfg ( feature = "full" ) ]
181fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182
Nika Layzellc08227a2017-12-04 16:30:17 -0500183fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500184# [ cfg ( feature = "full" ) ]
185fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500186
David Tolnayc2f1aba2017-11-12 20:29:22 -0800187fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
188
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500190
191fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800197fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500202
David Tolnay85b69a42017-12-27 20:43:10 -0500203fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800221fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800223fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800233fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238
David Tolnay4ba63a02017-12-28 15:53:05 -0500239fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
240
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500242
243fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246
David Tolnaydecf28d2017-11-11 11:56:45 -0800247fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500248
David Tolnay85b69a42017-12-27 20:43:10 -0500249fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500258# [ cfg ( feature = "full" ) ]
259fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800261fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzellc08227a2017-12-04 16:30:17 -0500265fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500292
293fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800302
303fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500304
305fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800315fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800321fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800323fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800325fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
330
331fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
332
333fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
334
335fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
336
337fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
338
339fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
340
341fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
342
343fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
344
345fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
346
David Tolnay0a89b4d2017-11-13 00:55:45 -0800347fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800348
349fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
350
351fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
352
David Tolnay05362582017-12-26 01:33:57 -0500353fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800354
Nika Layzella6f46c42017-10-26 15:26:16 -0400355fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400356
Nika Layzella6f46c42017-10-26 15:26:16 -0400357fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500358# [ cfg ( feature = "full" ) ]
359fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
360# [ cfg ( feature = "full" ) ]
361fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
362# [ cfg ( feature = "full" ) ]
363fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
364# [ cfg ( feature = "full" ) ]
365fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
389}
390
David Tolnayd0adf522017-12-29 01:30:07 -0500391pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
392 _i.span = _visitor.fold_span(_i.span);
393 _i
394}
395
396pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
397 _i.span = _visitor.fold_span(_i.span);
398 _i
399}
400
Nika Layzell27726662017-10-24 23:16:35 -0400401
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 Tolnay2d4e08a2017-12-28 23:54:07 -0500423 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 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 {
David Tolnay24237fb2017-12-29 02:15:26 -0500440 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
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) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500449 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
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_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400675 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500676 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400677 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
678 }
679}
680
Nika Layzella6f46c42017-10-26 15:26:16 -0400681pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400682 use ::Body::*;
683 match _i {
684 Enum(_binding_0, ) => {
685 Enum (
686 _visitor.fold_body_enum(_binding_0),
687 )
688 }
689 Struct(_binding_0, ) => {
690 Struct (
691 _visitor.fold_body_struct(_binding_0),
692 )
693 }
694 }
695}
696
Nika Layzella6f46c42017-10-26 15:26:16 -0400697pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400698 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500699 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500700 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400701 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
702 }
703}
704
Nika Layzella6f46c42017-10-26 15:26:16 -0400705pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400706 BodyStruct {
707 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500708 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
709 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400710 }
711}
712
Nika Layzella6f46c42017-10-26 15:26:16 -0400713pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400714 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500715 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
716 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400719 }
720}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500721
722pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
723 ConstParam {
724 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500726 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500728 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500729 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500730 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
731 }
732}
Nika Layzell27726662017-10-24 23:16:35 -0400733
Nika Layzella6f46c42017-10-26 15:26:16 -0400734pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400735 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400736 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500737 vis: _visitor.fold_visibility(_i . vis),
738 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400739 generics: _visitor.fold_generics(_i . generics),
740 body: _visitor.fold_body(_i . body),
741 }
742}
743
Nika Layzella6f46c42017-10-26 15:26:16 -0400744pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500745 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400746 match _i {
747 Box(_binding_0, ) => {
748 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400749 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400750 )
751 }
752 InPlace(_binding_0, ) => {
753 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400754 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400755 )
756 }
757 Array(_binding_0, ) => {
758 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400759 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400760 )
761 }
762 Call(_binding_0, ) => {
763 Call (
764 _visitor.fold_expr_call(_binding_0),
765 )
766 }
767 MethodCall(_binding_0, ) => {
768 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400769 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400770 )
771 }
David Tolnay05362582017-12-26 01:33:57 -0500772 Tuple(_binding_0, ) => {
773 Tuple (
774 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400775 )
776 }
777 Binary(_binding_0, ) => {
778 Binary (
779 _visitor.fold_expr_binary(_binding_0),
780 )
781 }
782 Unary(_binding_0, ) => {
783 Unary (
784 _visitor.fold_expr_unary(_binding_0),
785 )
786 }
787 Lit(_binding_0, ) => {
788 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500789 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400790 )
791 }
792 Cast(_binding_0, ) => {
793 Cast (
794 _visitor.fold_expr_cast(_binding_0),
795 )
796 }
797 Type(_binding_0, ) => {
798 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500799 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
802 If(_binding_0, ) => {
803 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400804 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 )
806 }
807 IfLet(_binding_0, ) => {
808 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
812 While(_binding_0, ) => {
813 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
817 WhileLet(_binding_0, ) => {
818 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400819 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
822 ForLoop(_binding_0, ) => {
823 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
827 Loop(_binding_0, ) => {
828 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400829 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
832 Match(_binding_0, ) => {
833 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
837 Closure(_binding_0, ) => {
838 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400839 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
Nika Layzell640832a2017-12-04 13:37:09 -0500842 Unsafe(_binding_0, ) => {
843 Unsafe (
844 full!(_visitor.fold_expr_unsafe(_binding_0)),
845 )
846 }
Nika Layzell27726662017-10-24 23:16:35 -0400847 Block(_binding_0, ) => {
848 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
852 Assign(_binding_0, ) => {
853 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400854 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
857 AssignOp(_binding_0, ) => {
858 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
862 Field(_binding_0, ) => {
863 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
Nika Layzell27726662017-10-24 23:16:35 -0400867 Index(_binding_0, ) => {
868 Index (
869 _visitor.fold_expr_index(_binding_0),
870 )
871 }
872 Range(_binding_0, ) => {
873 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
877 Path(_binding_0, ) => {
878 Path (
879 _visitor.fold_expr_path(_binding_0),
880 )
881 }
882 AddrOf(_binding_0, ) => {
883 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
887 Break(_binding_0, ) => {
888 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
892 Continue(_binding_0, ) => {
893 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
David Tolnayc246cd32017-12-28 23:14:32 -0500897 Return(_binding_0, ) => {
898 Return (
899 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800902 Macro(_binding_0, ) => {
903 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500904 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
907 Struct(_binding_0, ) => {
908 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400909 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400910 )
911 }
912 Repeat(_binding_0, ) => {
913 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Paren(_binding_0, ) => {
918 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500919 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
922 Group(_binding_0, ) => {
923 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500924 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
927 Try(_binding_0, ) => {
928 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
932 Catch(_binding_0, ) => {
933 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400934 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
937 Yield(_binding_0, ) => {
938 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
942 }
943}
944# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500945pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
946 ExprAddrOf {
947 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
948 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500949 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500950 expr: Box::new(_visitor.fold_expr(* _i . expr)),
951 }
952}
953# [ cfg ( feature = "full" ) ]
954pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
955 ExprArray {
956 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
957 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500958 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500959 }
960}
961# [ cfg ( feature = "full" ) ]
962pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
963 ExprAssign {
964 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
965 left: Box::new(_visitor.fold_expr(* _i . left)),
966 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
967 right: Box::new(_visitor.fold_expr(* _i . right)),
968 }
969}
970# [ cfg ( feature = "full" ) ]
971pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
972 ExprAssignOp {
973 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
974 left: Box::new(_visitor.fold_expr(* _i . left)),
975 op: _visitor.fold_bin_op(_i . op),
976 right: Box::new(_visitor.fold_expr(* _i . right)),
977 }
978}
979
980pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
981 ExprBinary {
982 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
983 left: Box::new(_visitor.fold_expr(* _i . left)),
984 op: _visitor.fold_bin_op(_i . op),
985 right: Box::new(_visitor.fold_expr(* _i . right)),
986 }
987}
988# [ cfg ( feature = "full" ) ]
989pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
990 ExprBlock {
991 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
992 block: _visitor.fold_block(_i . block),
993 }
994}
995# [ cfg ( feature = "full" ) ]
996pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
997 ExprBox {
998 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
999 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1000 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1001 }
1002}
1003# [ cfg ( feature = "full" ) ]
1004pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1005 ExprBreak {
1006 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1007 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1008 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1009 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1010 }
1011}
1012
1013pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1014 ExprCall {
1015 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1016 func: Box::new(_visitor.fold_expr(* _i . func)),
1017 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1018 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1019 }
1020}
1021
1022pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1023 ExprCast {
1024 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1025 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1026 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1027 ty: Box::new(_visitor.fold_type(* _i . ty)),
1028 }
1029}
1030# [ cfg ( feature = "full" ) ]
1031pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1032 ExprCatch {
1033 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1034 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1035 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1036 block: _visitor.fold_block(_i . block),
1037 }
1038}
1039# [ cfg ( feature = "full" ) ]
1040pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1041 ExprClosure {
1042 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001043 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001044 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1045 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1046 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1047 output: _visitor.fold_return_type(_i . output),
1048 body: Box::new(_visitor.fold_expr(* _i . body)),
1049 }
1050}
1051# [ cfg ( feature = "full" ) ]
1052pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1053 ExprContinue {
1054 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1055 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1056 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1057 }
1058}
1059# [ cfg ( feature = "full" ) ]
1060pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1061 ExprField {
1062 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1063 base: Box::new(_visitor.fold_expr(* _i . base)),
1064 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1065 member: _visitor.fold_member(_i . member),
1066 }
1067}
1068# [ cfg ( feature = "full" ) ]
1069pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1070 ExprForLoop {
1071 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1072 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1073 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1074 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1075 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1076 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1077 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1078 body: _visitor.fold_block(_i . body),
1079 }
1080}
David Tolnaye98775f2017-12-28 23:17:00 -05001081# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001082pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1083 ExprGroup {
1084 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1085 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1086 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1087 }
1088}
1089# [ cfg ( feature = "full" ) ]
1090pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1091 ExprIf {
1092 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1093 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1094 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001095 then_branch: _visitor.fold_block(_i . then_branch),
1096 else_branch: (_i . else_branch).map(|it| { (
1097 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1098 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1099 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001100 }
1101}
1102# [ cfg ( feature = "full" ) ]
1103pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1104 ExprIfLet {
1105 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1106 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1107 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1108 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1109 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1110 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001111 then_branch: _visitor.fold_block(_i . then_branch),
1112 else_branch: (_i . else_branch).map(|it| { (
1113 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1114 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1115 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001116 }
1117}
1118# [ cfg ( feature = "full" ) ]
1119pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1120 ExprInPlace {
1121 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1122 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001123 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001124 value: Box::new(_visitor.fold_expr(* _i . value)),
1125 }
1126}
1127
1128pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1129 ExprIndex {
1130 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1131 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1132 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1133 index: Box::new(_visitor.fold_expr(* _i . index)),
1134 }
1135}
1136
1137pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1138 ExprLit {
1139 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1140 lit: _visitor.fold_lit(_i . lit),
1141 }
1142}
1143# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001144pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001145 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001146 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001147 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001148 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001149 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1150 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001151 }
1152}
1153# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001154pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1155 ExprMacro {
1156 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1157 mac: _visitor.fold_macro(_i . mac),
1158 }
1159}
1160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001161pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001162 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001163 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001164 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001165 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001166 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001167 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1168 }
1169}
1170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001171pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001172 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001173 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001174 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001175 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001176 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001177 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001178 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1179 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001180 }
1181}
David Tolnaye98775f2017-12-28 23:17:00 -05001182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001183pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001184 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001185 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001186 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001187 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001188 }
1189}
1190
Nika Layzella6f46c42017-10-26 15:26:16 -04001191pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001192 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001193 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001194 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001195 path: _visitor.fold_path(_i . path),
1196 }
1197}
1198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001199pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001200 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001201 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001202 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001203 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001204 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001205 }
1206}
1207# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001208pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001209 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001210 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001211 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001212 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001213 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001214 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1215 }
1216}
1217# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001218pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1219 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001220 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001221 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001222 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
1224}
1225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001226pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001229 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001230 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001231 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1232 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1233 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001234 }
1235}
1236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001237pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001238 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001239 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001240 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001241 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001242 }
1243}
1244# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001245pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1246 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001247 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001248 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001249 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001250 }
1251}
David Tolnay0cf94f22017-12-28 23:46:26 -05001252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001253pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001254 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001255 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001256 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001257 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001258 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001259 }
1260}
1261
Nika Layzella6f46c42017-10-26 15:26:16 -04001262pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001263 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001264 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001265 op: _visitor.fold_un_op(_i . op),
1266 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1267 }
1268}
1269# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001270pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1271 ExprUnsafe {
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 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001274 block: _visitor.fold_block(_i . block),
1275 }
1276}
1277# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001278pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001279 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001280 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001281 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001282 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1283 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001284 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1285 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001286 }
1287}
1288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001289pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001291 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001292 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1294 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1295 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001296 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001297 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001298 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1299 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001300 }
1301}
1302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001303pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001304 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001305 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001306 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001307 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001308 }
1309}
1310
Nika Layzella6f46c42017-10-26 15:26:16 -04001311pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001312 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001313 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001314 vis: _visitor.fold_visibility(_i . vis),
1315 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001316 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001317 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001318 }
1319}
1320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001321pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001322 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001323 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001324 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001325 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001326 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001327 }
1328}
1329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001330pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001331 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001332 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1333 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001334 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001335 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001336 }
1337}
1338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001340 File {
1341 shebang: _i . shebang,
1342 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1343 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1344 }
1345}
1346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001347pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001348 use ::FnArg::*;
1349 match _i {
1350 SelfRef(_binding_0, ) => {
1351 SelfRef (
1352 _visitor.fold_arg_self_ref(_binding_0),
1353 )
1354 }
1355 SelfValue(_binding_0, ) => {
1356 SelfValue (
1357 _visitor.fold_arg_self(_binding_0),
1358 )
1359 }
1360 Captured(_binding_0, ) => {
1361 Captured (
1362 _visitor.fold_arg_captured(_binding_0),
1363 )
1364 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001365 Inferred(_binding_0, ) => {
1366 Inferred (
1367 _visitor.fold_pat(_binding_0),
1368 )
1369 }
Nika Layzell27726662017-10-24 23:16:35 -04001370 Ignored(_binding_0, ) => {
1371 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001372 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001373 )
1374 }
1375 }
1376}
1377# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001378pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001379 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001380 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001381 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001382 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001383 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001384 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001385 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001386 }
1387}
1388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001389pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001390 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001391 match _i {
1392 Fn(_binding_0, ) => {
1393 Fn (
1394 _visitor.fold_foreign_item_fn(_binding_0),
1395 )
1396 }
1397 Static(_binding_0, ) => {
1398 Static (
1399 _visitor.fold_foreign_item_static(_binding_0),
1400 )
1401 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001402 Type(_binding_0, ) => {
1403 Type (
1404 _visitor.fold_foreign_item_type(_binding_0),
1405 )
1406 }
Nika Layzell27726662017-10-24 23:16:35 -04001407 }
1408}
1409# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001410pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1411 ForeignItemFn {
1412 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1413 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001414 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001415 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001416 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001417 }
1418}
1419# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001420pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001421 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001422 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1423 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001424 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001425 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001426 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001427 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001428 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001429 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001430 }
1431}
David Tolnay199bcbb2017-11-12 10:33:52 -08001432# [ cfg ( feature = "full" ) ]
1433pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1434 ForeignItemType {
1435 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1436 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001438 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001439 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001440 }
1441}
Nika Layzell27726662017-10-24 23:16:35 -04001442
Nika Layzellc08227a2017-12-04 16:30:17 -05001443pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1444 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001445 match _i {
1446 Lifetime(_binding_0, ) => {
1447 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001448 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001449 )
1450 }
1451 Type(_binding_0, ) => {
1452 Type (
1453 _visitor.fold_type(_binding_0),
1454 )
1455 }
1456 TypeBinding(_binding_0, ) => {
1457 TypeBinding (
1458 _visitor.fold_type_binding(_binding_0),
1459 )
1460 }
Nika Layzellc680e612017-12-04 19:07:20 -05001461 Const(_binding_0, ) => {
1462 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001463 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001464 )
1465 }
Nika Layzell357885a2017-12-04 15:47:07 -05001466 }
1467}
David Tolnayd60cfec2017-12-29 00:21:38 -05001468# [ cfg ( feature = "full" ) ]
1469pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1470 use ::GenericMethodArgument::*;
1471 match _i {
1472 Type(_binding_0, ) => {
1473 Type (
1474 _visitor.fold_type(_binding_0),
1475 )
1476 }
1477 Const(_binding_0, ) => {
1478 Const (
1479 _visitor.fold_expr(_binding_0),
1480 )
1481 }
1482 }
1483}
Nika Layzell357885a2017-12-04 15:47:07 -05001484
David Tolnayc2f1aba2017-11-12 20:29:22 -08001485pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1486 use ::GenericParam::*;
1487 match _i {
1488 Lifetime(_binding_0, ) => {
1489 Lifetime (
1490 _visitor.fold_lifetime_def(_binding_0),
1491 )
1492 }
1493 Type(_binding_0, ) => {
1494 Type (
1495 _visitor.fold_type_param(_binding_0),
1496 )
1497 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001498 Const(_binding_0, ) => {
1499 Const (
1500 _visitor.fold_const_param(_binding_0),
1501 )
1502 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001503 }
1504}
1505
Nika Layzella6f46c42017-10-26 15:26:16 -04001506pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001507 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001508 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001509 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001510 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001511 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001512 }
1513}
1514# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001515pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001516 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001517 match _i {
1518 Const(_binding_0, ) => {
1519 Const (
1520 _visitor.fold_impl_item_const(_binding_0),
1521 )
1522 }
1523 Method(_binding_0, ) => {
1524 Method (
1525 _visitor.fold_impl_item_method(_binding_0),
1526 )
1527 }
1528 Type(_binding_0, ) => {
1529 Type (
1530 _visitor.fold_impl_item_type(_binding_0),
1531 )
1532 }
1533 Macro(_binding_0, ) => {
1534 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001535 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001536 )
1537 }
1538 }
1539}
1540# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001541pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1542 ImplItemConst {
1543 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1544 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001545 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001547 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001548 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001549 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001550 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001551 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001552 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001553 }
1554}
1555# [ cfg ( feature = "full" ) ]
1556pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1557 ImplItemMacro {
1558 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1559 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001560 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001561 }
1562}
1563# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001564pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001565 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001566 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001567 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001568 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001569 sig: _visitor.fold_method_sig(_i . sig),
1570 block: _visitor.fold_block(_i . block),
1571 }
1572}
1573# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001574pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001575 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001576 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001577 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001578 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001579 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001580 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001581 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001582 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001583 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001584 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001585 }
1586}
David Tolnay14982012017-12-29 00:49:51 -05001587
David Tolnay85b69a42017-12-27 20:43:10 -05001588pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1589 Index {
1590 index: _i . index,
1591 span: _visitor.fold_span(_i . span),
1592 }
1593}
1594# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001595pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001596 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001597 match _i {
1598 ExternCrate(_binding_0, ) => {
1599 ExternCrate (
1600 _visitor.fold_item_extern_crate(_binding_0),
1601 )
1602 }
1603 Use(_binding_0, ) => {
1604 Use (
1605 _visitor.fold_item_use(_binding_0),
1606 )
1607 }
1608 Static(_binding_0, ) => {
1609 Static (
1610 _visitor.fold_item_static(_binding_0),
1611 )
1612 }
1613 Const(_binding_0, ) => {
1614 Const (
1615 _visitor.fold_item_const(_binding_0),
1616 )
1617 }
1618 Fn(_binding_0, ) => {
1619 Fn (
1620 _visitor.fold_item_fn(_binding_0),
1621 )
1622 }
1623 Mod(_binding_0, ) => {
1624 Mod (
1625 _visitor.fold_item_mod(_binding_0),
1626 )
1627 }
1628 ForeignMod(_binding_0, ) => {
1629 ForeignMod (
1630 _visitor.fold_item_foreign_mod(_binding_0),
1631 )
1632 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001633 Type(_binding_0, ) => {
1634 Type (
1635 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001636 )
1637 }
1638 Enum(_binding_0, ) => {
1639 Enum (
1640 _visitor.fold_item_enum(_binding_0),
1641 )
1642 }
1643 Struct(_binding_0, ) => {
1644 Struct (
1645 _visitor.fold_item_struct(_binding_0),
1646 )
1647 }
1648 Union(_binding_0, ) => {
1649 Union (
1650 _visitor.fold_item_union(_binding_0),
1651 )
1652 }
1653 Trait(_binding_0, ) => {
1654 Trait (
1655 _visitor.fold_item_trait(_binding_0),
1656 )
1657 }
1658 DefaultImpl(_binding_0, ) => {
1659 DefaultImpl (
1660 _visitor.fold_item_default_impl(_binding_0),
1661 )
1662 }
1663 Impl(_binding_0, ) => {
1664 Impl (
1665 _visitor.fold_item_impl(_binding_0),
1666 )
1667 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001668 Macro(_binding_0, ) => {
1669 Macro (
1670 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001671 )
1672 }
David Tolnay500d8322017-12-18 00:32:51 -08001673 Macro2(_binding_0, ) => {
1674 Macro2 (
1675 _visitor.fold_item_macro2(_binding_0),
1676 )
1677 }
Nika Layzell27726662017-10-24 23:16:35 -04001678 }
1679}
1680# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001681pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1682 ItemConst {
1683 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1684 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001685 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001686 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001687 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001688 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001689 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001690 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001691 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001692 }
1693}
1694# [ cfg ( feature = "full" ) ]
1695pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1696 ItemDefaultImpl {
1697 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1698 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001699 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001700 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001701 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1702 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001703 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001704 }
1705}
1706# [ cfg ( feature = "full" ) ]
1707pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1708 ItemEnum {
1709 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1710 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001711 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001712 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001713 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001714 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001715 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1716 }
1717}
1718# [ cfg ( feature = "full" ) ]
1719pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1720 ItemExternCrate {
1721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1722 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001723 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1724 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001725 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001726 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001727 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001728 _visitor.fold_ident(( it ) . 1),
1729 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001730 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001731 }
1732}
1733# [ cfg ( feature = "full" ) ]
1734pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1735 ItemFn {
1736 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1737 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001738 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001739 unsafety: _visitor.fold_unsafety(_i . unsafety),
1740 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001741 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001742 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743 block: Box::new(_visitor.fold_block(* _i . block)),
1744 }
1745}
1746# [ cfg ( feature = "full" ) ]
1747pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1748 ItemForeignMod {
1749 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1750 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001751 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001752 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1753 }
1754}
1755# [ cfg ( feature = "full" ) ]
1756pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1757 ItemImpl {
1758 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001759 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001760 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001761 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001762 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001763 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001764 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001765 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001766 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001767 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001768 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001769 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001770 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1771 }
1772}
1773# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001774pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1775 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001777 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001778 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001779 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001780 }
1781}
1782# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001783pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1784 ItemMacro2 {
1785 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1786 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001787 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001788 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001789 args: _i . args,
1790 body: _i . body,
1791 }
1792}
1793# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001794pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001795 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001797 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001798 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001799 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001800 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001801 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001802 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1803 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001804 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001805 }
1806}
1807# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001808pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001809 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001810 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001811 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001812 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001813 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001814 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001815 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001816 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001817 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001818 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001819 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001820 }
1821}
1822# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001823pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001824 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001826 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001828 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001829 generics: _visitor.fold_generics(_i . generics),
1830 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001832 }
1833}
1834# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001835pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001836 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001837 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001838 vis: _visitor.fold_visibility(_i . vis),
1839 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001840 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1841 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001842 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001843 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001844 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001845 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001846 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001847 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1848 }
1849}
1850# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001851pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1852 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001854 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001855 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001856 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001857 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001858 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001859 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001861 }
1862}
1863# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001864pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001865 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001866 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001867 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001868 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001869 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001870 generics: _visitor.fold_generics(_i . generics),
1871 data: _visitor.fold_variant_data(_i . data),
1872 }
1873}
1874# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001875pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001876 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001877 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001878 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001879 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1880 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001881 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1882 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
1885}
1886
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001888 LifetimeDef {
1889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001890 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001892 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1893 }
1894}
1895
1896pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1897 Lit {
1898 value: _i . value,
1899 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001900 }
1901}
1902# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001903pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001904 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001905 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001906 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1907 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1908 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1909 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1910 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1911 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1912 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001913 }
1914}
Nika Layzell27726662017-10-24 23:16:35 -04001915
David Tolnaydecf28d2017-11-11 11:56:45 -08001916pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1917 Macro {
1918 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001919 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001920 tokens: _i . tokens,
1921 }
1922}
David Tolnay14982012017-12-29 00:49:51 -05001923
David Tolnay85b69a42017-12-27 20:43:10 -05001924pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1925 use ::Member::*;
1926 match _i {
1927 Named(_binding_0, ) => {
1928 Named (
1929 _visitor.fold_ident(_binding_0),
1930 )
1931 }
1932 Unnamed(_binding_0, ) => {
1933 Unnamed (
1934 _visitor.fold_index(_binding_0),
1935 )
1936 }
1937 }
1938}
David Tolnaydecf28d2017-11-11 11:56:45 -08001939
Nika Layzella6f46c42017-10-26 15:26:16 -04001940pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001941 use ::MetaItem::*;
1942 match _i {
1943 Term(_binding_0, ) => {
1944 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001945 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001946 )
1947 }
1948 List(_binding_0, ) => {
1949 List (
1950 _visitor.fold_meta_item_list(_binding_0),
1951 )
1952 }
1953 NameValue(_binding_0, ) => {
1954 NameValue (
1955 _visitor.fold_meta_name_value(_binding_0),
1956 )
1957 }
1958 }
1959}
1960
Nika Layzella6f46c42017-10-26 15:26:16 -04001961pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001962 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001963 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001964 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001965 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1966 }
1967}
1968
Nika Layzella6f46c42017-10-26 15:26:16 -04001969pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001970 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001971 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001972 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001973 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001974 }
1975}
1976# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001977pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001978 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001979 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001980 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001981 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001982 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001983 decl: _visitor.fold_fn_decl(_i . decl),
1984 }
1985}
David Tolnayd60cfec2017-12-29 00:21:38 -05001986# [ cfg ( feature = "full" ) ]
1987pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
1988 MethodTurbofish {
1989 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
1990 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
1991 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
1992 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
1993 }
1994}
Nika Layzell27726662017-10-24 23:16:35 -04001995
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001996pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1997 MutType {
David Tolnay24237fb2017-12-29 02:15:26 -05001998 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001999 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002000 }
2001}
2002
Nika Layzella6f46c42017-10-26 15:26:16 -04002003pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002004 use ::NestedMetaItem::*;
2005 match _i {
2006 MetaItem(_binding_0, ) => {
2007 MetaItem (
2008 _visitor.fold_meta_item(_binding_0),
2009 )
2010 }
2011 Literal(_binding_0, ) => {
2012 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002013 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002014 )
2015 }
2016 }
2017}
2018
Nika Layzellc08227a2017-12-04 16:30:17 -05002019pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2020 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002021 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002022 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002023 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002024 }
2025}
2026# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002027pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002028 use ::Pat::*;
2029 match _i {
2030 Wild(_binding_0, ) => {
2031 Wild (
2032 _visitor.fold_pat_wild(_binding_0),
2033 )
2034 }
2035 Ident(_binding_0, ) => {
2036 Ident (
2037 _visitor.fold_pat_ident(_binding_0),
2038 )
2039 }
2040 Struct(_binding_0, ) => {
2041 Struct (
2042 _visitor.fold_pat_struct(_binding_0),
2043 )
2044 }
2045 TupleStruct(_binding_0, ) => {
2046 TupleStruct (
2047 _visitor.fold_pat_tuple_struct(_binding_0),
2048 )
2049 }
2050 Path(_binding_0, ) => {
2051 Path (
2052 _visitor.fold_pat_path(_binding_0),
2053 )
2054 }
2055 Tuple(_binding_0, ) => {
2056 Tuple (
2057 _visitor.fold_pat_tuple(_binding_0),
2058 )
2059 }
2060 Box(_binding_0, ) => {
2061 Box (
2062 _visitor.fold_pat_box(_binding_0),
2063 )
2064 }
2065 Ref(_binding_0, ) => {
2066 Ref (
2067 _visitor.fold_pat_ref(_binding_0),
2068 )
2069 }
2070 Lit(_binding_0, ) => {
2071 Lit (
2072 _visitor.fold_pat_lit(_binding_0),
2073 )
2074 }
2075 Range(_binding_0, ) => {
2076 Range (
2077 _visitor.fold_pat_range(_binding_0),
2078 )
2079 }
2080 Slice(_binding_0, ) => {
2081 Slice (
2082 _visitor.fold_pat_slice(_binding_0),
2083 )
2084 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002085 Macro(_binding_0, ) => {
2086 Macro (
2087 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002088 )
2089 }
2090 }
2091}
2092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002093pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002094 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002095 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002096 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002097 }
2098}
2099# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002100pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002101 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002102 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2103 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002104 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002105 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002106 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002107 }
2108}
2109# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002110pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002111 PatLit {
2112 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2113 }
2114}
2115# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002116pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002117 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002118 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002119 path: _visitor.fold_path(_i . path),
2120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PatRange {
2125 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002126 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002127 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002128 }
2129}
2130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002132 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002133 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002134 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002135 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002136 }
2137}
2138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002140 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002141 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002142 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002143 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002144 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002145 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002146 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002147 }
2148}
2149# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002150pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002151 PatStruct {
2152 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002153 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002154 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002155 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002156 }
2157}
2158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002159pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002160 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002161 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002162 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002163 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002164 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2165 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002166 }
2167}
2168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002169pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002170 PatTupleStruct {
2171 path: _visitor.fold_path(_i . path),
2172 pat: _visitor.fold_pat_tuple(_i . pat),
2173 }
2174}
2175# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002176pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002177 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002178 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002179 }
2180}
2181
Nika Layzella6f46c42017-10-26 15:26:16 -04002182pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002183 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002184 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002185 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2186 }
2187}
Nika Layzellc08227a2017-12-04 16:30:17 -05002188
2189pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2190 use ::PathArguments::*;
2191 match _i {
2192 None => { None }
2193 AngleBracketed(_binding_0, ) => {
2194 AngleBracketed (
2195 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2196 )
2197 }
2198 Parenthesized(_binding_0, ) => {
2199 Parenthesized (
2200 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2201 )
2202 }
2203 }
2204}
Nika Layzell27726662017-10-24 23:16:35 -04002205
Nika Layzella6f46c42017-10-26 15:26:16 -04002206pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002207 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002208 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002209 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002210 }
2211}
Nika Layzell27726662017-10-24 23:16:35 -04002212
Nika Layzella6f46c42017-10-26 15:26:16 -04002213pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002214 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002215 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002216 trait_ref: _visitor.fold_path(_i . trait_ref),
2217 }
2218}
2219
Nika Layzella6f46c42017-10-26 15:26:16 -04002220pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002221 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002222 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002223 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002224 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002225 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2226 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002227 }
2228}
2229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002230pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002231 use ::RangeLimits::*;
2232 match _i {
2233 HalfOpen(_binding_0, ) => {
2234 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002235 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002236 )
2237 }
2238 Closed(_binding_0, ) => {
2239 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002240 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002241 )
2242 }
2243 }
2244}
David Tolnayf93b90d2017-11-11 19:21:26 -08002245
2246pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2247 use ::ReturnType::*;
2248 match _i {
2249 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002250 Type(_binding_0, _binding_1, ) => {
2251 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002252 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2253 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002254 )
2255 }
2256 }
2257}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002258
2259pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2260 _i
2261}
Nika Layzell27726662017-10-24 23:16:35 -04002262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002263pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002264 use ::Stmt::*;
2265 match _i {
2266 Local(_binding_0, ) => {
2267 Local (
2268 Box::new(_visitor.fold_local(* _binding_0)),
2269 )
2270 }
2271 Item(_binding_0, ) => {
2272 Item (
2273 Box::new(_visitor.fold_item(* _binding_0)),
2274 )
2275 }
2276 Expr(_binding_0, ) => {
2277 Expr (
2278 Box::new(_visitor.fold_expr(* _binding_0)),
2279 )
2280 }
2281 Semi(_binding_0, _binding_1, ) => {
2282 Semi (
2283 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002284 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002285 )
2286 }
Nika Layzell27726662017-10-24 23:16:35 -04002287 }
2288}
2289
Nika Layzella6f46c42017-10-26 15:26:16 -04002290pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002291 use ::TraitBoundModifier::*;
2292 match _i {
2293 None => { None }
2294 Maybe(_binding_0, ) => {
2295 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002296 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002297 )
2298 }
2299 }
2300}
2301# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002302pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002303 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002304 match _i {
2305 Const(_binding_0, ) => {
2306 Const (
2307 _visitor.fold_trait_item_const(_binding_0),
2308 )
2309 }
2310 Method(_binding_0, ) => {
2311 Method (
2312 _visitor.fold_trait_item_method(_binding_0),
2313 )
2314 }
2315 Type(_binding_0, ) => {
2316 Type (
2317 _visitor.fold_trait_item_type(_binding_0),
2318 )
2319 }
2320 Macro(_binding_0, ) => {
2321 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002322 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002323 )
2324 }
2325 }
2326}
2327# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002328pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2329 TraitItemConst {
2330 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002331 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002332 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002333 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002334 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002335 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002336 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002337 _visitor.fold_expr(( it ) . 1),
2338 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002339 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002340 }
2341}
2342# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002343pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2344 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002346 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002347 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002348 }
2349}
2350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002351pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002352 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002353 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002354 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002355 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002356 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002357 }
2358}
2359# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002360pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002361 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002362 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002363 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002364 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002365 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002366 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002367 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002368 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002369 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002370 _visitor.fold_type(( it ) . 1),
2371 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002372 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002373 }
2374}
2375
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002376pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2377 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002378 match _i {
2379 Slice(_binding_0, ) => {
2380 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002381 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002382 )
2383 }
2384 Array(_binding_0, ) => {
2385 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002386 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 Ptr(_binding_0, ) => {
2390 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002391 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002392 )
2393 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002394 Reference(_binding_0, ) => {
2395 Reference (
2396 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002397 )
2398 }
2399 BareFn(_binding_0, ) => {
2400 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002401 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002402 )
2403 }
2404 Never(_binding_0, ) => {
2405 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002406 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002407 )
2408 }
David Tolnay05362582017-12-26 01:33:57 -05002409 Tuple(_binding_0, ) => {
2410 Tuple (
2411 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002412 )
2413 }
2414 Path(_binding_0, ) => {
2415 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002416 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002417 )
2418 }
2419 TraitObject(_binding_0, ) => {
2420 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002421 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002422 )
2423 }
2424 ImplTrait(_binding_0, ) => {
2425 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002426 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002427 )
2428 }
2429 Paren(_binding_0, ) => {
2430 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002431 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002432 )
2433 }
2434 Group(_binding_0, ) => {
2435 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002436 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002437 )
2438 }
2439 Infer(_binding_0, ) => {
2440 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002441 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002442 )
2443 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002444 Macro(_binding_0, ) => {
2445 Macro (
2446 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002447 )
2448 }
2449 }
2450}
2451
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002452pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2453 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002454 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002456 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002457 amt: _visitor.fold_expr(_i . amt),
2458 }
2459}
2460
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002461pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2462 TypeBareFn {
2463 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002464 }
2465}
2466
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002467pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2468 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002469 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002470 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471 ty: _visitor.fold_type(_i . ty),
2472 }
2473}
2474
2475pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2476 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002477 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002478 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002479 }
2480}
2481
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002482pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2483 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002484 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002486 }
2487}
2488
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002489pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2490 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002491 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002492 }
2493}
2494
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002495pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2496 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002497 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002498 }
2499}
2500
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002501pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2502 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002503 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002504 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002505 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002506 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002507 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002508 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002509 }
2510}
2511
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002512pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2513 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002514 match _i {
2515 Trait(_binding_0, _binding_1, ) => {
2516 Trait (
2517 _visitor.fold_poly_trait_ref(_binding_0),
2518 _visitor.fold_trait_bound_modifier(_binding_1),
2519 )
2520 }
2521 Region(_binding_0, ) => {
2522 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002523 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002524 )
2525 }
2526 }
2527}
2528
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002529pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2530 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002531 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002532 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002533 }
2534}
2535
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002536pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2537 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002538 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002539 path: _visitor.fold_path(_i . path),
2540 }
2541}
2542
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2544 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002545 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2546 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002547 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002548 }
2549}
2550
David Tolnay0a89b4d2017-11-13 00:55:45 -08002551pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2552 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002553 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002554 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002555 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002556 }
2557}
2558
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002559pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2560 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002561 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002562 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002563 }
2564}
2565
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002566pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2567 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002568 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002569 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002570 }
2571}
2572
David Tolnay05362582017-12-26 01:33:57 -05002573pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2574 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002575 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002576 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002577 }
2578}
2579
Nika Layzella6f46c42017-10-26 15:26:16 -04002580pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002581 use ::UnOp::*;
2582 match _i {
2583 Deref(_binding_0, ) => {
2584 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002585 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 )
2587 }
2588 Not(_binding_0, ) => {
2589 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002590 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002591 )
2592 }
2593 Neg(_binding_0, ) => {
2594 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002596 )
2597 }
2598 }
2599}
2600
Nika Layzella6f46c42017-10-26 15:26:16 -04002601pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002602 use ::Unsafety::*;
2603 match _i {
2604 Unsafe(_binding_0, ) => {
2605 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002606 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002607 )
2608 }
2609 Normal => { Normal }
2610 }
2611}
David Tolnay5f332a92017-12-26 00:42:45 -05002612# [ cfg ( feature = "full" ) ]
2613pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2614 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002615 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002616 }
2617}
2618# [ cfg ( feature = "full" ) ]
2619pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2620 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002621 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002622 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2623 }
2624}
2625# [ cfg ( feature = "full" ) ]
2626pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2627 UsePath {
2628 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002629 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002630 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002631 _visitor.fold_ident(( it ) . 1),
2632 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002633 }
2634}
2635# [ cfg ( feature = "full" ) ]
2636pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2637 use ::UseTree::*;
2638 match _i {
2639 Path(_binding_0, ) => {
2640 Path (
2641 _visitor.fold_use_path(_binding_0),
2642 )
2643 }
2644 Glob(_binding_0, ) => {
2645 Glob (
2646 _visitor.fold_use_glob(_binding_0),
2647 )
2648 }
2649 List(_binding_0, ) => {
2650 List (
2651 _visitor.fold_use_list(_binding_0),
2652 )
2653 }
2654 }
2655}
Nika Layzell27726662017-10-24 23:16:35 -04002656
Nika Layzella6f46c42017-10-26 15:26:16 -04002657pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002658 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002659 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002660 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002661 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002662 discriminant: (_i . discriminant).map(|it| { (
2663 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2664 _visitor.fold_expr(( it ) . 1),
2665 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
2667}
2668
Nika Layzella6f46c42017-10-26 15:26:16 -04002669pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002670 use ::VariantData::*;
2671 match _i {
2672 Struct(_binding_0, _binding_1, ) => {
2673 Struct (
2674 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002675 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002676 )
2677 }
2678 Tuple(_binding_0, _binding_1, ) => {
2679 Tuple (
2680 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002681 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002682 )
2683 }
2684 Unit => { Unit }
2685 }
2686}
Nika Layzell27726662017-10-24 23:16:35 -04002687
Nika Layzella6f46c42017-10-26 15:26:16 -04002688pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002689 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002690 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002691 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002692 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002693 }
2694}
2695
Nika Layzella6f46c42017-10-26 15:26:16 -04002696pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002697 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002698 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002699 }
2700}
2701
Nika Layzella6f46c42017-10-26 15:26:16 -04002702pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002703 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002704 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002705 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002706 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002707 path: Box::new(_visitor.fold_path(* _i . path)),
2708 }
2709}
2710
Nika Layzella6f46c42017-10-26 15:26:16 -04002711pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002712 use ::Visibility::*;
2713 match _i {
2714 Public(_binding_0, ) => {
2715 Public (
2716 _visitor.fold_vis_public(_binding_0),
2717 )
2718 }
2719 Crate(_binding_0, ) => {
2720 Crate (
2721 _visitor.fold_vis_crate(_binding_0),
2722 )
2723 }
2724 Restricted(_binding_0, ) => {
2725 Restricted (
2726 _visitor.fold_vis_restricted(_binding_0),
2727 )
2728 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002729 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002730 }
2731}
2732
Nika Layzella6f46c42017-10-26 15:26:16 -04002733pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002734 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002735 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002736 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002737 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002738 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002739 }
2740}
2741
Nika Layzella6f46c42017-10-26 15:26:16 -04002742pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002743 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002744 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002745 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2746 }
2747}
2748
Nika Layzella6f46c42017-10-26 15:26:16 -04002749pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002750 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002751 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002752 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002753 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002754 }
2755}
2756
Nika Layzella6f46c42017-10-26 15:26:16 -04002757pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002758 use ::WherePredicate::*;
2759 match _i {
2760 BoundPredicate(_binding_0, ) => {
2761 BoundPredicate (
2762 _visitor.fold_where_bound_predicate(_binding_0),
2763 )
2764 }
2765 RegionPredicate(_binding_0, ) => {
2766 RegionPredicate (
2767 _visitor.fold_where_region_predicate(_binding_0),
2768 )
2769 }
2770 EqPredicate(_binding_0, ) => {
2771 EqPredicate (
2772 _visitor.fold_where_eq_predicate(_binding_0),
2773 )
2774 }
2775 }
2776}
2777
Nika Layzella6f46c42017-10-26 15:26:16 -04002778pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002779 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002780 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002781 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002782 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
2785