blob: cf93016e871390a1be62580ec2af8ba460a22090 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046
Nika Layzellc08227a2017-12-04 16:30:17 -050047fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
David Tolnayfd6bf5c2017-11-12 09:41:14 -080065fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050078
79fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500129fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500143fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500149fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500155fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800180# [ cfg ( feature = "full" ) ]
181fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182
Nika Layzellc08227a2017-12-04 16:30:17 -0500183fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500184# [ cfg ( feature = "full" ) ]
185fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500186
David Tolnayc2f1aba2017-11-12 20:29:22 -0800187fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
188
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500190
191fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800197fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500202
David Tolnay85b69a42017-12-27 20:43:10 -0500203fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800221fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800223fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800233fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238
David Tolnay4ba63a02017-12-28 15:53:05 -0500239fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
240
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500242
243fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246
David Tolnaydecf28d2017-11-11 11:56:45 -0800247fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500248
David Tolnay85b69a42017-12-27 20:43:10 -0500249fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500258# [ cfg ( feature = "full" ) ]
259fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800261fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzellc08227a2017-12-04 16:30:17 -0500265fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500292
293fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800302
303fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500304
305fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800315fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800321fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800323fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800325fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
330
331fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
332
333fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
334
335fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
336
337fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
338
339fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
340
341fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
342
343fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
344
345fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
346
David Tolnay0a89b4d2017-11-13 00:55:45 -0800347fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800348
349fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
350
351fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
352
David Tolnay05362582017-12-26 01:33:57 -0500353fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800354
Nika Layzella6f46c42017-10-26 15:26:16 -0400355fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500356# [ cfg ( feature = "full" ) ]
357fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
358# [ cfg ( feature = "full" ) ]
359fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
360# [ cfg ( feature = "full" ) ]
361fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
362# [ cfg ( feature = "full" ) ]
363fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
387}
388
David Tolnayd0adf522017-12-29 01:30:07 -0500389pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
390 _i.span = _visitor.fold_span(_i.span);
391 _i
392}
393
394pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
395 _i.span = _visitor.fold_span(_i.span);
396 _i
397}
398
Nika Layzell27726662017-10-24 23:16:35 -0400399
Nika Layzella6f46c42017-10-26 15:26:16 -0400400pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400401 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500402 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400403 kind: _visitor.fold_abi_kind(_i . kind),
404 }
405}
406
Nika Layzella6f46c42017-10-26 15:26:16 -0400407pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400408 use ::AbiKind::*;
409 match _i {
410 Named(_binding_0, ) => {
411 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500412 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400413 )
414 }
415 Default => { Default }
416 }
417}
418
Nika Layzellc08227a2017-12-04 16:30:17 -0500419pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
420 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500421 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500422 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500423 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400425 }
426}
427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400428pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400429 ArgCaptured {
430 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500431 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800432 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500438 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400440 }
441}
442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400443pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400444 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500446 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500447 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500448 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400449 }
450}
451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400452pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400453 Arm {
454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
455 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400457 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400465 use ::AttrStyle::*;
466 match _i {
467 Outer => { Outer }
468 Inner(_binding_0, ) => {
469 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 )
472 }
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400477 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500480 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 path: _visitor.fold_path(_i . path),
482 tts: _i . tts,
483 is_sugared_doc: _i . is_sugared_doc,
484 }
485}
486
Nika Layzella6f46c42017-10-26 15:26:16 -0400487pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400488 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500489 name: (_i . name).map(|it| { (
490 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800493 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400498 use ::BareFnArgName::*;
499 match _i {
500 Named(_binding_0, ) => {
501 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500502 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 Wild(_binding_0, ) => {
506 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
512
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800513pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
514 BareFnType {
David Tolnay9b258702017-12-29 02:24:41 -0500515 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400516 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500518 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500519 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800522 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400523 }
524}
525
Nika Layzella6f46c42017-10-26 15:26:16 -0400526pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400527 use ::BinOp::*;
528 match _i {
529 Add(_binding_0, ) => {
530 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400532 )
533 }
534 Sub(_binding_0, ) => {
535 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500536 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400537 )
538 }
539 Mul(_binding_0, ) => {
540 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 Div(_binding_0, ) => {
545 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500546 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400547 )
548 }
549 Rem(_binding_0, ) => {
550 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
554 And(_binding_0, ) => {
555 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
559 Or(_binding_0, ) => {
560 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
564 BitXor(_binding_0, ) => {
565 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
569 BitAnd(_binding_0, ) => {
570 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
574 BitOr(_binding_0, ) => {
575 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
579 Shl(_binding_0, ) => {
580 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
584 Shr(_binding_0, ) => {
585 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
589 Eq(_binding_0, ) => {
590 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
594 Lt(_binding_0, ) => {
595 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
599 Le(_binding_0, ) => {
600 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
604 Ne(_binding_0, ) => {
605 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
609 Ge(_binding_0, ) => {
610 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
614 Gt(_binding_0, ) => {
615 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
619 AddEq(_binding_0, ) => {
620 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
624 SubEq(_binding_0, ) => {
625 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
629 MulEq(_binding_0, ) => {
630 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
634 DivEq(_binding_0, ) => {
635 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
639 RemEq(_binding_0, ) => {
640 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
644 BitXorEq(_binding_0, ) => {
645 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
649 BitAndEq(_binding_0, ) => {
650 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
654 BitOrEq(_binding_0, ) => {
655 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500656 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400657 )
658 }
659 ShlEq(_binding_0, ) => {
660 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500661 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 )
663 }
664 ShrEq(_binding_0, ) => {
665 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400667 )
668 }
669 }
670}
671# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400672pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400673 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500674 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400675 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
676 }
677}
678
Nika Layzella6f46c42017-10-26 15:26:16 -0400679pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400680 use ::Body::*;
681 match _i {
682 Enum(_binding_0, ) => {
683 Enum (
684 _visitor.fold_body_enum(_binding_0),
685 )
686 }
687 Struct(_binding_0, ) => {
688 Struct (
689 _visitor.fold_body_struct(_binding_0),
690 )
691 }
692 }
693}
694
Nika Layzella6f46c42017-10-26 15:26:16 -0400695pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400696 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500697 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500698 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400699 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
700 }
701}
702
Nika Layzella6f46c42017-10-26 15:26:16 -0400703pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400704 BodyStruct {
705 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500706 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
707 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400708 }
709}
710
Nika Layzella6f46c42017-10-26 15:26:16 -0400711pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400712 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500713 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
714 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400715 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 }
718}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500719
720pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
721 ConstParam {
722 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500724 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500725 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500726 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500728 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
729 }
730}
Nika Layzell27726662017-10-24 23:16:35 -0400731
Nika Layzella6f46c42017-10-26 15:26:16 -0400732pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400733 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400734 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500735 vis: _visitor.fold_visibility(_i . vis),
736 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400737 generics: _visitor.fold_generics(_i . generics),
738 body: _visitor.fold_body(_i . body),
739 }
740}
741
Nika Layzella6f46c42017-10-26 15:26:16 -0400742pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500743 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400744 match _i {
745 Box(_binding_0, ) => {
746 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400747 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400748 )
749 }
750 InPlace(_binding_0, ) => {
751 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400752 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400753 )
754 }
755 Array(_binding_0, ) => {
756 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400757 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400758 )
759 }
760 Call(_binding_0, ) => {
761 Call (
762 _visitor.fold_expr_call(_binding_0),
763 )
764 }
765 MethodCall(_binding_0, ) => {
766 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400767 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400768 )
769 }
David Tolnay05362582017-12-26 01:33:57 -0500770 Tuple(_binding_0, ) => {
771 Tuple (
772 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400773 )
774 }
775 Binary(_binding_0, ) => {
776 Binary (
777 _visitor.fold_expr_binary(_binding_0),
778 )
779 }
780 Unary(_binding_0, ) => {
781 Unary (
782 _visitor.fold_expr_unary(_binding_0),
783 )
784 }
785 Lit(_binding_0, ) => {
786 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500787 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400788 )
789 }
790 Cast(_binding_0, ) => {
791 Cast (
792 _visitor.fold_expr_cast(_binding_0),
793 )
794 }
795 Type(_binding_0, ) => {
796 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500797 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400798 )
799 }
800 If(_binding_0, ) => {
801 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400802 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400803 )
804 }
805 IfLet(_binding_0, ) => {
806 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400807 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400808 )
809 }
810 While(_binding_0, ) => {
811 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400812 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400813 )
814 }
815 WhileLet(_binding_0, ) => {
816 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400817 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400818 )
819 }
820 ForLoop(_binding_0, ) => {
821 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400822 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400823 )
824 }
825 Loop(_binding_0, ) => {
826 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400827 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400828 )
829 }
830 Match(_binding_0, ) => {
831 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400832 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400833 )
834 }
835 Closure(_binding_0, ) => {
836 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400837 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400838 )
839 }
Nika Layzell640832a2017-12-04 13:37:09 -0500840 Unsafe(_binding_0, ) => {
841 Unsafe (
842 full!(_visitor.fold_expr_unsafe(_binding_0)),
843 )
844 }
Nika Layzell27726662017-10-24 23:16:35 -0400845 Block(_binding_0, ) => {
846 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400847 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400848 )
849 }
850 Assign(_binding_0, ) => {
851 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400852 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400853 )
854 }
855 AssignOp(_binding_0, ) => {
856 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400857 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400858 )
859 }
860 Field(_binding_0, ) => {
861 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400862 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400863 )
864 }
Nika Layzell27726662017-10-24 23:16:35 -0400865 Index(_binding_0, ) => {
866 Index (
867 _visitor.fold_expr_index(_binding_0),
868 )
869 }
870 Range(_binding_0, ) => {
871 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400872 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400873 )
874 }
875 Path(_binding_0, ) => {
876 Path (
877 _visitor.fold_expr_path(_binding_0),
878 )
879 }
880 AddrOf(_binding_0, ) => {
881 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400882 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400883 )
884 }
885 Break(_binding_0, ) => {
886 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400887 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400888 )
889 }
890 Continue(_binding_0, ) => {
891 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400892 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400893 )
894 }
David Tolnayc246cd32017-12-28 23:14:32 -0500895 Return(_binding_0, ) => {
896 Return (
897 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400898 )
899 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800900 Macro(_binding_0, ) => {
901 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500902 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400903 )
904 }
905 Struct(_binding_0, ) => {
906 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400907 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400908 )
909 }
910 Repeat(_binding_0, ) => {
911 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400912 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400913 )
914 }
915 Paren(_binding_0, ) => {
916 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500917 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400918 )
919 }
920 Group(_binding_0, ) => {
921 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500922 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400923 )
924 }
925 Try(_binding_0, ) => {
926 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400927 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400928 )
929 }
930 Catch(_binding_0, ) => {
931 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400932 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400933 )
934 }
935 Yield(_binding_0, ) => {
936 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400937 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400938 )
939 }
940 }
941}
942# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500943pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
944 ExprAddrOf {
945 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
946 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500947 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500948 expr: Box::new(_visitor.fold_expr(* _i . expr)),
949 }
950}
951# [ cfg ( feature = "full" ) ]
952pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
953 ExprArray {
954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
955 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500956 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500957 }
958}
959# [ cfg ( feature = "full" ) ]
960pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
961 ExprAssign {
962 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
963 left: Box::new(_visitor.fold_expr(* _i . left)),
964 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
965 right: Box::new(_visitor.fold_expr(* _i . right)),
966 }
967}
968# [ cfg ( feature = "full" ) ]
969pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
970 ExprAssignOp {
971 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
972 left: Box::new(_visitor.fold_expr(* _i . left)),
973 op: _visitor.fold_bin_op(_i . op),
974 right: Box::new(_visitor.fold_expr(* _i . right)),
975 }
976}
977
978pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
979 ExprBinary {
980 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
981 left: Box::new(_visitor.fold_expr(* _i . left)),
982 op: _visitor.fold_bin_op(_i . op),
983 right: Box::new(_visitor.fold_expr(* _i . right)),
984 }
985}
986# [ cfg ( feature = "full" ) ]
987pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
988 ExprBlock {
989 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
990 block: _visitor.fold_block(_i . block),
991 }
992}
993# [ cfg ( feature = "full" ) ]
994pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
995 ExprBox {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
998 expr: Box::new(_visitor.fold_expr(* _i . expr)),
999 }
1000}
1001# [ cfg ( feature = "full" ) ]
1002pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1003 ExprBreak {
1004 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1005 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1006 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1007 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1008 }
1009}
1010
1011pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1012 ExprCall {
1013 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1014 func: Box::new(_visitor.fold_expr(* _i . func)),
1015 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1016 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1017 }
1018}
1019
1020pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1021 ExprCast {
1022 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1023 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1024 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1025 ty: Box::new(_visitor.fold_type(* _i . ty)),
1026 }
1027}
1028# [ cfg ( feature = "full" ) ]
1029pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1030 ExprCatch {
1031 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1032 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1033 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1034 block: _visitor.fold_block(_i . block),
1035 }
1036}
1037# [ cfg ( feature = "full" ) ]
1038pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1039 ExprClosure {
1040 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001041 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001042 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1043 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1044 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1045 output: _visitor.fold_return_type(_i . output),
1046 body: Box::new(_visitor.fold_expr(* _i . body)),
1047 }
1048}
1049# [ cfg ( feature = "full" ) ]
1050pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1051 ExprContinue {
1052 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1053 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1054 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1055 }
1056}
1057# [ cfg ( feature = "full" ) ]
1058pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1059 ExprField {
1060 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1061 base: Box::new(_visitor.fold_expr(* _i . base)),
1062 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1063 member: _visitor.fold_member(_i . member),
1064 }
1065}
1066# [ cfg ( feature = "full" ) ]
1067pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1068 ExprForLoop {
1069 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1070 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1071 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1072 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1073 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1074 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1075 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1076 body: _visitor.fold_block(_i . body),
1077 }
1078}
David Tolnaye98775f2017-12-28 23:17:00 -05001079# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001080pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1081 ExprGroup {
1082 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1083 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1084 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1085 }
1086}
1087# [ cfg ( feature = "full" ) ]
1088pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1089 ExprIf {
1090 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1091 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1092 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001093 then_branch: _visitor.fold_block(_i . then_branch),
1094 else_branch: (_i . else_branch).map(|it| { (
1095 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1096 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1097 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001098 }
1099}
1100# [ cfg ( feature = "full" ) ]
1101pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1102 ExprIfLet {
1103 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1104 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1105 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1106 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1107 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1108 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001109 then_branch: _visitor.fold_block(_i . then_branch),
1110 else_branch: (_i . else_branch).map(|it| { (
1111 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1112 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1113 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001114 }
1115}
1116# [ cfg ( feature = "full" ) ]
1117pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1118 ExprInPlace {
1119 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1120 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001121 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001122 value: Box::new(_visitor.fold_expr(* _i . value)),
1123 }
1124}
1125
1126pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1127 ExprIndex {
1128 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1129 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1130 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1131 index: Box::new(_visitor.fold_expr(* _i . index)),
1132 }
1133}
1134
1135pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1136 ExprLit {
1137 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1138 lit: _visitor.fold_lit(_i . lit),
1139 }
1140}
1141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001142pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001143 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001144 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001145 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001146 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001147 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1148 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001149 }
1150}
1151# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001152pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1153 ExprMacro {
1154 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1155 mac: _visitor.fold_macro(_i . mac),
1156 }
1157}
1158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001159pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001160 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001161 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001162 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001163 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001164 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001165 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1166 }
1167}
1168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001169pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001170 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001171 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001172 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001173 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001174 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001175 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001176 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1177 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001178 }
1179}
David Tolnaye98775f2017-12-28 23:17:00 -05001180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001181pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001182 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001183 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001184 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001185 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
1187}
1188
Nika Layzella6f46c42017-10-26 15:26:16 -04001189pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001190 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001191 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001192 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001193 path: _visitor.fold_path(_i . path),
1194 }
1195}
1196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001197pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001198 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001199 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001200 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001202 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001203 }
1204}
1205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001206pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001207 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001208 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001209 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001210 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001211 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001212 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1213 }
1214}
1215# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001216pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1217 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001218 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001219 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001220 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001221 }
1222}
1223# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001224pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001225 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001226 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001227 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001228 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001229 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1230 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1231 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001232 }
1233}
1234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001235pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001236 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001237 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001238 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001239 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
1242# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001243pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1244 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001246 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001247 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001248 }
1249}
David Tolnay0cf94f22017-12-28 23:46:26 -05001250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001254 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001255 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001256 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001257 }
1258}
1259
Nika Layzella6f46c42017-10-26 15:26:16 -04001260pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001261 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001262 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001263 op: _visitor.fold_un_op(_i . op),
1264 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1265 }
1266}
1267# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001268pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1269 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001270 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001271 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001272 block: _visitor.fold_block(_i . block),
1273 }
1274}
1275# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001276pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001277 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001278 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001279 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001280 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1281 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001282 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1283 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
1285}
1286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001287pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001288 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001289 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001290 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001291 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1292 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1293 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001294 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001295 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001296 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1297 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001298 }
1299}
1300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001301pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001302 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001303 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001304 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001305 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001306 }
1307}
1308
Nika Layzella6f46c42017-10-26 15:26:16 -04001309pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001310 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001311 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001312 vis: _visitor.fold_visibility(_i . vis),
1313 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001314 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001315 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001316 }
1317}
1318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001319pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001320 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001321 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001322 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001323 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001324 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001325 }
1326}
1327# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001328pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001329 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001330 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1331 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001332 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001333 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001334 }
1335}
1336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001337pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001338 File {
1339 shebang: _i . shebang,
1340 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1341 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1342 }
1343}
1344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001345pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001346 use ::FnArg::*;
1347 match _i {
1348 SelfRef(_binding_0, ) => {
1349 SelfRef (
1350 _visitor.fold_arg_self_ref(_binding_0),
1351 )
1352 }
1353 SelfValue(_binding_0, ) => {
1354 SelfValue (
1355 _visitor.fold_arg_self(_binding_0),
1356 )
1357 }
1358 Captured(_binding_0, ) => {
1359 Captured (
1360 _visitor.fold_arg_captured(_binding_0),
1361 )
1362 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001363 Inferred(_binding_0, ) => {
1364 Inferred (
1365 _visitor.fold_pat(_binding_0),
1366 )
1367 }
Nika Layzell27726662017-10-24 23:16:35 -04001368 Ignored(_binding_0, ) => {
1369 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001370 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001371 )
1372 }
1373 }
1374}
1375# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001376pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001377 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001378 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001379 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001380 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001381 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001382 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001383 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001384 }
1385}
1386# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001387pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001388 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001389 match _i {
1390 Fn(_binding_0, ) => {
1391 Fn (
1392 _visitor.fold_foreign_item_fn(_binding_0),
1393 )
1394 }
1395 Static(_binding_0, ) => {
1396 Static (
1397 _visitor.fold_foreign_item_static(_binding_0),
1398 )
1399 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001400 Type(_binding_0, ) => {
1401 Type (
1402 _visitor.fold_foreign_item_type(_binding_0),
1403 )
1404 }
Nika Layzell27726662017-10-24 23:16:35 -04001405 }
1406}
1407# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001408pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1409 ForeignItemFn {
1410 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1411 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001412 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001413 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001414 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001415 }
1416}
1417# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001418pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001419 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001420 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1421 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001422 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001423 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001424 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001425 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001426 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001427 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001428 }
1429}
David Tolnay199bcbb2017-11-12 10:33:52 -08001430# [ cfg ( feature = "full" ) ]
1431pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1432 ForeignItemType {
1433 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1434 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001435 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001436 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001438 }
1439}
Nika Layzell27726662017-10-24 23:16:35 -04001440
Nika Layzellc08227a2017-12-04 16:30:17 -05001441pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1442 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001443 match _i {
1444 Lifetime(_binding_0, ) => {
1445 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001446 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001447 )
1448 }
1449 Type(_binding_0, ) => {
1450 Type (
1451 _visitor.fold_type(_binding_0),
1452 )
1453 }
1454 TypeBinding(_binding_0, ) => {
1455 TypeBinding (
1456 _visitor.fold_type_binding(_binding_0),
1457 )
1458 }
Nika Layzellc680e612017-12-04 19:07:20 -05001459 Const(_binding_0, ) => {
1460 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001461 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001462 )
1463 }
Nika Layzell357885a2017-12-04 15:47:07 -05001464 }
1465}
David Tolnayd60cfec2017-12-29 00:21:38 -05001466# [ cfg ( feature = "full" ) ]
1467pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1468 use ::GenericMethodArgument::*;
1469 match _i {
1470 Type(_binding_0, ) => {
1471 Type (
1472 _visitor.fold_type(_binding_0),
1473 )
1474 }
1475 Const(_binding_0, ) => {
1476 Const (
1477 _visitor.fold_expr(_binding_0),
1478 )
1479 }
1480 }
1481}
Nika Layzell357885a2017-12-04 15:47:07 -05001482
David Tolnayc2f1aba2017-11-12 20:29:22 -08001483pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1484 use ::GenericParam::*;
1485 match _i {
1486 Lifetime(_binding_0, ) => {
1487 Lifetime (
1488 _visitor.fold_lifetime_def(_binding_0),
1489 )
1490 }
1491 Type(_binding_0, ) => {
1492 Type (
1493 _visitor.fold_type_param(_binding_0),
1494 )
1495 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001496 Const(_binding_0, ) => {
1497 Const (
1498 _visitor.fold_const_param(_binding_0),
1499 )
1500 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001501 }
1502}
1503
Nika Layzella6f46c42017-10-26 15:26:16 -04001504pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001505 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001506 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001507 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001508 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001509 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001510 }
1511}
1512# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001513pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001514 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001515 match _i {
1516 Const(_binding_0, ) => {
1517 Const (
1518 _visitor.fold_impl_item_const(_binding_0),
1519 )
1520 }
1521 Method(_binding_0, ) => {
1522 Method (
1523 _visitor.fold_impl_item_method(_binding_0),
1524 )
1525 }
1526 Type(_binding_0, ) => {
1527 Type (
1528 _visitor.fold_impl_item_type(_binding_0),
1529 )
1530 }
1531 Macro(_binding_0, ) => {
1532 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001533 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001534 )
1535 }
1536 }
1537}
1538# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001539pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1540 ImplItemConst {
1541 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1542 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001543 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001544 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001545 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001547 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001548 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001549 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001550 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001551 }
1552}
1553# [ cfg ( feature = "full" ) ]
1554pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1555 ImplItemMacro {
1556 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1557 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001558 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001559 }
1560}
1561# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001562pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001563 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001564 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001565 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001566 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001567 sig: _visitor.fold_method_sig(_i . sig),
1568 block: _visitor.fold_block(_i . block),
1569 }
1570}
1571# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001572pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001573 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001574 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001575 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001576 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001577 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001578 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001579 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001581 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001582 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001583 }
1584}
David Tolnay14982012017-12-29 00:49:51 -05001585
David Tolnay85b69a42017-12-27 20:43:10 -05001586pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1587 Index {
1588 index: _i . index,
1589 span: _visitor.fold_span(_i . span),
1590 }
1591}
1592# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001593pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001594 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001595 match _i {
1596 ExternCrate(_binding_0, ) => {
1597 ExternCrate (
1598 _visitor.fold_item_extern_crate(_binding_0),
1599 )
1600 }
1601 Use(_binding_0, ) => {
1602 Use (
1603 _visitor.fold_item_use(_binding_0),
1604 )
1605 }
1606 Static(_binding_0, ) => {
1607 Static (
1608 _visitor.fold_item_static(_binding_0),
1609 )
1610 }
1611 Const(_binding_0, ) => {
1612 Const (
1613 _visitor.fold_item_const(_binding_0),
1614 )
1615 }
1616 Fn(_binding_0, ) => {
1617 Fn (
1618 _visitor.fold_item_fn(_binding_0),
1619 )
1620 }
1621 Mod(_binding_0, ) => {
1622 Mod (
1623 _visitor.fold_item_mod(_binding_0),
1624 )
1625 }
1626 ForeignMod(_binding_0, ) => {
1627 ForeignMod (
1628 _visitor.fold_item_foreign_mod(_binding_0),
1629 )
1630 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001631 Type(_binding_0, ) => {
1632 Type (
1633 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001634 )
1635 }
1636 Enum(_binding_0, ) => {
1637 Enum (
1638 _visitor.fold_item_enum(_binding_0),
1639 )
1640 }
1641 Struct(_binding_0, ) => {
1642 Struct (
1643 _visitor.fold_item_struct(_binding_0),
1644 )
1645 }
1646 Union(_binding_0, ) => {
1647 Union (
1648 _visitor.fold_item_union(_binding_0),
1649 )
1650 }
1651 Trait(_binding_0, ) => {
1652 Trait (
1653 _visitor.fold_item_trait(_binding_0),
1654 )
1655 }
1656 DefaultImpl(_binding_0, ) => {
1657 DefaultImpl (
1658 _visitor.fold_item_default_impl(_binding_0),
1659 )
1660 }
1661 Impl(_binding_0, ) => {
1662 Impl (
1663 _visitor.fold_item_impl(_binding_0),
1664 )
1665 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001666 Macro(_binding_0, ) => {
1667 Macro (
1668 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001669 )
1670 }
David Tolnay500d8322017-12-18 00:32:51 -08001671 Macro2(_binding_0, ) => {
1672 Macro2 (
1673 _visitor.fold_item_macro2(_binding_0),
1674 )
1675 }
Nika Layzell27726662017-10-24 23:16:35 -04001676 }
1677}
1678# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001679pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1680 ItemConst {
1681 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1682 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001683 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001684 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001685 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001686 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001687 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001688 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001689 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001690 }
1691}
1692# [ cfg ( feature = "full" ) ]
1693pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1694 ItemDefaultImpl {
1695 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001696 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001697 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001698 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001699 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1700 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001701 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001702 }
1703}
1704# [ cfg ( feature = "full" ) ]
1705pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1706 ItemEnum {
1707 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1708 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001709 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001710 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001711 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001712 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001713 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1714 }
1715}
1716# [ cfg ( feature = "full" ) ]
1717pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1718 ItemExternCrate {
1719 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1720 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001721 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1722 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001723 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001724 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001725 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001726 _visitor.fold_ident(( it ) . 1),
1727 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001728 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001729 }
1730}
1731# [ cfg ( feature = "full" ) ]
1732pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1733 ItemFn {
1734 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1735 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001736 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001737 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001738 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001739 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001740 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001741 block: Box::new(_visitor.fold_block(* _i . block)),
1742 }
1743}
1744# [ cfg ( feature = "full" ) ]
1745pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1746 ItemForeignMod {
1747 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1748 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001749 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001750 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1751 }
1752}
1753# [ cfg ( feature = "full" ) ]
1754pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1755 ItemImpl {
1756 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001757 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001758 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001759 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001760 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001761 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001762 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001763 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001764 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001765 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001766 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001767 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001768 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1769 }
1770}
1771# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001772pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1773 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001774 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001775 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001776 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001777 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001778 }
1779}
1780# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001781pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1782 ItemMacro2 {
1783 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1784 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001785 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001786 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001787 args: _i . args,
1788 body: _i . body,
1789 }
1790}
1791# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001792pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001793 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001795 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001796 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001797 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001798 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001799 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001800 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1801 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001802 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001803 }
1804}
1805# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001806pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001807 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001809 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001811 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001812 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001813 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001814 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001815 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001816 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001817 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001818 }
1819}
1820# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001821pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001822 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001823 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001824 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001825 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001826 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001827 generics: _visitor.fold_generics(_i . generics),
1828 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001829 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001830 }
1831}
1832# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001833pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001834 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001836 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001837 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1839 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001840 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001841 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001843 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001844 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001845 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1846 }
1847}
1848# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001849pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1850 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001851 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001852 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001853 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001854 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001855 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001857 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001858 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001859 }
1860}
1861# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001862pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001863 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001864 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001865 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001866 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001867 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001868 generics: _visitor.fold_generics(_i . generics),
1869 data: _visitor.fold_variant_data(_i . data),
1870 }
1871}
1872# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001873pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001874 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001875 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001876 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001877 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1878 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001879 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1880 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001881 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001882 }
1883}
1884
Nika Layzella6f46c42017-10-26 15:26:16 -04001885pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001886 LifetimeDef {
1887 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001888 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001890 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1891 }
1892}
1893
1894pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1895 Lit {
1896 value: _i . value,
1897 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001898 }
1899}
1900# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001901pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001902 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001903 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001904 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1905 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1906 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1907 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1908 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1909 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1910 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001911 }
1912}
Nika Layzell27726662017-10-24 23:16:35 -04001913
David Tolnaydecf28d2017-11-11 11:56:45 -08001914pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1915 Macro {
1916 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001917 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001918 tokens: _i . tokens,
1919 }
1920}
David Tolnay14982012017-12-29 00:49:51 -05001921
David Tolnay85b69a42017-12-27 20:43:10 -05001922pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1923 use ::Member::*;
1924 match _i {
1925 Named(_binding_0, ) => {
1926 Named (
1927 _visitor.fold_ident(_binding_0),
1928 )
1929 }
1930 Unnamed(_binding_0, ) => {
1931 Unnamed (
1932 _visitor.fold_index(_binding_0),
1933 )
1934 }
1935 }
1936}
David Tolnaydecf28d2017-11-11 11:56:45 -08001937
Nika Layzella6f46c42017-10-26 15:26:16 -04001938pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001939 use ::MetaItem::*;
1940 match _i {
1941 Term(_binding_0, ) => {
1942 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001943 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001944 )
1945 }
1946 List(_binding_0, ) => {
1947 List (
1948 _visitor.fold_meta_item_list(_binding_0),
1949 )
1950 }
1951 NameValue(_binding_0, ) => {
1952 NameValue (
1953 _visitor.fold_meta_name_value(_binding_0),
1954 )
1955 }
1956 }
1957}
1958
Nika Layzella6f46c42017-10-26 15:26:16 -04001959pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001960 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001961 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001962 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001963 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1964 }
1965}
1966
Nika Layzella6f46c42017-10-26 15:26:16 -04001967pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001968 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001969 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001970 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001971 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001972 }
1973}
1974# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001975pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001976 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001977 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001978 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001979 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001980 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001981 decl: _visitor.fold_fn_decl(_i . decl),
1982 }
1983}
David Tolnayd60cfec2017-12-29 00:21:38 -05001984# [ cfg ( feature = "full" ) ]
1985pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
1986 MethodTurbofish {
1987 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
1988 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
1989 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
1990 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
1991 }
1992}
Nika Layzell27726662017-10-24 23:16:35 -04001993
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001994pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1995 MutType {
David Tolnay24237fb2017-12-29 02:15:26 -05001996 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001997 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001998 }
1999}
2000
Nika Layzella6f46c42017-10-26 15:26:16 -04002001pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002002 use ::NestedMetaItem::*;
2003 match _i {
2004 MetaItem(_binding_0, ) => {
2005 MetaItem (
2006 _visitor.fold_meta_item(_binding_0),
2007 )
2008 }
2009 Literal(_binding_0, ) => {
2010 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002011 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002012 )
2013 }
2014 }
2015}
2016
Nika Layzellc08227a2017-12-04 16:30:17 -05002017pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2018 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002019 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002020 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002021 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002022 }
2023}
2024# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002025pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002026 use ::Pat::*;
2027 match _i {
2028 Wild(_binding_0, ) => {
2029 Wild (
2030 _visitor.fold_pat_wild(_binding_0),
2031 )
2032 }
2033 Ident(_binding_0, ) => {
2034 Ident (
2035 _visitor.fold_pat_ident(_binding_0),
2036 )
2037 }
2038 Struct(_binding_0, ) => {
2039 Struct (
2040 _visitor.fold_pat_struct(_binding_0),
2041 )
2042 }
2043 TupleStruct(_binding_0, ) => {
2044 TupleStruct (
2045 _visitor.fold_pat_tuple_struct(_binding_0),
2046 )
2047 }
2048 Path(_binding_0, ) => {
2049 Path (
2050 _visitor.fold_pat_path(_binding_0),
2051 )
2052 }
2053 Tuple(_binding_0, ) => {
2054 Tuple (
2055 _visitor.fold_pat_tuple(_binding_0),
2056 )
2057 }
2058 Box(_binding_0, ) => {
2059 Box (
2060 _visitor.fold_pat_box(_binding_0),
2061 )
2062 }
2063 Ref(_binding_0, ) => {
2064 Ref (
2065 _visitor.fold_pat_ref(_binding_0),
2066 )
2067 }
2068 Lit(_binding_0, ) => {
2069 Lit (
2070 _visitor.fold_pat_lit(_binding_0),
2071 )
2072 }
2073 Range(_binding_0, ) => {
2074 Range (
2075 _visitor.fold_pat_range(_binding_0),
2076 )
2077 }
2078 Slice(_binding_0, ) => {
2079 Slice (
2080 _visitor.fold_pat_slice(_binding_0),
2081 )
2082 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002083 Macro(_binding_0, ) => {
2084 Macro (
2085 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002086 )
2087 }
2088 }
2089}
2090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002091pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002092 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002093 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002094 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002095 }
2096}
2097# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002098pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002099 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002100 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2101 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002102 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002103 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002104 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002105 }
2106}
2107# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002108pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002109 PatLit {
2110 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2111 }
2112}
2113# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002114pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002115 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002116 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002117 path: _visitor.fold_path(_i . path),
2118 }
2119}
2120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002121pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002122 PatRange {
2123 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002124 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002125 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002126 }
2127}
2128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002129pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002130 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002131 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002132 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002133 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002134 }
2135}
2136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002137pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002138 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002139 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002140 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002141 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002142 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002143 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002144 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 }
2146}
2147# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002149 PatStruct {
2150 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002151 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002152 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002153 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002154 }
2155}
2156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002157pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002158 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002159 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002160 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002161 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002162 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2163 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002164 }
2165}
2166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002167pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002168 PatTupleStruct {
2169 path: _visitor.fold_path(_i . path),
2170 pat: _visitor.fold_pat_tuple(_i . pat),
2171 }
2172}
2173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002174pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002175 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002176 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002177 }
2178}
2179
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002181 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002182 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002183 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2184 }
2185}
Nika Layzellc08227a2017-12-04 16:30:17 -05002186
2187pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2188 use ::PathArguments::*;
2189 match _i {
2190 None => { None }
2191 AngleBracketed(_binding_0, ) => {
2192 AngleBracketed (
2193 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2194 )
2195 }
2196 Parenthesized(_binding_0, ) => {
2197 Parenthesized (
2198 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2199 )
2200 }
2201 }
2202}
Nika Layzell27726662017-10-24 23:16:35 -04002203
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002206 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002207 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
2209}
Nika Layzell27726662017-10-24 23:16:35 -04002210
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002212 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002213 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002214 trait_ref: _visitor.fold_path(_i . trait_ref),
2215 }
2216}
2217
Nika Layzella6f46c42017-10-26 15:26:16 -04002218pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002219 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002220 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002221 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002222 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002223 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2224 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002225 }
2226}
2227# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002228pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002229 use ::RangeLimits::*;
2230 match _i {
2231 HalfOpen(_binding_0, ) => {
2232 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002233 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002234 )
2235 }
2236 Closed(_binding_0, ) => {
2237 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002238 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002239 )
2240 }
2241 }
2242}
David Tolnayf93b90d2017-11-11 19:21:26 -08002243
2244pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2245 use ::ReturnType::*;
2246 match _i {
2247 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002248 Type(_binding_0, _binding_1, ) => {
2249 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002250 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2251 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002252 )
2253 }
2254 }
2255}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002256
2257pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2258 _i
2259}
Nika Layzell27726662017-10-24 23:16:35 -04002260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002261pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002262 use ::Stmt::*;
2263 match _i {
2264 Local(_binding_0, ) => {
2265 Local (
2266 Box::new(_visitor.fold_local(* _binding_0)),
2267 )
2268 }
2269 Item(_binding_0, ) => {
2270 Item (
2271 Box::new(_visitor.fold_item(* _binding_0)),
2272 )
2273 }
2274 Expr(_binding_0, ) => {
2275 Expr (
2276 Box::new(_visitor.fold_expr(* _binding_0)),
2277 )
2278 }
2279 Semi(_binding_0, _binding_1, ) => {
2280 Semi (
2281 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002282 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002283 )
2284 }
Nika Layzell27726662017-10-24 23:16:35 -04002285 }
2286}
2287
Nika Layzella6f46c42017-10-26 15:26:16 -04002288pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002289 use ::TraitBoundModifier::*;
2290 match _i {
2291 None => { None }
2292 Maybe(_binding_0, ) => {
2293 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002294 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002295 )
2296 }
2297 }
2298}
2299# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002300pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002301 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002302 match _i {
2303 Const(_binding_0, ) => {
2304 Const (
2305 _visitor.fold_trait_item_const(_binding_0),
2306 )
2307 }
2308 Method(_binding_0, ) => {
2309 Method (
2310 _visitor.fold_trait_item_method(_binding_0),
2311 )
2312 }
2313 Type(_binding_0, ) => {
2314 Type (
2315 _visitor.fold_trait_item_type(_binding_0),
2316 )
2317 }
2318 Macro(_binding_0, ) => {
2319 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002320 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002321 )
2322 }
2323 }
2324}
2325# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002326pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2327 TraitItemConst {
2328 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002329 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002330 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002331 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002332 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002333 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002334 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002335 _visitor.fold_expr(( it ) . 1),
2336 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002337 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002338 }
2339}
2340# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002341pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2342 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002343 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002344 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002345 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002346 }
2347}
2348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002349pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002350 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002351 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002352 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002353 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002354 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002355 }
2356}
2357# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002358pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002359 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002360 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002361 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002362 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002363 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002364 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002365 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002366 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002367 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002368 _visitor.fold_type(( it ) . 1),
2369 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002370 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002371 }
2372}
2373
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002374pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2375 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002376 match _i {
2377 Slice(_binding_0, ) => {
2378 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002379 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002380 )
2381 }
2382 Array(_binding_0, ) => {
2383 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002384 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002385 )
2386 }
2387 Ptr(_binding_0, ) => {
2388 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002389 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002390 )
2391 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002392 Reference(_binding_0, ) => {
2393 Reference (
2394 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002395 )
2396 }
2397 BareFn(_binding_0, ) => {
2398 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002399 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002400 )
2401 }
2402 Never(_binding_0, ) => {
2403 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002404 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002405 )
2406 }
David Tolnay05362582017-12-26 01:33:57 -05002407 Tuple(_binding_0, ) => {
2408 Tuple (
2409 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002410 )
2411 }
2412 Path(_binding_0, ) => {
2413 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002414 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002415 )
2416 }
2417 TraitObject(_binding_0, ) => {
2418 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002419 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002420 )
2421 }
2422 ImplTrait(_binding_0, ) => {
2423 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002425 )
2426 }
2427 Paren(_binding_0, ) => {
2428 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002429 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002430 )
2431 }
2432 Group(_binding_0, ) => {
2433 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002434 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002435 )
2436 }
2437 Infer(_binding_0, ) => {
2438 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002439 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002442 Macro(_binding_0, ) => {
2443 Macro (
2444 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002445 )
2446 }
2447 }
2448}
2449
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002450pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2451 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002452 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002453 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002454 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002455 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002456 }
2457}
2458
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002459pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2460 TypeBareFn {
2461 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002462 }
2463}
2464
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002465pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2466 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002467 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002468 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002469 ty: _visitor.fold_type(_i . ty),
2470 }
2471}
2472
2473pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2474 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002475 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002476 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002477 }
2478}
2479
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2481 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002482 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002483 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002484 }
2485}
2486
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002487pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2488 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002489 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002490 }
2491}
2492
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002493pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2494 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002495 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002496 }
2497}
2498
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002499pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2500 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002501 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002502 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002503 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002504 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002505 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002506 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002507 }
2508}
2509
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002510pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2511 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002512 match _i {
2513 Trait(_binding_0, _binding_1, ) => {
2514 Trait (
2515 _visitor.fold_poly_trait_ref(_binding_0),
2516 _visitor.fold_trait_bound_modifier(_binding_1),
2517 )
2518 }
2519 Region(_binding_0, ) => {
2520 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002521 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002522 )
2523 }
2524 }
2525}
2526
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002527pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2528 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002529 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002530 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002531 }
2532}
2533
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002534pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2535 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002536 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002537 path: _visitor.fold_path(_i . path),
2538 }
2539}
2540
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002541pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2542 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002543 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2544 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayeadbda32017-12-29 02:33:47 -05002545 elem: Box::new(_visitor.fold_mut_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002546 }
2547}
2548
David Tolnay0a89b4d2017-11-13 00:55:45 -08002549pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2550 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002551 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002552 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayeadbda32017-12-29 02:33:47 -05002553 elem: Box::new(_visitor.fold_mut_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2558 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002559 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002560 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002561 }
2562}
2563
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002564pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2565 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002566 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570
David Tolnay05362582017-12-26 01:33:57 -05002571pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2572 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002573 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002574 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002575 }
2576}
2577
Nika Layzella6f46c42017-10-26 15:26:16 -04002578pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002579 use ::UnOp::*;
2580 match _i {
2581 Deref(_binding_0, ) => {
2582 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002583 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002584 )
2585 }
2586 Not(_binding_0, ) => {
2587 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002588 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002589 )
2590 }
2591 Neg(_binding_0, ) => {
2592 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002593 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002594 )
2595 }
2596 }
2597}
David Tolnay5f332a92017-12-26 00:42:45 -05002598# [ cfg ( feature = "full" ) ]
2599pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2600 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002601 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002602 }
2603}
2604# [ cfg ( feature = "full" ) ]
2605pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2606 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002607 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002608 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2609 }
2610}
2611# [ cfg ( feature = "full" ) ]
2612pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2613 UsePath {
2614 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002615 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002616 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002617 _visitor.fold_ident(( it ) . 1),
2618 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002619 }
2620}
2621# [ cfg ( feature = "full" ) ]
2622pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2623 use ::UseTree::*;
2624 match _i {
2625 Path(_binding_0, ) => {
2626 Path (
2627 _visitor.fold_use_path(_binding_0),
2628 )
2629 }
2630 Glob(_binding_0, ) => {
2631 Glob (
2632 _visitor.fold_use_glob(_binding_0),
2633 )
2634 }
2635 List(_binding_0, ) => {
2636 List (
2637 _visitor.fold_use_list(_binding_0),
2638 )
2639 }
2640 }
2641}
Nika Layzell27726662017-10-24 23:16:35 -04002642
Nika Layzella6f46c42017-10-26 15:26:16 -04002643pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002644 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002645 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002646 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002647 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002648 discriminant: (_i . discriminant).map(|it| { (
2649 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2650 _visitor.fold_expr(( it ) . 1),
2651 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002652 }
2653}
2654
Nika Layzella6f46c42017-10-26 15:26:16 -04002655pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002656 use ::VariantData::*;
2657 match _i {
2658 Struct(_binding_0, _binding_1, ) => {
2659 Struct (
2660 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002661 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002662 )
2663 }
2664 Tuple(_binding_0, _binding_1, ) => {
2665 Tuple (
2666 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002667 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002668 )
2669 }
2670 Unit => { Unit }
2671 }
2672}
Nika Layzell27726662017-10-24 23:16:35 -04002673
Nika Layzella6f46c42017-10-26 15:26:16 -04002674pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002675 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002676 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002677 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002678 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002679 }
2680}
2681
Nika Layzella6f46c42017-10-26 15:26:16 -04002682pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002683 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002684 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002685 }
2686}
2687
Nika Layzella6f46c42017-10-26 15:26:16 -04002688pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002689 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002690 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002691 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002692 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002693 path: Box::new(_visitor.fold_path(* _i . path)),
2694 }
2695}
2696
Nika Layzella6f46c42017-10-26 15:26:16 -04002697pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002698 use ::Visibility::*;
2699 match _i {
2700 Public(_binding_0, ) => {
2701 Public (
2702 _visitor.fold_vis_public(_binding_0),
2703 )
2704 }
2705 Crate(_binding_0, ) => {
2706 Crate (
2707 _visitor.fold_vis_crate(_binding_0),
2708 )
2709 }
2710 Restricted(_binding_0, ) => {
2711 Restricted (
2712 _visitor.fold_vis_restricted(_binding_0),
2713 )
2714 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002715 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002716 }
2717}
2718
Nika Layzella6f46c42017-10-26 15:26:16 -04002719pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002720 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002721 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002722 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002723 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002724 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002725 }
2726}
2727
Nika Layzella6f46c42017-10-26 15:26:16 -04002728pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002729 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002730 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002731 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2732 }
2733}
2734
Nika Layzella6f46c42017-10-26 15:26:16 -04002735pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002736 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002737 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002738 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002739 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
2741}
2742
Nika Layzella6f46c42017-10-26 15:26:16 -04002743pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002744 use ::WherePredicate::*;
2745 match _i {
2746 BoundPredicate(_binding_0, ) => {
2747 BoundPredicate (
2748 _visitor.fold_where_bound_predicate(_binding_0),
2749 )
2750 }
2751 RegionPredicate(_binding_0, ) => {
2752 RegionPredicate (
2753 _visitor.fold_where_region_predicate(_binding_0),
2754 )
2755 }
2756 EqPredicate(_binding_0, ) => {
2757 EqPredicate (
2758 _visitor.fold_where_eq_predicate(_binding_0),
2759 )
2760 }
2761 }
2762}
2763
Nika Layzella6f46c42017-10-26 15:26:16 -04002764pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002765 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002766 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002767 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002768 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002769 }
2770}
2771