blob: 043a61e44219d1f599899be19a30f804cacd71f0 [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
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzellc08227a2017-12-04 16:30:17 -0500263fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500290
291fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800300
301fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500302
303fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800313fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800319fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800321fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800323fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800327fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
328
329fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
330
331fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
332
333fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
334
335fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
336
337fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
338
339fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
340
341fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
342
343fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
344
David Tolnay0a89b4d2017-11-13 00:55:45 -0800345fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800346
347fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
348
349fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
350
David Tolnay05362582017-12-26 01:33:57 -0500351fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800352
Nika Layzella6f46c42017-10-26 15:26:16 -0400353fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500354# [ cfg ( feature = "full" ) ]
355fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
356# [ cfg ( feature = "full" ) ]
357fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
358# [ cfg ( feature = "full" ) ]
359fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
360# [ cfg ( feature = "full" ) ]
361fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
385}
386
David Tolnayd0adf522017-12-29 01:30:07 -0500387pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
388 _i.span = _visitor.fold_span(_i.span);
389 _i
390}
391
392pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
393 _i.span = _visitor.fold_span(_i.span);
394 _i
395}
396
Nika Layzell27726662017-10-24 23:16:35 -0400397
Nika Layzella6f46c42017-10-26 15:26:16 -0400398pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400399 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500400 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400401 kind: _visitor.fold_abi_kind(_i . kind),
402 }
403}
404
Nika Layzella6f46c42017-10-26 15:26:16 -0400405pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400406 use ::AbiKind::*;
407 match _i {
408 Named(_binding_0, ) => {
409 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500410 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400411 )
412 }
413 Default => { Default }
414 }
415}
416
Nika Layzellc08227a2017-12-04 16:30:17 -0500417pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
418 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500419 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500420 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500421 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400423 }
424}
425# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400426pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400427 ArgCaptured {
428 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500429 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800430 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400431 }
432}
433# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400434pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400435 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500436 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500437 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400438 }
439}
440# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400441pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400442 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500443 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500444 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500445 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500446 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400447 }
448}
449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400450pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400451 Arm {
452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
453 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500454 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400455 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400457 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400459 }
460}
461
Nika Layzella6f46c42017-10-26 15:26:16 -0400462pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400463 use ::AttrStyle::*;
464 match _i {
465 Outer => { Outer }
466 Inner(_binding_0, ) => {
467 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400469 )
470 }
471 }
472}
473
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400475 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500476 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500477 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500478 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400479 path: _visitor.fold_path(_i . path),
480 tts: _i . tts,
481 is_sugared_doc: _i . is_sugared_doc,
482 }
483}
484
Nika Layzella6f46c42017-10-26 15:26:16 -0400485pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400486 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500487 name: (_i . name).map(|it| { (
488 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500489 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500490 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800491 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400492 }
493}
494
Nika Layzella6f46c42017-10-26 15:26:16 -0400495pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400496 use ::BareFnArgName::*;
497 match _i {
498 Named(_binding_0, ) => {
499 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500500 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400501 )
502 }
503 Wild(_binding_0, ) => {
504 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500505 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400506 )
507 }
508 }
509}
510
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800511pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
512 BareFnType {
David Tolnay9b258702017-12-29 02:24:41 -0500513 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400514 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500515 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500516 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500517 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400518 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800520 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400521 }
522}
523
Nika Layzella6f46c42017-10-26 15:26:16 -0400524pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400525 use ::BinOp::*;
526 match _i {
527 Add(_binding_0, ) => {
528 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400530 )
531 }
532 Sub(_binding_0, ) => {
533 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500534 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400535 )
536 }
537 Mul(_binding_0, ) => {
538 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500539 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
542 Div(_binding_0, ) => {
543 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
547 Rem(_binding_0, ) => {
548 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500549 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400550 )
551 }
552 And(_binding_0, ) => {
553 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
557 Or(_binding_0, ) => {
558 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
562 BitXor(_binding_0, ) => {
563 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
567 BitAnd(_binding_0, ) => {
568 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
572 BitOr(_binding_0, ) => {
573 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
577 Shl(_binding_0, ) => {
578 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
582 Shr(_binding_0, ) => {
583 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
587 Eq(_binding_0, ) => {
588 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
592 Lt(_binding_0, ) => {
593 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
597 Le(_binding_0, ) => {
598 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
602 Ne(_binding_0, ) => {
603 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
607 Ge(_binding_0, ) => {
608 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
612 Gt(_binding_0, ) => {
613 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
617 AddEq(_binding_0, ) => {
618 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
622 SubEq(_binding_0, ) => {
623 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
627 MulEq(_binding_0, ) => {
628 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
632 DivEq(_binding_0, ) => {
633 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
637 RemEq(_binding_0, ) => {
638 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
642 BitXorEq(_binding_0, ) => {
643 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
647 BitAndEq(_binding_0, ) => {
648 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
652 BitOrEq(_binding_0, ) => {
653 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500654 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400655 )
656 }
657 ShlEq(_binding_0, ) => {
658 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500659 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400660 )
661 }
662 ShrEq(_binding_0, ) => {
663 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500664 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400665 )
666 }
667 }
668}
669# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400670pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400671 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500672 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400673 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
674 }
675}
676
Nika Layzella6f46c42017-10-26 15:26:16 -0400677pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400678 use ::Body::*;
679 match _i {
680 Enum(_binding_0, ) => {
681 Enum (
682 _visitor.fold_body_enum(_binding_0),
683 )
684 }
685 Struct(_binding_0, ) => {
686 Struct (
687 _visitor.fold_body_struct(_binding_0),
688 )
689 }
690 }
691}
692
Nika Layzella6f46c42017-10-26 15:26:16 -0400693pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400694 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500695 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500696 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400697 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
698 }
699}
700
Nika Layzella6f46c42017-10-26 15:26:16 -0400701pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400702 BodyStruct {
703 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500704 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
705 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400706 }
707}
708
Nika Layzella6f46c42017-10-26 15:26:16 -0400709pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400710 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500711 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
712 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400713 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400715 }
716}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500717
718pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
719 ConstParam {
720 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500721 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500722 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500724 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500726 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
727 }
728}
Nika Layzell27726662017-10-24 23:16:35 -0400729
Nika Layzella6f46c42017-10-26 15:26:16 -0400730pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400731 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400732 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500733 vis: _visitor.fold_visibility(_i . vis),
734 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400735 generics: _visitor.fold_generics(_i . generics),
736 body: _visitor.fold_body(_i . body),
737 }
738}
739
Nika Layzella6f46c42017-10-26 15:26:16 -0400740pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500741 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400742 match _i {
743 Box(_binding_0, ) => {
744 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400745 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400746 )
747 }
748 InPlace(_binding_0, ) => {
749 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400750 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400751 )
752 }
753 Array(_binding_0, ) => {
754 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400755 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400756 )
757 }
758 Call(_binding_0, ) => {
759 Call (
760 _visitor.fold_expr_call(_binding_0),
761 )
762 }
763 MethodCall(_binding_0, ) => {
764 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400765 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400766 )
767 }
David Tolnay05362582017-12-26 01:33:57 -0500768 Tuple(_binding_0, ) => {
769 Tuple (
770 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400771 )
772 }
773 Binary(_binding_0, ) => {
774 Binary (
775 _visitor.fold_expr_binary(_binding_0),
776 )
777 }
778 Unary(_binding_0, ) => {
779 Unary (
780 _visitor.fold_expr_unary(_binding_0),
781 )
782 }
783 Lit(_binding_0, ) => {
784 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500785 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400786 )
787 }
788 Cast(_binding_0, ) => {
789 Cast (
790 _visitor.fold_expr_cast(_binding_0),
791 )
792 }
793 Type(_binding_0, ) => {
794 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500795 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400796 )
797 }
798 If(_binding_0, ) => {
799 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400800 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400801 )
802 }
803 IfLet(_binding_0, ) => {
804 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
808 While(_binding_0, ) => {
809 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400810 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
813 WhileLet(_binding_0, ) => {
814 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400815 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400816 )
817 }
818 ForLoop(_binding_0, ) => {
819 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400820 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400821 )
822 }
823 Loop(_binding_0, ) => {
824 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400825 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400826 )
827 }
828 Match(_binding_0, ) => {
829 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400830 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400831 )
832 }
833 Closure(_binding_0, ) => {
834 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400835 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400836 )
837 }
Nika Layzell640832a2017-12-04 13:37:09 -0500838 Unsafe(_binding_0, ) => {
839 Unsafe (
840 full!(_visitor.fold_expr_unsafe(_binding_0)),
841 )
842 }
Nika Layzell27726662017-10-24 23:16:35 -0400843 Block(_binding_0, ) => {
844 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400845 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400846 )
847 }
848 Assign(_binding_0, ) => {
849 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400850 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400851 )
852 }
853 AssignOp(_binding_0, ) => {
854 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
858 Field(_binding_0, ) => {
859 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400860 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400861 )
862 }
Nika Layzell27726662017-10-24 23:16:35 -0400863 Index(_binding_0, ) => {
864 Index (
865 _visitor.fold_expr_index(_binding_0),
866 )
867 }
868 Range(_binding_0, ) => {
869 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400870 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400871 )
872 }
873 Path(_binding_0, ) => {
874 Path (
875 _visitor.fold_expr_path(_binding_0),
876 )
877 }
878 AddrOf(_binding_0, ) => {
879 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400880 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400881 )
882 }
883 Break(_binding_0, ) => {
884 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400885 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
888 Continue(_binding_0, ) => {
889 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400890 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
David Tolnayc246cd32017-12-28 23:14:32 -0500893 Return(_binding_0, ) => {
894 Return (
895 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 )
897 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800898 Macro(_binding_0, ) => {
899 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500900 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
903 Struct(_binding_0, ) => {
904 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400905 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400906 )
907 }
908 Repeat(_binding_0, ) => {
909 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400910 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
913 Paren(_binding_0, ) => {
914 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500915 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400916 )
917 }
918 Group(_binding_0, ) => {
919 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500920 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 )
922 }
923 Try(_binding_0, ) => {
924 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400925 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400926 )
927 }
928 Catch(_binding_0, ) => {
929 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400930 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400931 )
932 }
933 Yield(_binding_0, ) => {
934 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400935 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400936 )
937 }
938 }
939}
940# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500941pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
942 ExprAddrOf {
943 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
944 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500945 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500946 expr: Box::new(_visitor.fold_expr(* _i . expr)),
947 }
948}
949# [ cfg ( feature = "full" ) ]
950pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
951 ExprArray {
952 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
953 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500954 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500955 }
956}
957# [ cfg ( feature = "full" ) ]
958pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
959 ExprAssign {
960 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
961 left: Box::new(_visitor.fold_expr(* _i . left)),
962 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
963 right: Box::new(_visitor.fold_expr(* _i . right)),
964 }
965}
966# [ cfg ( feature = "full" ) ]
967pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
968 ExprAssignOp {
969 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
970 left: Box::new(_visitor.fold_expr(* _i . left)),
971 op: _visitor.fold_bin_op(_i . op),
972 right: Box::new(_visitor.fold_expr(* _i . right)),
973 }
974}
975
976pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
977 ExprBinary {
978 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
979 left: Box::new(_visitor.fold_expr(* _i . left)),
980 op: _visitor.fold_bin_op(_i . op),
981 right: Box::new(_visitor.fold_expr(* _i . right)),
982 }
983}
984# [ cfg ( feature = "full" ) ]
985pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
986 ExprBlock {
987 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
988 block: _visitor.fold_block(_i . block),
989 }
990}
991# [ cfg ( feature = "full" ) ]
992pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
993 ExprBox {
994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
995 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
996 expr: Box::new(_visitor.fold_expr(* _i . expr)),
997 }
998}
999# [ cfg ( feature = "full" ) ]
1000pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1001 ExprBreak {
1002 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1003 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1004 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1005 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1006 }
1007}
1008
1009pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1010 ExprCall {
1011 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1012 func: Box::new(_visitor.fold_expr(* _i . func)),
1013 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1014 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1015 }
1016}
1017
1018pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1019 ExprCast {
1020 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1021 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1022 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1023 ty: Box::new(_visitor.fold_type(* _i . ty)),
1024 }
1025}
1026# [ cfg ( feature = "full" ) ]
1027pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1028 ExprCatch {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1031 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1032 block: _visitor.fold_block(_i . block),
1033 }
1034}
1035# [ cfg ( feature = "full" ) ]
1036pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1037 ExprClosure {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001039 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001040 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1041 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1042 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1043 output: _visitor.fold_return_type(_i . output),
1044 body: Box::new(_visitor.fold_expr(* _i . body)),
1045 }
1046}
1047# [ cfg ( feature = "full" ) ]
1048pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1049 ExprContinue {
1050 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1051 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1052 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1053 }
1054}
1055# [ cfg ( feature = "full" ) ]
1056pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1057 ExprField {
1058 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1059 base: Box::new(_visitor.fold_expr(* _i . base)),
1060 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1061 member: _visitor.fold_member(_i . member),
1062 }
1063}
1064# [ cfg ( feature = "full" ) ]
1065pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1066 ExprForLoop {
1067 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1068 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1069 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1070 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1071 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1072 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1073 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1074 body: _visitor.fold_block(_i . body),
1075 }
1076}
David Tolnaye98775f2017-12-28 23:17:00 -05001077# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001078pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1079 ExprGroup {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1081 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1082 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1083 }
1084}
1085# [ cfg ( feature = "full" ) ]
1086pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1087 ExprIf {
1088 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1089 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1090 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001091 then_branch: _visitor.fold_block(_i . then_branch),
1092 else_branch: (_i . else_branch).map(|it| { (
1093 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1094 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1095 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001096 }
1097}
1098# [ cfg ( feature = "full" ) ]
1099pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1100 ExprIfLet {
1101 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1102 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1103 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1104 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1105 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1106 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001107 then_branch: _visitor.fold_block(_i . then_branch),
1108 else_branch: (_i . else_branch).map(|it| { (
1109 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1110 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1111 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001112 }
1113}
1114# [ cfg ( feature = "full" ) ]
1115pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1116 ExprInPlace {
1117 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1118 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001119 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001120 value: Box::new(_visitor.fold_expr(* _i . value)),
1121 }
1122}
1123
1124pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1125 ExprIndex {
1126 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1127 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1128 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1129 index: Box::new(_visitor.fold_expr(* _i . index)),
1130 }
1131}
1132
1133pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1134 ExprLit {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 lit: _visitor.fold_lit(_i . lit),
1137 }
1138}
1139# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001140pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001141 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001142 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001143 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001144 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001145 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1146 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001147 }
1148}
1149# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001150pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1151 ExprMacro {
1152 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1153 mac: _visitor.fold_macro(_i . mac),
1154 }
1155}
1156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001157pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001158 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001159 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001160 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001161 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001162 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1164 }
1165}
1166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001167pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001168 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001170 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001171 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001172 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001173 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001174 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1175 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001176 }
1177}
David Tolnaye98775f2017-12-28 23:17:00 -05001178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001179pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001180 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001181 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001182 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001183 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001184 }
1185}
1186
Nika Layzella6f46c42017-10-26 15:26:16 -04001187pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001188 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001189 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001190 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001191 path: _visitor.fold_path(_i . path),
1192 }
1193}
1194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001195pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001198 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001199 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
1202}
1203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001207 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001208 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001209 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1211 }
1212}
1213# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001214pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1215 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001216 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001217 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001218 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001219 }
1220}
1221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001222pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001225 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001226 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001227 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1228 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1229 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
1231}
1232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001233pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001235 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001237 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
1240# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001241pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1242 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001243 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001244 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001245 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001246 }
1247}
David Tolnay0cf94f22017-12-28 23:46:26 -05001248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001251 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001253 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001254 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257
Nika Layzella6f46c42017-10-26 15:26:16 -04001258pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001259 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001261 op: _visitor.fold_un_op(_i . op),
1262 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1263 }
1264}
1265# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001266pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1267 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001268 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001269 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001270 block: _visitor.fold_block(_i . block),
1271 }
1272}
1273# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001274pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001275 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001276 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001277 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001278 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1279 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001280 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1281 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001282 }
1283}
1284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001285pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001286 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001287 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001288 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001289 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1290 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1291 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001292 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001293 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001294 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1295 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001296 }
1297}
1298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001299pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001300 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001301 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001302 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001303 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001304 }
1305}
1306
Nika Layzella6f46c42017-10-26 15:26:16 -04001307pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001308 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001310 vis: _visitor.fold_visibility(_i . vis),
1311 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001313 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001314 }
1315}
1316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001317pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001318 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001320 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001321 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001322 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001323 }
1324}
1325# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001326pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001327 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001328 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1329 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001330 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001331 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001332 }
1333}
1334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001335pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001336 File {
1337 shebang: _i . shebang,
1338 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1339 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1340 }
1341}
1342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001343pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001344 use ::FnArg::*;
1345 match _i {
1346 SelfRef(_binding_0, ) => {
1347 SelfRef (
1348 _visitor.fold_arg_self_ref(_binding_0),
1349 )
1350 }
1351 SelfValue(_binding_0, ) => {
1352 SelfValue (
1353 _visitor.fold_arg_self(_binding_0),
1354 )
1355 }
1356 Captured(_binding_0, ) => {
1357 Captured (
1358 _visitor.fold_arg_captured(_binding_0),
1359 )
1360 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001361 Inferred(_binding_0, ) => {
1362 Inferred (
1363 _visitor.fold_pat(_binding_0),
1364 )
1365 }
Nika Layzell27726662017-10-24 23:16:35 -04001366 Ignored(_binding_0, ) => {
1367 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001368 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001369 )
1370 }
1371 }
1372}
1373# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001374pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001375 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001376 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001377 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001378 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001379 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001380 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001381 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001382 }
1383}
1384# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001385pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001386 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001387 match _i {
1388 Fn(_binding_0, ) => {
1389 Fn (
1390 _visitor.fold_foreign_item_fn(_binding_0),
1391 )
1392 }
1393 Static(_binding_0, ) => {
1394 Static (
1395 _visitor.fold_foreign_item_static(_binding_0),
1396 )
1397 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001398 Type(_binding_0, ) => {
1399 Type (
1400 _visitor.fold_foreign_item_type(_binding_0),
1401 )
1402 }
Nika Layzell27726662017-10-24 23:16:35 -04001403 }
1404}
1405# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001406pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1407 ForeignItemFn {
1408 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1409 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001410 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001411 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001412 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001413 }
1414}
1415# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001416pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001417 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001418 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1419 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001420 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001421 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001422 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001423 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001424 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001425 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001426 }
1427}
David Tolnay199bcbb2017-11-12 10:33:52 -08001428# [ cfg ( feature = "full" ) ]
1429pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1430 ForeignItemType {
1431 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1432 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001433 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001434 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001435 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001436 }
1437}
Nika Layzell27726662017-10-24 23:16:35 -04001438
Nika Layzellc08227a2017-12-04 16:30:17 -05001439pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1440 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001441 match _i {
1442 Lifetime(_binding_0, ) => {
1443 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001444 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001445 )
1446 }
1447 Type(_binding_0, ) => {
1448 Type (
1449 _visitor.fold_type(_binding_0),
1450 )
1451 }
1452 TypeBinding(_binding_0, ) => {
1453 TypeBinding (
1454 _visitor.fold_type_binding(_binding_0),
1455 )
1456 }
Nika Layzellc680e612017-12-04 19:07:20 -05001457 Const(_binding_0, ) => {
1458 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001459 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001460 )
1461 }
Nika Layzell357885a2017-12-04 15:47:07 -05001462 }
1463}
David Tolnayd60cfec2017-12-29 00:21:38 -05001464# [ cfg ( feature = "full" ) ]
1465pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1466 use ::GenericMethodArgument::*;
1467 match _i {
1468 Type(_binding_0, ) => {
1469 Type (
1470 _visitor.fold_type(_binding_0),
1471 )
1472 }
1473 Const(_binding_0, ) => {
1474 Const (
1475 _visitor.fold_expr(_binding_0),
1476 )
1477 }
1478 }
1479}
Nika Layzell357885a2017-12-04 15:47:07 -05001480
David Tolnayc2f1aba2017-11-12 20:29:22 -08001481pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1482 use ::GenericParam::*;
1483 match _i {
1484 Lifetime(_binding_0, ) => {
1485 Lifetime (
1486 _visitor.fold_lifetime_def(_binding_0),
1487 )
1488 }
1489 Type(_binding_0, ) => {
1490 Type (
1491 _visitor.fold_type_param(_binding_0),
1492 )
1493 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001494 Const(_binding_0, ) => {
1495 Const (
1496 _visitor.fold_const_param(_binding_0),
1497 )
1498 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001499 }
1500}
1501
Nika Layzella6f46c42017-10-26 15:26:16 -04001502pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001503 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001505 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001506 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001507 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001508 }
1509}
1510# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001511pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001512 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001513 match _i {
1514 Const(_binding_0, ) => {
1515 Const (
1516 _visitor.fold_impl_item_const(_binding_0),
1517 )
1518 }
1519 Method(_binding_0, ) => {
1520 Method (
1521 _visitor.fold_impl_item_method(_binding_0),
1522 )
1523 }
1524 Type(_binding_0, ) => {
1525 Type (
1526 _visitor.fold_impl_item_type(_binding_0),
1527 )
1528 }
1529 Macro(_binding_0, ) => {
1530 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001531 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001532 )
1533 }
1534 }
1535}
1536# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001537pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1538 ImplItemConst {
1539 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1540 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001541 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001542 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001543 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001544 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001545 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001547 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001548 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001549 }
1550}
1551# [ cfg ( feature = "full" ) ]
1552pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1553 ImplItemMacro {
1554 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1555 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001556 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001557 }
1558}
1559# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001560pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001561 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001562 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001563 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001564 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001565 sig: _visitor.fold_method_sig(_i . sig),
1566 block: _visitor.fold_block(_i . block),
1567 }
1568}
1569# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001570pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001571 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001572 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001573 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001574 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001575 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001576 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001577 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001578 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001579 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001581 }
1582}
David Tolnay14982012017-12-29 00:49:51 -05001583
David Tolnay85b69a42017-12-27 20:43:10 -05001584pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1585 Index {
1586 index: _i . index,
1587 span: _visitor.fold_span(_i . span),
1588 }
1589}
1590# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001591pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001592 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001593 match _i {
1594 ExternCrate(_binding_0, ) => {
1595 ExternCrate (
1596 _visitor.fold_item_extern_crate(_binding_0),
1597 )
1598 }
1599 Use(_binding_0, ) => {
1600 Use (
1601 _visitor.fold_item_use(_binding_0),
1602 )
1603 }
1604 Static(_binding_0, ) => {
1605 Static (
1606 _visitor.fold_item_static(_binding_0),
1607 )
1608 }
1609 Const(_binding_0, ) => {
1610 Const (
1611 _visitor.fold_item_const(_binding_0),
1612 )
1613 }
1614 Fn(_binding_0, ) => {
1615 Fn (
1616 _visitor.fold_item_fn(_binding_0),
1617 )
1618 }
1619 Mod(_binding_0, ) => {
1620 Mod (
1621 _visitor.fold_item_mod(_binding_0),
1622 )
1623 }
1624 ForeignMod(_binding_0, ) => {
1625 ForeignMod (
1626 _visitor.fold_item_foreign_mod(_binding_0),
1627 )
1628 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001629 Type(_binding_0, ) => {
1630 Type (
1631 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001632 )
1633 }
1634 Enum(_binding_0, ) => {
1635 Enum (
1636 _visitor.fold_item_enum(_binding_0),
1637 )
1638 }
1639 Struct(_binding_0, ) => {
1640 Struct (
1641 _visitor.fold_item_struct(_binding_0),
1642 )
1643 }
1644 Union(_binding_0, ) => {
1645 Union (
1646 _visitor.fold_item_union(_binding_0),
1647 )
1648 }
1649 Trait(_binding_0, ) => {
1650 Trait (
1651 _visitor.fold_item_trait(_binding_0),
1652 )
1653 }
1654 DefaultImpl(_binding_0, ) => {
1655 DefaultImpl (
1656 _visitor.fold_item_default_impl(_binding_0),
1657 )
1658 }
1659 Impl(_binding_0, ) => {
1660 Impl (
1661 _visitor.fold_item_impl(_binding_0),
1662 )
1663 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001664 Macro(_binding_0, ) => {
1665 Macro (
1666 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001667 )
1668 }
David Tolnay500d8322017-12-18 00:32:51 -08001669 Macro2(_binding_0, ) => {
1670 Macro2 (
1671 _visitor.fold_item_macro2(_binding_0),
1672 )
1673 }
Nika Layzell27726662017-10-24 23:16:35 -04001674 }
1675}
1676# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001677pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1678 ItemConst {
1679 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1680 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001681 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001682 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001683 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001684 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001685 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001686 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001687 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001688 }
1689}
1690# [ cfg ( feature = "full" ) ]
1691pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1692 ItemDefaultImpl {
1693 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001694 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001695 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001696 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001697 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1698 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001699 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001700 }
1701}
1702# [ cfg ( feature = "full" ) ]
1703pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1704 ItemEnum {
1705 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1706 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001707 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001708 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001709 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001710 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001711 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1712 }
1713}
1714# [ cfg ( feature = "full" ) ]
1715pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1716 ItemExternCrate {
1717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1718 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001719 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1720 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001721 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001722 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001723 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001724 _visitor.fold_ident(( it ) . 1),
1725 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001726 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001727 }
1728}
1729# [ cfg ( feature = "full" ) ]
1730pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1731 ItemFn {
1732 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1733 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001734 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001735 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001736 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001737 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001738 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001739 block: Box::new(_visitor.fold_block(* _i . block)),
1740 }
1741}
1742# [ cfg ( feature = "full" ) ]
1743pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1744 ItemForeignMod {
1745 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1746 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001747 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001748 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1749 }
1750}
1751# [ cfg ( feature = "full" ) ]
1752pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1753 ItemImpl {
1754 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001755 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001756 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001757 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001758 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001759 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001760 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001761 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001762 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001763 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001764 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001765 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001766 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1767 }
1768}
1769# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001770pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1771 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001772 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001773 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001774 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001775 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001776 }
1777}
1778# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001779pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1780 ItemMacro2 {
1781 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1782 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001783 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001784 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001785 args: _i . args,
1786 body: _i . body,
1787 }
1788}
1789# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001790pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001791 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001793 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001794 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001795 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001796 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001797 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001798 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1799 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001801 }
1802}
1803# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001804pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001805 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001806 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001807 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001809 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001810 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001811 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001812 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001813 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001814 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001815 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001816 }
1817}
1818# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001819pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001820 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001821 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001822 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001823 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001824 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001825 generics: _visitor.fold_generics(_i . generics),
1826 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001828 }
1829}
1830# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001831pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001832 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001833 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001834 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001835 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001836 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1837 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001838 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001839 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001840 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001841 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001842 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001843 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1844 }
1845}
1846# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001847pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1848 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001850 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001851 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001852 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001853 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001854 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001855 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001857 }
1858}
1859# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001860pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001861 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001862 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001863 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001865 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001866 generics: _visitor.fold_generics(_i . generics),
1867 data: _visitor.fold_variant_data(_i . data),
1868 }
1869}
1870# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001871pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001872 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001873 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001874 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001875 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1876 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001877 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1878 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001879 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001880 }
1881}
1882
Nika Layzella6f46c42017-10-26 15:26:16 -04001883pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001884 LifetimeDef {
1885 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001886 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001888 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1889 }
1890}
1891
1892pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1893 Lit {
1894 value: _i . value,
1895 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001896 }
1897}
1898# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001899pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001900 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001901 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001902 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1903 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1904 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1905 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1906 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1907 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1908 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001909 }
1910}
Nika Layzell27726662017-10-24 23:16:35 -04001911
David Tolnaydecf28d2017-11-11 11:56:45 -08001912pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1913 Macro {
1914 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001915 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001916 tokens: _i . tokens,
1917 }
1918}
David Tolnay14982012017-12-29 00:49:51 -05001919
David Tolnay85b69a42017-12-27 20:43:10 -05001920pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1921 use ::Member::*;
1922 match _i {
1923 Named(_binding_0, ) => {
1924 Named (
1925 _visitor.fold_ident(_binding_0),
1926 )
1927 }
1928 Unnamed(_binding_0, ) => {
1929 Unnamed (
1930 _visitor.fold_index(_binding_0),
1931 )
1932 }
1933 }
1934}
David Tolnaydecf28d2017-11-11 11:56:45 -08001935
Nika Layzella6f46c42017-10-26 15:26:16 -04001936pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001937 use ::MetaItem::*;
1938 match _i {
1939 Term(_binding_0, ) => {
1940 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001941 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001942 )
1943 }
1944 List(_binding_0, ) => {
1945 List (
1946 _visitor.fold_meta_item_list(_binding_0),
1947 )
1948 }
1949 NameValue(_binding_0, ) => {
1950 NameValue (
1951 _visitor.fold_meta_name_value(_binding_0),
1952 )
1953 }
1954 }
1955}
1956
Nika Layzella6f46c42017-10-26 15:26:16 -04001957pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001958 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001959 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001960 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001961 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1962 }
1963}
1964
Nika Layzella6f46c42017-10-26 15:26:16 -04001965pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001966 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001967 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001968 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001969 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001970 }
1971}
1972# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001973pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001974 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001975 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001976 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001977 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001978 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001979 decl: _visitor.fold_fn_decl(_i . decl),
1980 }
1981}
David Tolnayd60cfec2017-12-29 00:21:38 -05001982# [ cfg ( feature = "full" ) ]
1983pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
1984 MethodTurbofish {
1985 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
1986 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
1987 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
1988 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
1989 }
1990}
Nika Layzell27726662017-10-24 23:16:35 -04001991
Nika Layzella6f46c42017-10-26 15:26:16 -04001992pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001993 use ::NestedMetaItem::*;
1994 match _i {
1995 MetaItem(_binding_0, ) => {
1996 MetaItem (
1997 _visitor.fold_meta_item(_binding_0),
1998 )
1999 }
2000 Literal(_binding_0, ) => {
2001 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002002 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002003 )
2004 }
2005 }
2006}
2007
Nika Layzellc08227a2017-12-04 16:30:17 -05002008pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2009 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002010 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002011 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002012 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002013 }
2014}
2015# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002016pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002017 use ::Pat::*;
2018 match _i {
2019 Wild(_binding_0, ) => {
2020 Wild (
2021 _visitor.fold_pat_wild(_binding_0),
2022 )
2023 }
2024 Ident(_binding_0, ) => {
2025 Ident (
2026 _visitor.fold_pat_ident(_binding_0),
2027 )
2028 }
2029 Struct(_binding_0, ) => {
2030 Struct (
2031 _visitor.fold_pat_struct(_binding_0),
2032 )
2033 }
2034 TupleStruct(_binding_0, ) => {
2035 TupleStruct (
2036 _visitor.fold_pat_tuple_struct(_binding_0),
2037 )
2038 }
2039 Path(_binding_0, ) => {
2040 Path (
2041 _visitor.fold_pat_path(_binding_0),
2042 )
2043 }
2044 Tuple(_binding_0, ) => {
2045 Tuple (
2046 _visitor.fold_pat_tuple(_binding_0),
2047 )
2048 }
2049 Box(_binding_0, ) => {
2050 Box (
2051 _visitor.fold_pat_box(_binding_0),
2052 )
2053 }
2054 Ref(_binding_0, ) => {
2055 Ref (
2056 _visitor.fold_pat_ref(_binding_0),
2057 )
2058 }
2059 Lit(_binding_0, ) => {
2060 Lit (
2061 _visitor.fold_pat_lit(_binding_0),
2062 )
2063 }
2064 Range(_binding_0, ) => {
2065 Range (
2066 _visitor.fold_pat_range(_binding_0),
2067 )
2068 }
2069 Slice(_binding_0, ) => {
2070 Slice (
2071 _visitor.fold_pat_slice(_binding_0),
2072 )
2073 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002074 Macro(_binding_0, ) => {
2075 Macro (
2076 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002077 )
2078 }
2079 }
2080}
2081# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002082pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002083 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002084 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002085 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002086 }
2087}
2088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002089pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002090 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002091 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2092 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002093 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002094 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002095 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002096 }
2097}
2098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002099pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002100 PatLit {
2101 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2102 }
2103}
2104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002105pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002106 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002107 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002108 path: _visitor.fold_path(_i . path),
2109 }
2110}
2111# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002112pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002113 PatRange {
2114 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002115 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002116 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002117 }
2118}
2119# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002120pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002121 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002122 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002123 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002124 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002125 }
2126}
2127# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002128pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002129 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002130 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002131 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002132 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002133 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002134 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002135 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002136 }
2137}
2138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002139pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002140 PatStruct {
2141 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002142 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002143 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002144 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
2146}
2147# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002149 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002150 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002151 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002152 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002153 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2154 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002155 }
2156}
2157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002158pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002159 PatTupleStruct {
2160 path: _visitor.fold_path(_i . path),
2161 pat: _visitor.fold_pat_tuple(_i . pat),
2162 }
2163}
2164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002165pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002166 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002167 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002168 }
2169}
2170
Nika Layzella6f46c42017-10-26 15:26:16 -04002171pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002172 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002173 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002174 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2175 }
2176}
Nika Layzellc08227a2017-12-04 16:30:17 -05002177
2178pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2179 use ::PathArguments::*;
2180 match _i {
2181 None => { None }
2182 AngleBracketed(_binding_0, ) => {
2183 AngleBracketed (
2184 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2185 )
2186 }
2187 Parenthesized(_binding_0, ) => {
2188 Parenthesized (
2189 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2190 )
2191 }
2192 }
2193}
Nika Layzell27726662017-10-24 23:16:35 -04002194
Nika Layzella6f46c42017-10-26 15:26:16 -04002195pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002196 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002197 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002198 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002199 }
2200}
Nika Layzell27726662017-10-24 23:16:35 -04002201
Nika Layzella6f46c42017-10-26 15:26:16 -04002202pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002203 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002204 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002205 trait_ref: _visitor.fold_path(_i . trait_ref),
2206 }
2207}
2208
Nika Layzella6f46c42017-10-26 15:26:16 -04002209pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002210 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002211 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002212 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002213 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002214 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2215 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002216 }
2217}
2218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002219pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002220 use ::RangeLimits::*;
2221 match _i {
2222 HalfOpen(_binding_0, ) => {
2223 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002224 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002225 )
2226 }
2227 Closed(_binding_0, ) => {
2228 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002229 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002230 )
2231 }
2232 }
2233}
David Tolnayf93b90d2017-11-11 19:21:26 -08002234
2235pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2236 use ::ReturnType::*;
2237 match _i {
2238 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002239 Type(_binding_0, _binding_1, ) => {
2240 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002241 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2242 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002243 )
2244 }
2245 }
2246}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002247
2248pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2249 _i
2250}
Nika Layzell27726662017-10-24 23:16:35 -04002251# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002252pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002253 use ::Stmt::*;
2254 match _i {
2255 Local(_binding_0, ) => {
2256 Local (
2257 Box::new(_visitor.fold_local(* _binding_0)),
2258 )
2259 }
2260 Item(_binding_0, ) => {
2261 Item (
2262 Box::new(_visitor.fold_item(* _binding_0)),
2263 )
2264 }
2265 Expr(_binding_0, ) => {
2266 Expr (
2267 Box::new(_visitor.fold_expr(* _binding_0)),
2268 )
2269 }
2270 Semi(_binding_0, _binding_1, ) => {
2271 Semi (
2272 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002273 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002274 )
2275 }
Nika Layzell27726662017-10-24 23:16:35 -04002276 }
2277}
2278
Nika Layzella6f46c42017-10-26 15:26:16 -04002279pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002280 use ::TraitBoundModifier::*;
2281 match _i {
2282 None => { None }
2283 Maybe(_binding_0, ) => {
2284 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002285 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002286 )
2287 }
2288 }
2289}
2290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002291pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002292 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002293 match _i {
2294 Const(_binding_0, ) => {
2295 Const (
2296 _visitor.fold_trait_item_const(_binding_0),
2297 )
2298 }
2299 Method(_binding_0, ) => {
2300 Method (
2301 _visitor.fold_trait_item_method(_binding_0),
2302 )
2303 }
2304 Type(_binding_0, ) => {
2305 Type (
2306 _visitor.fold_trait_item_type(_binding_0),
2307 )
2308 }
2309 Macro(_binding_0, ) => {
2310 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002311 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002312 )
2313 }
2314 }
2315}
2316# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002317pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2318 TraitItemConst {
2319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002320 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002321 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002322 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002323 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002324 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002326 _visitor.fold_expr(( it ) . 1),
2327 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002328 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002329 }
2330}
2331# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002332pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2333 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002334 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002335 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002336 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002337 }
2338}
2339# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002340pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002341 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002342 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002343 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002344 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002345 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002346 }
2347}
2348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002349pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002350 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002351 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002352 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002353 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002354 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002355 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002356 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002357 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002358 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002359 _visitor.fold_type(( it ) . 1),
2360 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002361 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002362 }
2363}
2364
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002365pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2366 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002367 match _i {
2368 Slice(_binding_0, ) => {
2369 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002370 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002371 )
2372 }
2373 Array(_binding_0, ) => {
2374 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002375 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002376 )
2377 }
2378 Ptr(_binding_0, ) => {
2379 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002380 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002381 )
2382 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002383 Reference(_binding_0, ) => {
2384 Reference (
2385 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002386 )
2387 }
2388 BareFn(_binding_0, ) => {
2389 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002390 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002391 )
2392 }
2393 Never(_binding_0, ) => {
2394 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002395 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002396 )
2397 }
David Tolnay05362582017-12-26 01:33:57 -05002398 Tuple(_binding_0, ) => {
2399 Tuple (
2400 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002401 )
2402 }
2403 Path(_binding_0, ) => {
2404 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002405 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002406 )
2407 }
2408 TraitObject(_binding_0, ) => {
2409 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002410 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002411 )
2412 }
2413 ImplTrait(_binding_0, ) => {
2414 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002416 )
2417 }
2418 Paren(_binding_0, ) => {
2419 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002420 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002421 )
2422 }
2423 Group(_binding_0, ) => {
2424 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002426 )
2427 }
2428 Infer(_binding_0, ) => {
2429 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002430 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002431 )
2432 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002433 Macro(_binding_0, ) => {
2434 Macro (
2435 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
2438 }
2439}
2440
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002441pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2442 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002443 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002444 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002445 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002446 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002447 }
2448}
2449
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002450pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2451 TypeBareFn {
2452 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002453 }
2454}
2455
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002456pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2457 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002458 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002459 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002460 ty: _visitor.fold_type(_i . ty),
2461 }
2462}
2463
2464pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2465 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002466 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002467 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002468 }
2469}
2470
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2472 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002473 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002474 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002475 }
2476}
2477
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002478pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2479 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002480 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002481 }
2482}
2483
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002484pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2485 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002486 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002487 }
2488}
2489
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2491 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002492 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002493 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002494 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002495 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002496 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002497 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002498 }
2499}
2500
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002501pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2502 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002503 match _i {
2504 Trait(_binding_0, _binding_1, ) => {
2505 Trait (
2506 _visitor.fold_poly_trait_ref(_binding_0),
2507 _visitor.fold_trait_bound_modifier(_binding_1),
2508 )
2509 }
2510 Region(_binding_0, ) => {
2511 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002512 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002513 )
2514 }
2515 }
2516}
2517
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2519 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002520 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002521 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002522 }
2523}
2524
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002525pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2526 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002527 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002528 path: _visitor.fold_path(_i . path),
2529 }
2530}
2531
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002532pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2533 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002534 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2535 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002536 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2537 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002538 }
2539}
2540
David Tolnay0a89b4d2017-11-13 00:55:45 -08002541pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2542 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002543 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002544 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002545 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2546 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002547 }
2548}
2549
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2551 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002552 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002553 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2558 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002559 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002560 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002561 }
2562}
2563
David Tolnay05362582017-12-26 01:33:57 -05002564pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2565 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002566 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002567 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570
Nika Layzella6f46c42017-10-26 15:26:16 -04002571pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002572 use ::UnOp::*;
2573 match _i {
2574 Deref(_binding_0, ) => {
2575 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002576 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002577 )
2578 }
2579 Not(_binding_0, ) => {
2580 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002581 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002582 )
2583 }
2584 Neg(_binding_0, ) => {
2585 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002586 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002587 )
2588 }
2589 }
2590}
David Tolnay5f332a92017-12-26 00:42:45 -05002591# [ cfg ( feature = "full" ) ]
2592pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2593 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002594 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002595 }
2596}
2597# [ cfg ( feature = "full" ) ]
2598pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2599 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002600 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002601 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2602 }
2603}
2604# [ cfg ( feature = "full" ) ]
2605pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2606 UsePath {
2607 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002608 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002609 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002610 _visitor.fold_ident(( it ) . 1),
2611 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002612 }
2613}
2614# [ cfg ( feature = "full" ) ]
2615pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2616 use ::UseTree::*;
2617 match _i {
2618 Path(_binding_0, ) => {
2619 Path (
2620 _visitor.fold_use_path(_binding_0),
2621 )
2622 }
2623 Glob(_binding_0, ) => {
2624 Glob (
2625 _visitor.fold_use_glob(_binding_0),
2626 )
2627 }
2628 List(_binding_0, ) => {
2629 List (
2630 _visitor.fold_use_list(_binding_0),
2631 )
2632 }
2633 }
2634}
Nika Layzell27726662017-10-24 23:16:35 -04002635
Nika Layzella6f46c42017-10-26 15:26:16 -04002636pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002637 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002638 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002639 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002640 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002641 discriminant: (_i . discriminant).map(|it| { (
2642 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2643 _visitor.fold_expr(( it ) . 1),
2644 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002645 }
2646}
2647
Nika Layzella6f46c42017-10-26 15:26:16 -04002648pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002649 use ::VariantData::*;
2650 match _i {
2651 Struct(_binding_0, _binding_1, ) => {
2652 Struct (
2653 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002654 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002655 )
2656 }
2657 Tuple(_binding_0, _binding_1, ) => {
2658 Tuple (
2659 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002660 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002661 )
2662 }
2663 Unit => { Unit }
2664 }
2665}
Nika Layzell27726662017-10-24 23:16:35 -04002666
Nika Layzella6f46c42017-10-26 15:26:16 -04002667pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002668 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002669 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002670 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002671 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002672 }
2673}
2674
Nika Layzella6f46c42017-10-26 15:26:16 -04002675pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002676 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002677 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002678 }
2679}
2680
Nika Layzella6f46c42017-10-26 15:26:16 -04002681pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002682 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002683 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002684 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002685 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002686 path: Box::new(_visitor.fold_path(* _i . path)),
2687 }
2688}
2689
Nika Layzella6f46c42017-10-26 15:26:16 -04002690pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002691 use ::Visibility::*;
2692 match _i {
2693 Public(_binding_0, ) => {
2694 Public (
2695 _visitor.fold_vis_public(_binding_0),
2696 )
2697 }
2698 Crate(_binding_0, ) => {
2699 Crate (
2700 _visitor.fold_vis_crate(_binding_0),
2701 )
2702 }
2703 Restricted(_binding_0, ) => {
2704 Restricted (
2705 _visitor.fold_vis_restricted(_binding_0),
2706 )
2707 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002708 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002709 }
2710}
2711
Nika Layzella6f46c42017-10-26 15:26:16 -04002712pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002713 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002714 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002715 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002716 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002717 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002718 }
2719}
2720
Nika Layzella6f46c42017-10-26 15:26:16 -04002721pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002722 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002723 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002724 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2725 }
2726}
2727
Nika Layzella6f46c42017-10-26 15:26:16 -04002728pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002729 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002730 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002731 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002732 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002733 }
2734}
2735
Nika Layzella6f46c42017-10-26 15:26:16 -04002736pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002737 use ::WherePredicate::*;
2738 match _i {
2739 BoundPredicate(_binding_0, ) => {
2740 BoundPredicate (
2741 _visitor.fold_where_bound_predicate(_binding_0),
2742 )
2743 }
2744 RegionPredicate(_binding_0, ) => {
2745 RegionPredicate (
2746 _visitor.fold_where_region_predicate(_binding_0),
2747 )
2748 }
2749 EqPredicate(_binding_0, ) => {
2750 EqPredicate (
2751 _visitor.fold_where_eq_predicate(_binding_0),
2752 )
2753 }
2754 }
2755}
2756
Nika Layzella6f46c42017-10-26 15:26:16 -04002757pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002758 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002759 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002760 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002761 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002762 }
2763}
2764