blob: 19d5908d77733ff1d62a91746912c2f3b2d3d99b [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 Layzellc08227a2017-12-04 16:30:17 -050045fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040047fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040065fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050074
75fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120
David Tolnay8c91b882017-12-28 23:04:32 -0500121fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500125fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500139fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500145fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500151fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800176# [ cfg ( feature = "full" ) ]
177fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178
Nika Layzellc08227a2017-12-04 16:30:17 -0500179fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500180# [ cfg ( feature = "full" ) ]
181fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500182
David Tolnayc2f1aba2017-11-12 20:29:22 -0800183fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
184
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500186
187fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800193fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500198
David Tolnay85b69a42017-12-27 20:43:10 -0500199fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800217fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800219fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800229fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234
David Tolnay4ba63a02017-12-28 15:53:05 -0500235fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
236
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500238
239fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242
David Tolnaydecf28d2017-11-11 11:56:45 -0800243fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500244
David Tolnay85b69a42017-12-27 20:43:10 -0500245fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800246
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500254# [ cfg ( feature = "full" ) ]
255fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzellc08227a2017-12-04 16:30:17 -0500259fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500286
287fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800296
297fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500298
299fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800309fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800315fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800317fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800319fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800323fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
324
325fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
326
327fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
328
329fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
330
331fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
332
333fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
334
335fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
336
337fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
338
339fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
340
David Tolnay0a89b4d2017-11-13 00:55:45 -0800341fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800342
343fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
344
345fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
346
David Tolnay05362582017-12-26 01:33:57 -0500347fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800348
Nika Layzella6f46c42017-10-26 15:26:16 -0400349fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500350# [ cfg ( feature = "full" ) ]
351fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
352# [ cfg ( feature = "full" ) ]
353fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
354# [ cfg ( feature = "full" ) ]
355fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
356# [ cfg ( feature = "full" ) ]
357fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400358
Nika Layzella6f46c42017-10-26 15:26:16 -0400359fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400360
Nika Layzella6f46c42017-10-26 15:26:16 -0400361fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
381}
382
David Tolnayd0adf522017-12-29 01:30:07 -0500383pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
384 _i.span = _visitor.fold_span(_i.span);
385 _i
386}
387
388pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
389 _i.span = _visitor.fold_span(_i.span);
390 _i
391}
392
Nika Layzell27726662017-10-24 23:16:35 -0400393
Nika Layzella6f46c42017-10-26 15:26:16 -0400394pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400395 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500396 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
David Tolnayd5125762017-12-29 02:42:17 -0500397 name: (_i . name).map(|it| { _visitor.fold_lit(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400398 }
399}
400
Nika Layzellc08227a2017-12-04 16:30:17 -0500401pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
402 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500403 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500404 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500405 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500406 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400407 }
408}
409# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400410pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400411 ArgCaptured {
412 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500413 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800414 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400415 }
416}
417# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400418pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400419 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500420 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500421 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400422 }
423}
424# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400425pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400426 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500427 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500428 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500429 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500430 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400431 }
432}
433# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400434pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400435 Arm {
436 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
437 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500438 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400439 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500440 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400441 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500442 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400443 }
444}
445
Nika Layzella6f46c42017-10-26 15:26:16 -0400446pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400447 use ::AttrStyle::*;
448 match _i {
449 Outer => { Outer }
450 Inner(_binding_0, ) => {
451 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500452 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400453 )
454 }
455 }
456}
457
Nika Layzella6f46c42017-10-26 15:26:16 -0400458pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400459 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500461 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500462 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400463 path: _visitor.fold_path(_i . path),
464 tts: _i . tts,
465 is_sugared_doc: _i . is_sugared_doc,
466 }
467}
468
Nika Layzella6f46c42017-10-26 15:26:16 -0400469pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400470 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500471 name: (_i . name).map(|it| { (
472 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500473 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500474 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800475 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400476 }
477}
478
Nika Layzella6f46c42017-10-26 15:26:16 -0400479pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400480 use ::BareFnArgName::*;
481 match _i {
482 Named(_binding_0, ) => {
483 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500484 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400485 )
486 }
487 Wild(_binding_0, ) => {
488 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500489 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400490 )
491 }
492 }
493}
494
Nika Layzella6f46c42017-10-26 15:26:16 -0400495pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400496 use ::BinOp::*;
497 match _i {
498 Add(_binding_0, ) => {
499 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500500 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400501 )
502 }
503 Sub(_binding_0, ) => {
504 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500505 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400506 )
507 }
508 Mul(_binding_0, ) => {
509 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500510 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400511 )
512 }
513 Div(_binding_0, ) => {
514 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500515 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400516 )
517 }
518 Rem(_binding_0, ) => {
519 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500520 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400521 )
522 }
523 And(_binding_0, ) => {
524 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500525 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400526 )
527 }
528 Or(_binding_0, ) => {
529 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500530 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400531 )
532 }
533 BitXor(_binding_0, ) => {
534 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500535 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400536 )
537 }
538 BitAnd(_binding_0, ) => {
539 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500540 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
543 BitOr(_binding_0, ) => {
544 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 Shl(_binding_0, ) => {
549 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500550 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400551 )
552 }
553 Shr(_binding_0, ) => {
554 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
558 Eq(_binding_0, ) => {
559 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
563 Lt(_binding_0, ) => {
564 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
568 Le(_binding_0, ) => {
569 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
573 Ne(_binding_0, ) => {
574 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
578 Ge(_binding_0, ) => {
579 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
583 Gt(_binding_0, ) => {
584 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
588 AddEq(_binding_0, ) => {
589 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
593 SubEq(_binding_0, ) => {
594 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
598 MulEq(_binding_0, ) => {
599 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
603 DivEq(_binding_0, ) => {
604 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
608 RemEq(_binding_0, ) => {
609 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
613 BitXorEq(_binding_0, ) => {
614 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
618 BitAndEq(_binding_0, ) => {
619 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
623 BitOrEq(_binding_0, ) => {
624 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
628 ShlEq(_binding_0, ) => {
629 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
633 ShrEq(_binding_0, ) => {
634 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
638 }
639}
640# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400641pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400642 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500643 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400644 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
645 }
646}
647
Nika Layzella6f46c42017-10-26 15:26:16 -0400648pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400649 use ::Body::*;
650 match _i {
651 Enum(_binding_0, ) => {
652 Enum (
653 _visitor.fold_body_enum(_binding_0),
654 )
655 }
656 Struct(_binding_0, ) => {
657 Struct (
658 _visitor.fold_body_struct(_binding_0),
659 )
660 }
661 }
662}
663
Nika Layzella6f46c42017-10-26 15:26:16 -0400664pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400665 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500667 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400668 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
669 }
670}
671
Nika Layzella6f46c42017-10-26 15:26:16 -0400672pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400673 BodyStruct {
674 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500675 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
676 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400677 }
678}
679
Nika Layzella6f46c42017-10-26 15:26:16 -0400680pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400681 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500682 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
683 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400684 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500685 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400686 }
687}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500688
689pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
690 ConstParam {
691 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500692 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500693 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500694 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500695 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500696 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500697 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
698 }
699}
Nika Layzell27726662017-10-24 23:16:35 -0400700
Nika Layzella6f46c42017-10-26 15:26:16 -0400701pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400702 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400703 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500704 vis: _visitor.fold_visibility(_i . vis),
705 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400706 generics: _visitor.fold_generics(_i . generics),
707 body: _visitor.fold_body(_i . body),
708 }
709}
710
Nika Layzella6f46c42017-10-26 15:26:16 -0400711pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500712 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400713 match _i {
714 Box(_binding_0, ) => {
715 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400716 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400717 )
718 }
719 InPlace(_binding_0, ) => {
720 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400721 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400722 )
723 }
724 Array(_binding_0, ) => {
725 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400726 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400727 )
728 }
729 Call(_binding_0, ) => {
730 Call (
731 _visitor.fold_expr_call(_binding_0),
732 )
733 }
734 MethodCall(_binding_0, ) => {
735 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400736 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400737 )
738 }
David Tolnay05362582017-12-26 01:33:57 -0500739 Tuple(_binding_0, ) => {
740 Tuple (
741 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400742 )
743 }
744 Binary(_binding_0, ) => {
745 Binary (
746 _visitor.fold_expr_binary(_binding_0),
747 )
748 }
749 Unary(_binding_0, ) => {
750 Unary (
751 _visitor.fold_expr_unary(_binding_0),
752 )
753 }
754 Lit(_binding_0, ) => {
755 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500756 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400757 )
758 }
759 Cast(_binding_0, ) => {
760 Cast (
761 _visitor.fold_expr_cast(_binding_0),
762 )
763 }
764 Type(_binding_0, ) => {
765 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500766 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400767 )
768 }
769 If(_binding_0, ) => {
770 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400771 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400772 )
773 }
774 IfLet(_binding_0, ) => {
775 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400776 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400777 )
778 }
779 While(_binding_0, ) => {
780 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400781 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400782 )
783 }
784 WhileLet(_binding_0, ) => {
785 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400786 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400787 )
788 }
789 ForLoop(_binding_0, ) => {
790 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400791 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400792 )
793 }
794 Loop(_binding_0, ) => {
795 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400796 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400797 )
798 }
799 Match(_binding_0, ) => {
800 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400801 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400802 )
803 }
804 Closure(_binding_0, ) => {
805 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400806 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 )
808 }
Nika Layzell640832a2017-12-04 13:37:09 -0500809 Unsafe(_binding_0, ) => {
810 Unsafe (
811 full!(_visitor.fold_expr_unsafe(_binding_0)),
812 )
813 }
Nika Layzell27726662017-10-24 23:16:35 -0400814 Block(_binding_0, ) => {
815 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400816 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400817 )
818 }
819 Assign(_binding_0, ) => {
820 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400821 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400822 )
823 }
824 AssignOp(_binding_0, ) => {
825 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400826 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400827 )
828 }
829 Field(_binding_0, ) => {
830 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400831 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400832 )
833 }
Nika Layzell27726662017-10-24 23:16:35 -0400834 Index(_binding_0, ) => {
835 Index (
836 _visitor.fold_expr_index(_binding_0),
837 )
838 }
839 Range(_binding_0, ) => {
840 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400841 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400842 )
843 }
844 Path(_binding_0, ) => {
845 Path (
846 _visitor.fold_expr_path(_binding_0),
847 )
848 }
849 AddrOf(_binding_0, ) => {
850 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
854 Break(_binding_0, ) => {
855 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
859 Continue(_binding_0, ) => {
860 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400861 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400862 )
863 }
David Tolnayc246cd32017-12-28 23:14:32 -0500864 Return(_binding_0, ) => {
865 Return (
866 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 )
868 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800869 Macro(_binding_0, ) => {
870 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500871 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400872 )
873 }
874 Struct(_binding_0, ) => {
875 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400876 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400877 )
878 }
879 Repeat(_binding_0, ) => {
880 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400881 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 )
883 }
884 Paren(_binding_0, ) => {
885 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500886 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400887 )
888 }
889 Group(_binding_0, ) => {
890 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500891 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
894 Try(_binding_0, ) => {
895 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400896 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
899 Catch(_binding_0, ) => {
900 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400901 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400902 )
903 }
904 Yield(_binding_0, ) => {
905 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400906 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400907 )
908 }
909 }
910}
911# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500912pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
913 ExprAddrOf {
914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
915 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500916 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500917 expr: Box::new(_visitor.fold_expr(* _i . expr)),
918 }
919}
920# [ cfg ( feature = "full" ) ]
921pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
922 ExprArray {
923 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
924 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500925 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500926 }
927}
928# [ cfg ( feature = "full" ) ]
929pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
930 ExprAssign {
931 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
932 left: Box::new(_visitor.fold_expr(* _i . left)),
933 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
934 right: Box::new(_visitor.fold_expr(* _i . right)),
935 }
936}
937# [ cfg ( feature = "full" ) ]
938pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
939 ExprAssignOp {
940 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
941 left: Box::new(_visitor.fold_expr(* _i . left)),
942 op: _visitor.fold_bin_op(_i . op),
943 right: Box::new(_visitor.fold_expr(* _i . right)),
944 }
945}
946
947pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
948 ExprBinary {
949 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
950 left: Box::new(_visitor.fold_expr(* _i . left)),
951 op: _visitor.fold_bin_op(_i . op),
952 right: Box::new(_visitor.fold_expr(* _i . right)),
953 }
954}
955# [ cfg ( feature = "full" ) ]
956pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
957 ExprBlock {
958 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
959 block: _visitor.fold_block(_i . block),
960 }
961}
962# [ cfg ( feature = "full" ) ]
963pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
964 ExprBox {
965 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
966 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
967 expr: Box::new(_visitor.fold_expr(* _i . expr)),
968 }
969}
970# [ cfg ( feature = "full" ) ]
971pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
972 ExprBreak {
973 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
974 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
975 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
976 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
977 }
978}
979
980pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
981 ExprCall {
982 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
983 func: Box::new(_visitor.fold_expr(* _i . func)),
984 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
985 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
986 }
987}
988
989pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
990 ExprCast {
991 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
992 expr: Box::new(_visitor.fold_expr(* _i . expr)),
993 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
994 ty: Box::new(_visitor.fold_type(* _i . ty)),
995 }
996}
997# [ cfg ( feature = "full" ) ]
998pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
999 ExprCatch {
1000 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1001 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1002 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1003 block: _visitor.fold_block(_i . block),
1004 }
1005}
1006# [ cfg ( feature = "full" ) ]
1007pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1008 ExprClosure {
1009 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001010 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001011 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1012 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1013 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1014 output: _visitor.fold_return_type(_i . output),
1015 body: Box::new(_visitor.fold_expr(* _i . body)),
1016 }
1017}
1018# [ cfg ( feature = "full" ) ]
1019pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1020 ExprContinue {
1021 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1022 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1023 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1024 }
1025}
1026# [ cfg ( feature = "full" ) ]
1027pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1028 ExprField {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 base: Box::new(_visitor.fold_expr(* _i . base)),
1031 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1032 member: _visitor.fold_member(_i . member),
1033 }
1034}
1035# [ cfg ( feature = "full" ) ]
1036pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1037 ExprForLoop {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1039 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1040 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1041 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1042 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1043 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1044 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1045 body: _visitor.fold_block(_i . body),
1046 }
1047}
David Tolnaye98775f2017-12-28 23:17:00 -05001048# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001049pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1050 ExprGroup {
1051 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1052 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1053 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1054 }
1055}
1056# [ cfg ( feature = "full" ) ]
1057pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1058 ExprIf {
1059 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1060 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1061 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001062 then_branch: _visitor.fold_block(_i . then_branch),
1063 else_branch: (_i . else_branch).map(|it| { (
1064 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1065 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1066 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001067 }
1068}
1069# [ cfg ( feature = "full" ) ]
1070pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1071 ExprIfLet {
1072 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1073 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1074 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1075 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1076 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1077 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001078 then_branch: _visitor.fold_block(_i . then_branch),
1079 else_branch: (_i . else_branch).map(|it| { (
1080 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1081 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1082 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001083 }
1084}
1085# [ cfg ( feature = "full" ) ]
1086pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1087 ExprInPlace {
1088 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1089 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001090 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001091 value: Box::new(_visitor.fold_expr(* _i . value)),
1092 }
1093}
1094
1095pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1096 ExprIndex {
1097 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1098 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1099 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1100 index: Box::new(_visitor.fold_expr(* _i . index)),
1101 }
1102}
1103
1104pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1105 ExprLit {
1106 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1107 lit: _visitor.fold_lit(_i . lit),
1108 }
1109}
1110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001111pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001112 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001113 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001114 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001115 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001116 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1117 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001118 }
1119}
1120# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001121pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1122 ExprMacro {
1123 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1124 mac: _visitor.fold_macro(_i . mac),
1125 }
1126}
1127# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001128pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001129 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001130 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001131 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001132 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001133 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001134 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1135 }
1136}
1137# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001138pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001139 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001140 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001141 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001142 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001143 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001144 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001145 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1146 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001147 }
1148}
David Tolnaye98775f2017-12-28 23:17:00 -05001149# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001150pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001151 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001152 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001153 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001154 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001155 }
1156}
1157
Nika Layzella6f46c42017-10-26 15:26:16 -04001158pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001159 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001160 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001161 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001162 path: _visitor.fold_path(_i . path),
1163 }
1164}
1165# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001166pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001167 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001168 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001169 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001170 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001171 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001172 }
1173}
1174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001175pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001176 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001177 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001178 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001179 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001180 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001181 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1182 }
1183}
1184# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001185pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1186 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001187 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001188 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001189 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001190 }
1191}
1192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001193pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001194 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001195 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001196 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001197 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001198 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1199 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1200 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001201 }
1202}
1203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001206 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001207 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001208 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001209 }
1210}
1211# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001212pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1213 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001214 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001215 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001216 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001217 }
1218}
David Tolnay0cf94f22017-12-28 23:46:26 -05001219# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001220pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001221 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001222 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001223 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001224 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001225 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001226 }
1227}
1228
Nika Layzella6f46c42017-10-26 15:26:16 -04001229pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001230 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001231 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001232 op: _visitor.fold_un_op(_i . op),
1233 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1234 }
1235}
1236# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001237pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1238 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001239 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001240 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001241 block: _visitor.fold_block(_i . block),
1242 }
1243}
1244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001245pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001246 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001247 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001248 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001249 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1250 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001251 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1252 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001253 }
1254}
1255# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001256pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001257 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001258 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001259 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001260 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1261 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1262 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001263 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001264 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001265 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1266 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001267 }
1268}
1269# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001270pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001271 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001273 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001274 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001275 }
1276}
1277
Nika Layzella6f46c42017-10-26 15:26:16 -04001278pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001279 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001280 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001281 vis: _visitor.fold_visibility(_i . vis),
1282 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001283 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001284 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001285 }
1286}
1287# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001288pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001289 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001290 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001291 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001292 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001293 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001294 }
1295}
1296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001297pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001298 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001299 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1300 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001301 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001302 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001303 }
1304}
1305# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001306pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001307 File {
1308 shebang: _i . shebang,
1309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1310 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1311 }
1312}
1313# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001314pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001315 use ::FnArg::*;
1316 match _i {
1317 SelfRef(_binding_0, ) => {
1318 SelfRef (
1319 _visitor.fold_arg_self_ref(_binding_0),
1320 )
1321 }
1322 SelfValue(_binding_0, ) => {
1323 SelfValue (
1324 _visitor.fold_arg_self(_binding_0),
1325 )
1326 }
1327 Captured(_binding_0, ) => {
1328 Captured (
1329 _visitor.fold_arg_captured(_binding_0),
1330 )
1331 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001332 Inferred(_binding_0, ) => {
1333 Inferred (
1334 _visitor.fold_pat(_binding_0),
1335 )
1336 }
Nika Layzell27726662017-10-24 23:16:35 -04001337 Ignored(_binding_0, ) => {
1338 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001339 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001340 )
1341 }
1342 }
1343}
1344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001345pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001346 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001347 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001348 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001349 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001350 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001351 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001352 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001353 }
1354}
1355# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001356pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001357 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001358 match _i {
1359 Fn(_binding_0, ) => {
1360 Fn (
1361 _visitor.fold_foreign_item_fn(_binding_0),
1362 )
1363 }
1364 Static(_binding_0, ) => {
1365 Static (
1366 _visitor.fold_foreign_item_static(_binding_0),
1367 )
1368 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001369 Type(_binding_0, ) => {
1370 Type (
1371 _visitor.fold_foreign_item_type(_binding_0),
1372 )
1373 }
Nika Layzell27726662017-10-24 23:16:35 -04001374 }
1375}
1376# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001377pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1378 ForeignItemFn {
1379 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1380 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001381 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001382 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001383 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001384 }
1385}
1386# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001387pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001388 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001389 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1390 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001391 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001392 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001393 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001394 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001395 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001396 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001397 }
1398}
David Tolnay199bcbb2017-11-12 10:33:52 -08001399# [ cfg ( feature = "full" ) ]
1400pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1401 ForeignItemType {
1402 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1403 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001404 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001405 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001406 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001407 }
1408}
Nika Layzell27726662017-10-24 23:16:35 -04001409
Nika Layzellc08227a2017-12-04 16:30:17 -05001410pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1411 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001412 match _i {
1413 Lifetime(_binding_0, ) => {
1414 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001415 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001416 )
1417 }
1418 Type(_binding_0, ) => {
1419 Type (
1420 _visitor.fold_type(_binding_0),
1421 )
1422 }
1423 TypeBinding(_binding_0, ) => {
1424 TypeBinding (
1425 _visitor.fold_type_binding(_binding_0),
1426 )
1427 }
Nika Layzellc680e612017-12-04 19:07:20 -05001428 Const(_binding_0, ) => {
1429 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001430 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001431 )
1432 }
Nika Layzell357885a2017-12-04 15:47:07 -05001433 }
1434}
David Tolnayd60cfec2017-12-29 00:21:38 -05001435# [ cfg ( feature = "full" ) ]
1436pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1437 use ::GenericMethodArgument::*;
1438 match _i {
1439 Type(_binding_0, ) => {
1440 Type (
1441 _visitor.fold_type(_binding_0),
1442 )
1443 }
1444 Const(_binding_0, ) => {
1445 Const (
1446 _visitor.fold_expr(_binding_0),
1447 )
1448 }
1449 }
1450}
Nika Layzell357885a2017-12-04 15:47:07 -05001451
David Tolnayc2f1aba2017-11-12 20:29:22 -08001452pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1453 use ::GenericParam::*;
1454 match _i {
1455 Lifetime(_binding_0, ) => {
1456 Lifetime (
1457 _visitor.fold_lifetime_def(_binding_0),
1458 )
1459 }
1460 Type(_binding_0, ) => {
1461 Type (
1462 _visitor.fold_type_param(_binding_0),
1463 )
1464 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001465 Const(_binding_0, ) => {
1466 Const (
1467 _visitor.fold_const_param(_binding_0),
1468 )
1469 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001470 }
1471}
1472
Nika Layzella6f46c42017-10-26 15:26:16 -04001473pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001474 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001475 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001476 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001477 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001478 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001479 }
1480}
1481# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001482pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001483 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001484 match _i {
1485 Const(_binding_0, ) => {
1486 Const (
1487 _visitor.fold_impl_item_const(_binding_0),
1488 )
1489 }
1490 Method(_binding_0, ) => {
1491 Method (
1492 _visitor.fold_impl_item_method(_binding_0),
1493 )
1494 }
1495 Type(_binding_0, ) => {
1496 Type (
1497 _visitor.fold_impl_item_type(_binding_0),
1498 )
1499 }
1500 Macro(_binding_0, ) => {
1501 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001502 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001503 )
1504 }
1505 }
1506}
1507# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001508pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1509 ImplItemConst {
1510 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1511 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001512 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001513 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001514 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001515 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001516 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001517 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001518 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001519 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001520 }
1521}
1522# [ cfg ( feature = "full" ) ]
1523pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1524 ImplItemMacro {
1525 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1526 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001527 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001528 }
1529}
1530# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001531pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001532 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001533 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001534 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001535 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001536 sig: _visitor.fold_method_sig(_i . sig),
1537 block: _visitor.fold_block(_i . block),
1538 }
1539}
1540# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001541pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001542 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001543 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001544 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001545 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001547 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001548 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001549 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001550 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001551 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001552 }
1553}
David Tolnay14982012017-12-29 00:49:51 -05001554
David Tolnay85b69a42017-12-27 20:43:10 -05001555pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1556 Index {
1557 index: _i . index,
1558 span: _visitor.fold_span(_i . span),
1559 }
1560}
1561# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001562pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001563 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001564 match _i {
1565 ExternCrate(_binding_0, ) => {
1566 ExternCrate (
1567 _visitor.fold_item_extern_crate(_binding_0),
1568 )
1569 }
1570 Use(_binding_0, ) => {
1571 Use (
1572 _visitor.fold_item_use(_binding_0),
1573 )
1574 }
1575 Static(_binding_0, ) => {
1576 Static (
1577 _visitor.fold_item_static(_binding_0),
1578 )
1579 }
1580 Const(_binding_0, ) => {
1581 Const (
1582 _visitor.fold_item_const(_binding_0),
1583 )
1584 }
1585 Fn(_binding_0, ) => {
1586 Fn (
1587 _visitor.fold_item_fn(_binding_0),
1588 )
1589 }
1590 Mod(_binding_0, ) => {
1591 Mod (
1592 _visitor.fold_item_mod(_binding_0),
1593 )
1594 }
1595 ForeignMod(_binding_0, ) => {
1596 ForeignMod (
1597 _visitor.fold_item_foreign_mod(_binding_0),
1598 )
1599 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001600 Type(_binding_0, ) => {
1601 Type (
1602 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001603 )
1604 }
1605 Enum(_binding_0, ) => {
1606 Enum (
1607 _visitor.fold_item_enum(_binding_0),
1608 )
1609 }
1610 Struct(_binding_0, ) => {
1611 Struct (
1612 _visitor.fold_item_struct(_binding_0),
1613 )
1614 }
1615 Union(_binding_0, ) => {
1616 Union (
1617 _visitor.fold_item_union(_binding_0),
1618 )
1619 }
1620 Trait(_binding_0, ) => {
1621 Trait (
1622 _visitor.fold_item_trait(_binding_0),
1623 )
1624 }
1625 DefaultImpl(_binding_0, ) => {
1626 DefaultImpl (
1627 _visitor.fold_item_default_impl(_binding_0),
1628 )
1629 }
1630 Impl(_binding_0, ) => {
1631 Impl (
1632 _visitor.fold_item_impl(_binding_0),
1633 )
1634 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001635 Macro(_binding_0, ) => {
1636 Macro (
1637 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001638 )
1639 }
David Tolnay500d8322017-12-18 00:32:51 -08001640 Macro2(_binding_0, ) => {
1641 Macro2 (
1642 _visitor.fold_item_macro2(_binding_0),
1643 )
1644 }
Nika Layzell27726662017-10-24 23:16:35 -04001645 }
1646}
1647# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001648pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1649 ItemConst {
1650 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1651 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001652 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001653 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001654 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001655 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001656 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001657 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001658 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001659 }
1660}
1661# [ cfg ( feature = "full" ) ]
1662pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1663 ItemDefaultImpl {
1664 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001665 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001666 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001667 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001668 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1669 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001670 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001671 }
1672}
1673# [ cfg ( feature = "full" ) ]
1674pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1675 ItemEnum {
1676 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1677 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001678 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001679 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001680 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001681 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001682 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1683 }
1684}
1685# [ cfg ( feature = "full" ) ]
1686pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1687 ItemExternCrate {
1688 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1689 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001690 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1691 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001692 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001693 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001694 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001695 _visitor.fold_ident(( it ) . 1),
1696 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001697 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001698 }
1699}
1700# [ cfg ( feature = "full" ) ]
1701pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1702 ItemFn {
1703 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1704 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001705 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001706 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001707 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001708 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001709 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001710 block: Box::new(_visitor.fold_block(* _i . block)),
1711 }
1712}
1713# [ cfg ( feature = "full" ) ]
1714pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1715 ItemForeignMod {
1716 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1717 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001718 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001719 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1720 }
1721}
1722# [ cfg ( feature = "full" ) ]
1723pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1724 ItemImpl {
1725 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001726 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001727 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001728 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001729 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001730 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001731 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001732 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001733 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001734 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001735 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001736 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001737 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1738 }
1739}
1740# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001741pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1742 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001744 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001745 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001746 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001747 }
1748}
1749# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001750pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1751 ItemMacro2 {
1752 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1753 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001754 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001755 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001756 args: _i . args,
1757 body: _i . body,
1758 }
1759}
1760# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001761pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001762 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001763 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001764 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001765 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001766 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001767 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001768 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001769 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1770 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001771 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001772 }
1773}
1774# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001775pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001776 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001778 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001779 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001780 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001781 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001782 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001783 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001784 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001785 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001786 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001787 }
1788}
1789# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001790pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001791 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001793 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001794 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001795 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001796 generics: _visitor.fold_generics(_i . generics),
1797 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001798 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001799 }
1800}
1801# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001802pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001803 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001805 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001806 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001807 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1808 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001809 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001810 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001811 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001812 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001813 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001814 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1815 }
1816}
1817# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001818pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1819 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001821 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001822 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001823 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001824 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001825 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001826 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001827 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001828 }
1829}
1830# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001831pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001832 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001833 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001834 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001835 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001836 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001837 generics: _visitor.fold_generics(_i . generics),
1838 data: _visitor.fold_variant_data(_i . data),
1839 }
1840}
1841# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001842pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001843 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001844 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001845 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1847 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001848 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1849 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001850 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001851 }
1852}
1853
Nika Layzella6f46c42017-10-26 15:26:16 -04001854pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001855 LifetimeDef {
1856 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001857 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001858 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001859 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1860 }
1861}
1862
1863pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1864 Lit {
1865 value: _i . value,
1866 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001867 }
1868}
1869# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001870pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001871 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001872 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001873 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1874 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1875 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1876 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1877 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1878 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1879 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001880 }
1881}
Nika Layzell27726662017-10-24 23:16:35 -04001882
David Tolnaydecf28d2017-11-11 11:56:45 -08001883pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1884 Macro {
1885 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001886 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001887 tokens: _i . tokens,
1888 }
1889}
David Tolnay14982012017-12-29 00:49:51 -05001890
David Tolnay85b69a42017-12-27 20:43:10 -05001891pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1892 use ::Member::*;
1893 match _i {
1894 Named(_binding_0, ) => {
1895 Named (
1896 _visitor.fold_ident(_binding_0),
1897 )
1898 }
1899 Unnamed(_binding_0, ) => {
1900 Unnamed (
1901 _visitor.fold_index(_binding_0),
1902 )
1903 }
1904 }
1905}
David Tolnaydecf28d2017-11-11 11:56:45 -08001906
Nika Layzella6f46c42017-10-26 15:26:16 -04001907pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001908 use ::MetaItem::*;
1909 match _i {
1910 Term(_binding_0, ) => {
1911 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001912 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001913 )
1914 }
1915 List(_binding_0, ) => {
1916 List (
1917 _visitor.fold_meta_item_list(_binding_0),
1918 )
1919 }
1920 NameValue(_binding_0, ) => {
1921 NameValue (
1922 _visitor.fold_meta_name_value(_binding_0),
1923 )
1924 }
1925 }
1926}
1927
Nika Layzella6f46c42017-10-26 15:26:16 -04001928pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001929 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001930 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001931 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001932 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1933 }
1934}
1935
Nika Layzella6f46c42017-10-26 15:26:16 -04001936pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001937 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001938 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001939 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001940 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001941 }
1942}
1943# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001944pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001945 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001946 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001947 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001948 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001949 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001950 decl: _visitor.fold_fn_decl(_i . decl),
1951 }
1952}
David Tolnayd60cfec2017-12-29 00:21:38 -05001953# [ cfg ( feature = "full" ) ]
1954pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
1955 MethodTurbofish {
1956 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
1957 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
1958 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
1959 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
1960 }
1961}
Nika Layzell27726662017-10-24 23:16:35 -04001962
Nika Layzella6f46c42017-10-26 15:26:16 -04001963pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001964 use ::NestedMetaItem::*;
1965 match _i {
1966 MetaItem(_binding_0, ) => {
1967 MetaItem (
1968 _visitor.fold_meta_item(_binding_0),
1969 )
1970 }
1971 Literal(_binding_0, ) => {
1972 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05001973 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001974 )
1975 }
1976 }
1977}
1978
Nika Layzellc08227a2017-12-04 16:30:17 -05001979pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
1980 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001981 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001982 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001983 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001984 }
1985}
1986# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001987pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04001988 use ::Pat::*;
1989 match _i {
1990 Wild(_binding_0, ) => {
1991 Wild (
1992 _visitor.fold_pat_wild(_binding_0),
1993 )
1994 }
1995 Ident(_binding_0, ) => {
1996 Ident (
1997 _visitor.fold_pat_ident(_binding_0),
1998 )
1999 }
2000 Struct(_binding_0, ) => {
2001 Struct (
2002 _visitor.fold_pat_struct(_binding_0),
2003 )
2004 }
2005 TupleStruct(_binding_0, ) => {
2006 TupleStruct (
2007 _visitor.fold_pat_tuple_struct(_binding_0),
2008 )
2009 }
2010 Path(_binding_0, ) => {
2011 Path (
2012 _visitor.fold_pat_path(_binding_0),
2013 )
2014 }
2015 Tuple(_binding_0, ) => {
2016 Tuple (
2017 _visitor.fold_pat_tuple(_binding_0),
2018 )
2019 }
2020 Box(_binding_0, ) => {
2021 Box (
2022 _visitor.fold_pat_box(_binding_0),
2023 )
2024 }
2025 Ref(_binding_0, ) => {
2026 Ref (
2027 _visitor.fold_pat_ref(_binding_0),
2028 )
2029 }
2030 Lit(_binding_0, ) => {
2031 Lit (
2032 _visitor.fold_pat_lit(_binding_0),
2033 )
2034 }
2035 Range(_binding_0, ) => {
2036 Range (
2037 _visitor.fold_pat_range(_binding_0),
2038 )
2039 }
2040 Slice(_binding_0, ) => {
2041 Slice (
2042 _visitor.fold_pat_slice(_binding_0),
2043 )
2044 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002045 Macro(_binding_0, ) => {
2046 Macro (
2047 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002048 )
2049 }
2050 }
2051}
2052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002053pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002054 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002055 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002056 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002057 }
2058}
2059# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002060pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002061 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002062 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2063 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002064 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002065 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002066 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002067 }
2068}
2069# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002070pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002071 PatLit {
2072 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2073 }
2074}
2075# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002076pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002077 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002078 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002079 path: _visitor.fold_path(_i . path),
2080 }
2081}
2082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002083pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002084 PatRange {
2085 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002086 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002087 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002088 }
2089}
2090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002091pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002092 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002093 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002094 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002095 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002096 }
2097}
2098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002099pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002100 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002101 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002102 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002103 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002104 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002105 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002106 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002107 }
2108}
2109# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002110pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002111 PatStruct {
2112 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002113 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002114 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002115 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002116 }
2117}
2118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002119pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002120 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002121 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002122 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002123 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002124 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2125 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002126 }
2127}
2128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002129pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002130 PatTupleStruct {
2131 path: _visitor.fold_path(_i . path),
2132 pat: _visitor.fold_pat_tuple(_i . pat),
2133 }
2134}
2135# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002136pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002137 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002138 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002139 }
2140}
2141
Nika Layzella6f46c42017-10-26 15:26:16 -04002142pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002143 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002144 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002145 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2146 }
2147}
Nika Layzellc08227a2017-12-04 16:30:17 -05002148
2149pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2150 use ::PathArguments::*;
2151 match _i {
2152 None => { None }
2153 AngleBracketed(_binding_0, ) => {
2154 AngleBracketed (
2155 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2156 )
2157 }
2158 Parenthesized(_binding_0, ) => {
2159 Parenthesized (
2160 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2161 )
2162 }
2163 }
2164}
Nika Layzell27726662017-10-24 23:16:35 -04002165
Nika Layzella6f46c42017-10-26 15:26:16 -04002166pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002167 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002168 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002169 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002170 }
2171}
Nika Layzell27726662017-10-24 23:16:35 -04002172
Nika Layzella6f46c42017-10-26 15:26:16 -04002173pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002174 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002175 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002176 trait_ref: _visitor.fold_path(_i . trait_ref),
2177 }
2178}
2179
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002181 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002182 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002183 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002184 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002185 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2186 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002187 }
2188}
2189# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002190pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002191 use ::RangeLimits::*;
2192 match _i {
2193 HalfOpen(_binding_0, ) => {
2194 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002195 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002196 )
2197 }
2198 Closed(_binding_0, ) => {
2199 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002200 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002201 )
2202 }
2203 }
2204}
David Tolnayf93b90d2017-11-11 19:21:26 -08002205
2206pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2207 use ::ReturnType::*;
2208 match _i {
2209 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002210 Type(_binding_0, _binding_1, ) => {
2211 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002212 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2213 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002214 )
2215 }
2216 }
2217}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002218
2219pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2220 _i
2221}
Nika Layzell27726662017-10-24 23:16:35 -04002222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002223pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002224 use ::Stmt::*;
2225 match _i {
2226 Local(_binding_0, ) => {
2227 Local (
2228 Box::new(_visitor.fold_local(* _binding_0)),
2229 )
2230 }
2231 Item(_binding_0, ) => {
2232 Item (
2233 Box::new(_visitor.fold_item(* _binding_0)),
2234 )
2235 }
2236 Expr(_binding_0, ) => {
2237 Expr (
2238 Box::new(_visitor.fold_expr(* _binding_0)),
2239 )
2240 }
2241 Semi(_binding_0, _binding_1, ) => {
2242 Semi (
2243 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002244 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002245 )
2246 }
Nika Layzell27726662017-10-24 23:16:35 -04002247 }
2248}
2249
Nika Layzella6f46c42017-10-26 15:26:16 -04002250pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002251 use ::TraitBoundModifier::*;
2252 match _i {
2253 None => { None }
2254 Maybe(_binding_0, ) => {
2255 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002256 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002257 )
2258 }
2259 }
2260}
2261# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002262pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002263 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002264 match _i {
2265 Const(_binding_0, ) => {
2266 Const (
2267 _visitor.fold_trait_item_const(_binding_0),
2268 )
2269 }
2270 Method(_binding_0, ) => {
2271 Method (
2272 _visitor.fold_trait_item_method(_binding_0),
2273 )
2274 }
2275 Type(_binding_0, ) => {
2276 Type (
2277 _visitor.fold_trait_item_type(_binding_0),
2278 )
2279 }
2280 Macro(_binding_0, ) => {
2281 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002282 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002283 )
2284 }
2285 }
2286}
2287# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002288pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2289 TraitItemConst {
2290 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002291 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002292 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002293 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002294 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002295 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002296 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002297 _visitor.fold_expr(( it ) . 1),
2298 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002299 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002300 }
2301}
2302# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002303pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2304 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002305 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002306 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002307 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002308 }
2309}
2310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002311pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002312 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002313 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002314 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002315 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002316 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002317 }
2318}
2319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002320pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002321 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002322 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002323 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002324 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002325 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002326 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002327 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002328 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002329 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002330 _visitor.fold_type(( it ) . 1),
2331 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002332 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002333 }
2334}
2335
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002336pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2337 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002338 match _i {
2339 Slice(_binding_0, ) => {
2340 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002341 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002342 )
2343 }
2344 Array(_binding_0, ) => {
2345 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002346 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002347 )
2348 }
2349 Ptr(_binding_0, ) => {
2350 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002351 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002352 )
2353 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002354 Reference(_binding_0, ) => {
2355 Reference (
2356 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002357 )
2358 }
2359 BareFn(_binding_0, ) => {
2360 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002361 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002362 )
2363 }
2364 Never(_binding_0, ) => {
2365 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002366 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002367 )
2368 }
David Tolnay05362582017-12-26 01:33:57 -05002369 Tuple(_binding_0, ) => {
2370 Tuple (
2371 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002372 )
2373 }
2374 Path(_binding_0, ) => {
2375 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002376 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002377 )
2378 }
2379 TraitObject(_binding_0, ) => {
2380 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002381 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002382 )
2383 }
2384 ImplTrait(_binding_0, ) => {
2385 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002386 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 Paren(_binding_0, ) => {
2390 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002391 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002392 )
2393 }
2394 Group(_binding_0, ) => {
2395 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002396 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002397 )
2398 }
2399 Infer(_binding_0, ) => {
2400 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002401 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002402 )
2403 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002404 Macro(_binding_0, ) => {
2405 Macro (
2406 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002407 )
2408 }
2409 }
2410}
2411
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002412pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2413 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002414 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002415 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002416 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002417 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002418 }
2419}
2420
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002421pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2422 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002423 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2424 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2425 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2426 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2427 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2428 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2429 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2430 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002431 }
2432}
2433
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002434pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2435 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002436 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002437 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002438 ty: _visitor.fold_type(_i . ty),
2439 }
2440}
2441
2442pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2443 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002444 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002445 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002446 }
2447}
2448
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2450 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002451 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002452 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002453 }
2454}
2455
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002456pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2457 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002458 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002459 }
2460}
2461
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002462pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2463 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002464 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002465 }
2466}
2467
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002468pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2469 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002470 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002471 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002472 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002473 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002474 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002476 }
2477}
2478
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2480 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002481 match _i {
2482 Trait(_binding_0, _binding_1, ) => {
2483 Trait (
2484 _visitor.fold_poly_trait_ref(_binding_0),
2485 _visitor.fold_trait_bound_modifier(_binding_1),
2486 )
2487 }
2488 Region(_binding_0, ) => {
2489 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002490 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
2493 }
2494}
2495
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2497 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002498 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002499 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002500 }
2501}
2502
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2504 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002505 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002506 path: _visitor.fold_path(_i . path),
2507 }
2508}
2509
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002510pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2511 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002512 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2513 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002514 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2515 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002516 }
2517}
2518
David Tolnay0a89b4d2017-11-13 00:55:45 -08002519pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2520 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002521 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002522 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002523 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2524 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002525 }
2526}
2527
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002528pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2529 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002530 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002531 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002532 }
2533}
2534
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2536 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002537 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002538 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002539 }
2540}
2541
David Tolnay05362582017-12-26 01:33:57 -05002542pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2543 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002544 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002545 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002546 }
2547}
2548
Nika Layzella6f46c42017-10-26 15:26:16 -04002549pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002550 use ::UnOp::*;
2551 match _i {
2552 Deref(_binding_0, ) => {
2553 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002554 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002555 )
2556 }
2557 Not(_binding_0, ) => {
2558 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002559 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002560 )
2561 }
2562 Neg(_binding_0, ) => {
2563 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002564 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002565 )
2566 }
2567 }
2568}
David Tolnay5f332a92017-12-26 00:42:45 -05002569# [ cfg ( feature = "full" ) ]
2570pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2571 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002572 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002573 }
2574}
2575# [ cfg ( feature = "full" ) ]
2576pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2577 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002578 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002579 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2580 }
2581}
2582# [ cfg ( feature = "full" ) ]
2583pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2584 UsePath {
2585 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002586 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002588 _visitor.fold_ident(( it ) . 1),
2589 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002590 }
2591}
2592# [ cfg ( feature = "full" ) ]
2593pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2594 use ::UseTree::*;
2595 match _i {
2596 Path(_binding_0, ) => {
2597 Path (
2598 _visitor.fold_use_path(_binding_0),
2599 )
2600 }
2601 Glob(_binding_0, ) => {
2602 Glob (
2603 _visitor.fold_use_glob(_binding_0),
2604 )
2605 }
2606 List(_binding_0, ) => {
2607 List (
2608 _visitor.fold_use_list(_binding_0),
2609 )
2610 }
2611 }
2612}
Nika Layzell27726662017-10-24 23:16:35 -04002613
Nika Layzella6f46c42017-10-26 15:26:16 -04002614pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002615 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002616 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002617 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002618 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002619 discriminant: (_i . discriminant).map(|it| { (
2620 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2621 _visitor.fold_expr(( it ) . 1),
2622 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002623 }
2624}
2625
Nika Layzella6f46c42017-10-26 15:26:16 -04002626pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002627 use ::VariantData::*;
2628 match _i {
2629 Struct(_binding_0, _binding_1, ) => {
2630 Struct (
2631 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002632 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002633 )
2634 }
2635 Tuple(_binding_0, _binding_1, ) => {
2636 Tuple (
2637 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002638 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002639 )
2640 }
2641 Unit => { Unit }
2642 }
2643}
Nika Layzell27726662017-10-24 23:16:35 -04002644
Nika Layzella6f46c42017-10-26 15:26:16 -04002645pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002646 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002647 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002648 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002649 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002650 }
2651}
2652
Nika Layzella6f46c42017-10-26 15:26:16 -04002653pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002654 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002655 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002656 }
2657}
2658
Nika Layzella6f46c42017-10-26 15:26:16 -04002659pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002660 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002661 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002662 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002663 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002664 path: Box::new(_visitor.fold_path(* _i . path)),
2665 }
2666}
2667
Nika Layzella6f46c42017-10-26 15:26:16 -04002668pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002669 use ::Visibility::*;
2670 match _i {
2671 Public(_binding_0, ) => {
2672 Public (
2673 _visitor.fold_vis_public(_binding_0),
2674 )
2675 }
2676 Crate(_binding_0, ) => {
2677 Crate (
2678 _visitor.fold_vis_crate(_binding_0),
2679 )
2680 }
2681 Restricted(_binding_0, ) => {
2682 Restricted (
2683 _visitor.fold_vis_restricted(_binding_0),
2684 )
2685 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002686 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002687 }
2688}
2689
Nika Layzella6f46c42017-10-26 15:26:16 -04002690pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002691 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002692 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002693 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002694 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002695 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002696 }
2697}
2698
Nika Layzella6f46c42017-10-26 15:26:16 -04002699pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002700 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002701 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002702 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2703 }
2704}
2705
Nika Layzella6f46c42017-10-26 15:26:16 -04002706pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002707 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002708 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002709 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002710 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002711 }
2712}
2713
Nika Layzella6f46c42017-10-26 15:26:16 -04002714pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002715 use ::WherePredicate::*;
2716 match _i {
2717 BoundPredicate(_binding_0, ) => {
2718 BoundPredicate (
2719 _visitor.fold_where_bound_predicate(_binding_0),
2720 )
2721 }
2722 RegionPredicate(_binding_0, ) => {
2723 RegionPredicate (
2724 _visitor.fold_where_region_predicate(_binding_0),
2725 )
2726 }
2727 EqPredicate(_binding_0, ) => {
2728 EqPredicate (
2729 _visitor.fold_where_eq_predicate(_binding_0),
2730 )
2731 }
2732 }
2733}
2734
Nika Layzella6f46c42017-10-26 15:26:16 -04002735pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002736 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002737 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002738 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002739 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002740 }
2741}
2742