blob: c30bdf4e59523ba555abafcf5daa1730575c0506 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046
Nika Layzellc08227a2017-12-04 16:30:17 -050047fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
Nika Layzella6f46c42017-10-26 15:26:16 -040065fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050076
77fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122
David Tolnay8c91b882017-12-28 23:04:32 -0500123fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500127fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500141fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500147fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500153fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800178# [ cfg ( feature = "full" ) ]
179fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180
Nika Layzellc08227a2017-12-04 16:30:17 -0500181fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500182# [ cfg ( feature = "full" ) ]
183fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500184
David Tolnayc2f1aba2017-11-12 20:29:22 -0800185fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
186
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500188
189fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800195fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500200
David Tolnay85b69a42017-12-27 20:43:10 -0500201fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800219fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800221fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800231fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236
David Tolnay4ba63a02017-12-28 15:53:05 -0500237fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
238
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500240
241fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244
David Tolnaydecf28d2017-11-11 11:56:45 -0800245fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500246
David Tolnay85b69a42017-12-27 20:43:10 -0500247fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800248
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500256# [ cfg ( feature = "full" ) ]
257fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzellc08227a2017-12-04 16:30:17 -0500261fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500288
289fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800298
299fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500300
301fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800311fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800317fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800319fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800321fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800325fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
326
327fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
328
329fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
330
331fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
332
333fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
334
335fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
336
337fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
338
339fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
340
341fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
342
David Tolnay0a89b4d2017-11-13 00:55:45 -0800343fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800344
345fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
346
347fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
348
David Tolnay05362582017-12-26 01:33:57 -0500349fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800350
Nika Layzella6f46c42017-10-26 15:26:16 -0400351fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500352# [ cfg ( feature = "full" ) ]
353fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
354# [ cfg ( feature = "full" ) ]
355fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
356# [ cfg ( feature = "full" ) ]
357fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
358# [ cfg ( feature = "full" ) ]
359fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400360
Nika Layzella6f46c42017-10-26 15:26:16 -0400361fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
383}
384
David Tolnayd0adf522017-12-29 01:30:07 -0500385pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
386 _i.span = _visitor.fold_span(_i.span);
387 _i
388}
389
390pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
391 _i.span = _visitor.fold_span(_i.span);
392 _i
393}
394
Nika Layzell27726662017-10-24 23:16:35 -0400395
Nika Layzella6f46c42017-10-26 15:26:16 -0400396pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400397 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500398 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400399 kind: _visitor.fold_abi_kind(_i . kind),
400 }
401}
402
Nika Layzella6f46c42017-10-26 15:26:16 -0400403pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400404 use ::AbiKind::*;
405 match _i {
406 Named(_binding_0, ) => {
407 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500408 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400409 )
410 }
411 Default => { Default }
412 }
413}
414
Nika Layzellc08227a2017-12-04 16:30:17 -0500415pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
416 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500417 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500418 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500419 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500420 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400421 }
422}
423# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400424pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400425 ArgCaptured {
426 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500427 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800428 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400429 }
430}
431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400432pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400433 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500434 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500435 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400436 }
437}
438# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400439pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400440 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500442 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500443 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500444 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400445 }
446}
447# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400448pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400449 Arm {
450 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
451 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500452 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400453 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500454 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400455 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400457 }
458}
459
Nika Layzella6f46c42017-10-26 15:26:16 -0400460pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400461 use ::AttrStyle::*;
462 match _i {
463 Outer => { Outer }
464 Inner(_binding_0, ) => {
465 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500466 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400467 )
468 }
469 }
470}
471
Nika Layzella6f46c42017-10-26 15:26:16 -0400472pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400473 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500475 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500476 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400477 path: _visitor.fold_path(_i . path),
478 tts: _i . tts,
479 is_sugared_doc: _i . is_sugared_doc,
480 }
481}
482
Nika Layzella6f46c42017-10-26 15:26:16 -0400483pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400484 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500485 name: (_i . name).map(|it| { (
486 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500487 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500488 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800489 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400490 }
491}
492
Nika Layzella6f46c42017-10-26 15:26:16 -0400493pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400494 use ::BareFnArgName::*;
495 match _i {
496 Named(_binding_0, ) => {
497 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500498 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400499 )
500 }
501 Wild(_binding_0, ) => {
502 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500503 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400504 )
505 }
506 }
507}
508
Nika Layzella6f46c42017-10-26 15:26:16 -0400509pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400510 use ::BinOp::*;
511 match _i {
512 Add(_binding_0, ) => {
513 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500514 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400515 )
516 }
517 Sub(_binding_0, ) => {
518 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500519 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 )
521 }
522 Mul(_binding_0, ) => {
523 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500524 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400525 )
526 }
527 Div(_binding_0, ) => {
528 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400530 )
531 }
532 Rem(_binding_0, ) => {
533 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500534 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400535 )
536 }
537 And(_binding_0, ) => {
538 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500539 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
542 Or(_binding_0, ) => {
543 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
547 BitXor(_binding_0, ) => {
548 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500549 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400550 )
551 }
552 BitAnd(_binding_0, ) => {
553 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
557 BitOr(_binding_0, ) => {
558 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
562 Shl(_binding_0, ) => {
563 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
567 Shr(_binding_0, ) => {
568 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
572 Eq(_binding_0, ) => {
573 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
577 Lt(_binding_0, ) => {
578 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
582 Le(_binding_0, ) => {
583 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
587 Ne(_binding_0, ) => {
588 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
592 Ge(_binding_0, ) => {
593 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
597 Gt(_binding_0, ) => {
598 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
602 AddEq(_binding_0, ) => {
603 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
607 SubEq(_binding_0, ) => {
608 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
612 MulEq(_binding_0, ) => {
613 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
617 DivEq(_binding_0, ) => {
618 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
622 RemEq(_binding_0, ) => {
623 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
627 BitXorEq(_binding_0, ) => {
628 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
632 BitAndEq(_binding_0, ) => {
633 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
637 BitOrEq(_binding_0, ) => {
638 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
642 ShlEq(_binding_0, ) => {
643 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
647 ShrEq(_binding_0, ) => {
648 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
652 }
653}
654# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400655pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400656 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500657 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400658 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
659 }
660}
661
Nika Layzella6f46c42017-10-26 15:26:16 -0400662pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400663 use ::Body::*;
664 match _i {
665 Enum(_binding_0, ) => {
666 Enum (
667 _visitor.fold_body_enum(_binding_0),
668 )
669 }
670 Struct(_binding_0, ) => {
671 Struct (
672 _visitor.fold_body_struct(_binding_0),
673 )
674 }
675 }
676}
677
Nika Layzella6f46c42017-10-26 15:26:16 -0400678pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400679 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500680 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500681 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400682 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
683 }
684}
685
Nika Layzella6f46c42017-10-26 15:26:16 -0400686pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400687 BodyStruct {
688 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500689 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
690 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400691 }
692}
693
Nika Layzella6f46c42017-10-26 15:26:16 -0400694pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400695 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500696 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
697 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400698 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500699 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400700 }
701}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500702
703pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
704 ConstParam {
705 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500706 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500707 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500708 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500709 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500710 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500711 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
712 }
713}
Nika Layzell27726662017-10-24 23:16:35 -0400714
Nika Layzella6f46c42017-10-26 15:26:16 -0400715pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400716 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500718 vis: _visitor.fold_visibility(_i . vis),
719 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400720 generics: _visitor.fold_generics(_i . generics),
721 body: _visitor.fold_body(_i . body),
722 }
723}
724
Nika Layzella6f46c42017-10-26 15:26:16 -0400725pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500726 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400727 match _i {
728 Box(_binding_0, ) => {
729 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400730 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400731 )
732 }
733 InPlace(_binding_0, ) => {
734 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400735 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400736 )
737 }
738 Array(_binding_0, ) => {
739 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400740 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400741 )
742 }
743 Call(_binding_0, ) => {
744 Call (
745 _visitor.fold_expr_call(_binding_0),
746 )
747 }
748 MethodCall(_binding_0, ) => {
749 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400750 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400751 )
752 }
David Tolnay05362582017-12-26 01:33:57 -0500753 Tuple(_binding_0, ) => {
754 Tuple (
755 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400756 )
757 }
758 Binary(_binding_0, ) => {
759 Binary (
760 _visitor.fold_expr_binary(_binding_0),
761 )
762 }
763 Unary(_binding_0, ) => {
764 Unary (
765 _visitor.fold_expr_unary(_binding_0),
766 )
767 }
768 Lit(_binding_0, ) => {
769 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500770 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400771 )
772 }
773 Cast(_binding_0, ) => {
774 Cast (
775 _visitor.fold_expr_cast(_binding_0),
776 )
777 }
778 Type(_binding_0, ) => {
779 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500780 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 If(_binding_0, ) => {
784 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400785 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400786 )
787 }
788 IfLet(_binding_0, ) => {
789 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400790 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400791 )
792 }
793 While(_binding_0, ) => {
794 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400795 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400796 )
797 }
798 WhileLet(_binding_0, ) => {
799 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400800 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400801 )
802 }
803 ForLoop(_binding_0, ) => {
804 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
808 Loop(_binding_0, ) => {
809 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400810 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
813 Match(_binding_0, ) => {
814 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400815 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400816 )
817 }
818 Closure(_binding_0, ) => {
819 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400820 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400821 )
822 }
Nika Layzell640832a2017-12-04 13:37:09 -0500823 Unsafe(_binding_0, ) => {
824 Unsafe (
825 full!(_visitor.fold_expr_unsafe(_binding_0)),
826 )
827 }
Nika Layzell27726662017-10-24 23:16:35 -0400828 Block(_binding_0, ) => {
829 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400830 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400831 )
832 }
833 Assign(_binding_0, ) => {
834 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400835 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400836 )
837 }
838 AssignOp(_binding_0, ) => {
839 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400840 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400841 )
842 }
843 Field(_binding_0, ) => {
844 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400845 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400846 )
847 }
Nika Layzell27726662017-10-24 23:16:35 -0400848 Index(_binding_0, ) => {
849 Index (
850 _visitor.fold_expr_index(_binding_0),
851 )
852 }
853 Range(_binding_0, ) => {
854 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
858 Path(_binding_0, ) => {
859 Path (
860 _visitor.fold_expr_path(_binding_0),
861 )
862 }
863 AddrOf(_binding_0, ) => {
864 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400865 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400866 )
867 }
868 Break(_binding_0, ) => {
869 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400870 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400871 )
872 }
873 Continue(_binding_0, ) => {
874 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400875 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400876 )
877 }
David Tolnayc246cd32017-12-28 23:14:32 -0500878 Return(_binding_0, ) => {
879 Return (
880 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400881 )
882 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800883 Macro(_binding_0, ) => {
884 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500885 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
888 Struct(_binding_0, ) => {
889 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400890 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
893 Repeat(_binding_0, ) => {
894 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400895 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400896 )
897 }
898 Paren(_binding_0, ) => {
899 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500900 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
903 Group(_binding_0, ) => {
904 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500905 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400906 )
907 }
908 Try(_binding_0, ) => {
909 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400910 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
913 Catch(_binding_0, ) => {
914 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400915 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400916 )
917 }
918 Yield(_binding_0, ) => {
919 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400920 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400921 )
922 }
923 }
924}
925# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500926pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
927 ExprAddrOf {
928 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
929 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500930 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500931 expr: Box::new(_visitor.fold_expr(* _i . expr)),
932 }
933}
934# [ cfg ( feature = "full" ) ]
935pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
936 ExprArray {
937 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
938 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500939 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500940 }
941}
942# [ cfg ( feature = "full" ) ]
943pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
944 ExprAssign {
945 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
946 left: Box::new(_visitor.fold_expr(* _i . left)),
947 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
948 right: Box::new(_visitor.fold_expr(* _i . right)),
949 }
950}
951# [ cfg ( feature = "full" ) ]
952pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
953 ExprAssignOp {
954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
955 left: Box::new(_visitor.fold_expr(* _i . left)),
956 op: _visitor.fold_bin_op(_i . op),
957 right: Box::new(_visitor.fold_expr(* _i . right)),
958 }
959}
960
961pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
962 ExprBinary {
963 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
964 left: Box::new(_visitor.fold_expr(* _i . left)),
965 op: _visitor.fold_bin_op(_i . op),
966 right: Box::new(_visitor.fold_expr(* _i . right)),
967 }
968}
969# [ cfg ( feature = "full" ) ]
970pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
971 ExprBlock {
972 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
973 block: _visitor.fold_block(_i . block),
974 }
975}
976# [ cfg ( feature = "full" ) ]
977pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
978 ExprBox {
979 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
980 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
981 expr: Box::new(_visitor.fold_expr(* _i . expr)),
982 }
983}
984# [ cfg ( feature = "full" ) ]
985pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
986 ExprBreak {
987 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
988 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
989 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
990 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
991 }
992}
993
994pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
995 ExprCall {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 func: Box::new(_visitor.fold_expr(* _i . func)),
998 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
999 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1000 }
1001}
1002
1003pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1004 ExprCast {
1005 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1006 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1007 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1008 ty: Box::new(_visitor.fold_type(* _i . ty)),
1009 }
1010}
1011# [ cfg ( feature = "full" ) ]
1012pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1013 ExprCatch {
1014 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1015 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1016 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1017 block: _visitor.fold_block(_i . block),
1018 }
1019}
1020# [ cfg ( feature = "full" ) ]
1021pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1022 ExprClosure {
1023 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001024 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001025 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1026 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1027 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1028 output: _visitor.fold_return_type(_i . output),
1029 body: Box::new(_visitor.fold_expr(* _i . body)),
1030 }
1031}
1032# [ cfg ( feature = "full" ) ]
1033pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1034 ExprContinue {
1035 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1036 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1037 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1038 }
1039}
1040# [ cfg ( feature = "full" ) ]
1041pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1042 ExprField {
1043 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1044 base: Box::new(_visitor.fold_expr(* _i . base)),
1045 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1046 member: _visitor.fold_member(_i . member),
1047 }
1048}
1049# [ cfg ( feature = "full" ) ]
1050pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1051 ExprForLoop {
1052 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1053 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1054 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1055 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1056 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1057 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1058 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1059 body: _visitor.fold_block(_i . body),
1060 }
1061}
David Tolnaye98775f2017-12-28 23:17:00 -05001062# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001063pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1064 ExprGroup {
1065 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1066 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1067 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1068 }
1069}
1070# [ cfg ( feature = "full" ) ]
1071pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1072 ExprIf {
1073 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1074 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1075 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001076 then_branch: _visitor.fold_block(_i . then_branch),
1077 else_branch: (_i . else_branch).map(|it| { (
1078 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1079 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1080 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001081 }
1082}
1083# [ cfg ( feature = "full" ) ]
1084pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1085 ExprIfLet {
1086 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1087 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1088 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1089 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1090 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1091 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001092 then_branch: _visitor.fold_block(_i . then_branch),
1093 else_branch: (_i . else_branch).map(|it| { (
1094 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1095 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1096 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001097 }
1098}
1099# [ cfg ( feature = "full" ) ]
1100pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1101 ExprInPlace {
1102 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1103 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001104 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001105 value: Box::new(_visitor.fold_expr(* _i . value)),
1106 }
1107}
1108
1109pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1110 ExprIndex {
1111 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1112 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1113 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1114 index: Box::new(_visitor.fold_expr(* _i . index)),
1115 }
1116}
1117
1118pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1119 ExprLit {
1120 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1121 lit: _visitor.fold_lit(_i . lit),
1122 }
1123}
1124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001125pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001126 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001127 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001128 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001129 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001130 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1131 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001132 }
1133}
1134# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001135pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1136 ExprMacro {
1137 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1138 mac: _visitor.fold_macro(_i . mac),
1139 }
1140}
1141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001142pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001143 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001144 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001145 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001146 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001147 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001148 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1149 }
1150}
1151# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001152pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001153 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001154 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001155 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001156 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001157 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001158 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001159 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1160 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001161 }
1162}
David Tolnaye98775f2017-12-28 23:17:00 -05001163# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001164pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001165 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001166 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001167 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001168 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001169 }
1170}
1171
Nika Layzella6f46c42017-10-26 15:26:16 -04001172pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001173 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001174 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001175 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001176 path: _visitor.fold_path(_i . path),
1177 }
1178}
1179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001180pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001181 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001182 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001183 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001184 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001185 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001186 }
1187}
1188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001189pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001190 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001191 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001192 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001193 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001194 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001195 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1196 }
1197}
1198# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001199pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1200 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001201 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001202 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001203 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001204 }
1205}
1206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001207pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001208 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001209 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001210 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001211 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001212 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1213 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1214 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001215 }
1216}
1217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001218pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001219 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001220 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001221 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001222 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001223 }
1224}
1225# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001226pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1227 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001229 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001230 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001231 }
1232}
David Tolnay0cf94f22017-12-28 23:46:26 -05001233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001234pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001236 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001237 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001238 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001239 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001240 }
1241}
1242
Nika Layzella6f46c42017-10-26 15:26:16 -04001243pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001244 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001245 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001246 op: _visitor.fold_un_op(_i . op),
1247 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1248 }
1249}
1250# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001251pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1252 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001253 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001254 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001255 block: _visitor.fold_block(_i . block),
1256 }
1257}
1258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001259pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001260 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001261 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001262 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001263 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1264 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001265 cond: Box::new(_visitor.fold_expr(* _i . cond)),
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_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001271 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001272 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001273 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001274 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1275 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1276 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001277 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001278 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001279 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1280 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001281 }
1282}
1283# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001284pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001285 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001286 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001287 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001288 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001289 }
1290}
1291
Nika Layzella6f46c42017-10-26 15:26:16 -04001292pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001293 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001294 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001295 vis: _visitor.fold_visibility(_i . vis),
1296 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001297 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001298 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001299 }
1300}
1301# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001302pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001303 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001305 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001306 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001307 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001308 }
1309}
1310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001311pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001312 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001313 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1314 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001315 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001316 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001317 }
1318}
1319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001320pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001321 File {
1322 shebang: _i . shebang,
1323 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1324 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1325 }
1326}
1327# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001328pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001329 use ::FnArg::*;
1330 match _i {
1331 SelfRef(_binding_0, ) => {
1332 SelfRef (
1333 _visitor.fold_arg_self_ref(_binding_0),
1334 )
1335 }
1336 SelfValue(_binding_0, ) => {
1337 SelfValue (
1338 _visitor.fold_arg_self(_binding_0),
1339 )
1340 }
1341 Captured(_binding_0, ) => {
1342 Captured (
1343 _visitor.fold_arg_captured(_binding_0),
1344 )
1345 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001346 Inferred(_binding_0, ) => {
1347 Inferred (
1348 _visitor.fold_pat(_binding_0),
1349 )
1350 }
Nika Layzell27726662017-10-24 23:16:35 -04001351 Ignored(_binding_0, ) => {
1352 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001353 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001354 )
1355 }
1356 }
1357}
1358# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001359pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001360 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001361 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001362 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001363 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001364 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001365 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001366 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001367 }
1368}
1369# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001370pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001371 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001372 match _i {
1373 Fn(_binding_0, ) => {
1374 Fn (
1375 _visitor.fold_foreign_item_fn(_binding_0),
1376 )
1377 }
1378 Static(_binding_0, ) => {
1379 Static (
1380 _visitor.fold_foreign_item_static(_binding_0),
1381 )
1382 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001383 Type(_binding_0, ) => {
1384 Type (
1385 _visitor.fold_foreign_item_type(_binding_0),
1386 )
1387 }
Nika Layzell27726662017-10-24 23:16:35 -04001388 }
1389}
1390# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001391pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1392 ForeignItemFn {
1393 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1394 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001395 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001396 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001397 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001398 }
1399}
1400# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001401pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001402 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001403 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1404 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001405 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001406 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001407 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001408 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001409 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001410 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001411 }
1412}
David Tolnay199bcbb2017-11-12 10:33:52 -08001413# [ cfg ( feature = "full" ) ]
1414pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1415 ForeignItemType {
1416 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1417 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001418 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001419 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001420 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001421 }
1422}
Nika Layzell27726662017-10-24 23:16:35 -04001423
Nika Layzellc08227a2017-12-04 16:30:17 -05001424pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1425 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001426 match _i {
1427 Lifetime(_binding_0, ) => {
1428 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001429 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001430 )
1431 }
1432 Type(_binding_0, ) => {
1433 Type (
1434 _visitor.fold_type(_binding_0),
1435 )
1436 }
1437 TypeBinding(_binding_0, ) => {
1438 TypeBinding (
1439 _visitor.fold_type_binding(_binding_0),
1440 )
1441 }
Nika Layzellc680e612017-12-04 19:07:20 -05001442 Const(_binding_0, ) => {
1443 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001444 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001445 )
1446 }
Nika Layzell357885a2017-12-04 15:47:07 -05001447 }
1448}
David Tolnayd60cfec2017-12-29 00:21:38 -05001449# [ cfg ( feature = "full" ) ]
1450pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1451 use ::GenericMethodArgument::*;
1452 match _i {
1453 Type(_binding_0, ) => {
1454 Type (
1455 _visitor.fold_type(_binding_0),
1456 )
1457 }
1458 Const(_binding_0, ) => {
1459 Const (
1460 _visitor.fold_expr(_binding_0),
1461 )
1462 }
1463 }
1464}
Nika Layzell357885a2017-12-04 15:47:07 -05001465
David Tolnayc2f1aba2017-11-12 20:29:22 -08001466pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1467 use ::GenericParam::*;
1468 match _i {
1469 Lifetime(_binding_0, ) => {
1470 Lifetime (
1471 _visitor.fold_lifetime_def(_binding_0),
1472 )
1473 }
1474 Type(_binding_0, ) => {
1475 Type (
1476 _visitor.fold_type_param(_binding_0),
1477 )
1478 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001479 Const(_binding_0, ) => {
1480 Const (
1481 _visitor.fold_const_param(_binding_0),
1482 )
1483 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001484 }
1485}
1486
Nika Layzella6f46c42017-10-26 15:26:16 -04001487pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001488 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001489 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001490 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001491 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001492 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001493 }
1494}
1495# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001496pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001497 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001498 match _i {
1499 Const(_binding_0, ) => {
1500 Const (
1501 _visitor.fold_impl_item_const(_binding_0),
1502 )
1503 }
1504 Method(_binding_0, ) => {
1505 Method (
1506 _visitor.fold_impl_item_method(_binding_0),
1507 )
1508 }
1509 Type(_binding_0, ) => {
1510 Type (
1511 _visitor.fold_impl_item_type(_binding_0),
1512 )
1513 }
1514 Macro(_binding_0, ) => {
1515 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001516 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001517 )
1518 }
1519 }
1520}
1521# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001522pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1523 ImplItemConst {
1524 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1525 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001526 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001527 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001528 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001529 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001530 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001531 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001532 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001533 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001534 }
1535}
1536# [ cfg ( feature = "full" ) ]
1537pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1538 ImplItemMacro {
1539 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1540 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001541 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001542 }
1543}
1544# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001545pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001546 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001547 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001548 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001549 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001550 sig: _visitor.fold_method_sig(_i . sig),
1551 block: _visitor.fold_block(_i . block),
1552 }
1553}
1554# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001555pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001556 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001557 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001558 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001559 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001560 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001561 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001562 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001563 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001564 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001565 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001566 }
1567}
David Tolnay14982012017-12-29 00:49:51 -05001568
David Tolnay85b69a42017-12-27 20:43:10 -05001569pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1570 Index {
1571 index: _i . index,
1572 span: _visitor.fold_span(_i . span),
1573 }
1574}
1575# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001576pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001577 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001578 match _i {
1579 ExternCrate(_binding_0, ) => {
1580 ExternCrate (
1581 _visitor.fold_item_extern_crate(_binding_0),
1582 )
1583 }
1584 Use(_binding_0, ) => {
1585 Use (
1586 _visitor.fold_item_use(_binding_0),
1587 )
1588 }
1589 Static(_binding_0, ) => {
1590 Static (
1591 _visitor.fold_item_static(_binding_0),
1592 )
1593 }
1594 Const(_binding_0, ) => {
1595 Const (
1596 _visitor.fold_item_const(_binding_0),
1597 )
1598 }
1599 Fn(_binding_0, ) => {
1600 Fn (
1601 _visitor.fold_item_fn(_binding_0),
1602 )
1603 }
1604 Mod(_binding_0, ) => {
1605 Mod (
1606 _visitor.fold_item_mod(_binding_0),
1607 )
1608 }
1609 ForeignMod(_binding_0, ) => {
1610 ForeignMod (
1611 _visitor.fold_item_foreign_mod(_binding_0),
1612 )
1613 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001614 Type(_binding_0, ) => {
1615 Type (
1616 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001617 )
1618 }
1619 Enum(_binding_0, ) => {
1620 Enum (
1621 _visitor.fold_item_enum(_binding_0),
1622 )
1623 }
1624 Struct(_binding_0, ) => {
1625 Struct (
1626 _visitor.fold_item_struct(_binding_0),
1627 )
1628 }
1629 Union(_binding_0, ) => {
1630 Union (
1631 _visitor.fold_item_union(_binding_0),
1632 )
1633 }
1634 Trait(_binding_0, ) => {
1635 Trait (
1636 _visitor.fold_item_trait(_binding_0),
1637 )
1638 }
1639 DefaultImpl(_binding_0, ) => {
1640 DefaultImpl (
1641 _visitor.fold_item_default_impl(_binding_0),
1642 )
1643 }
1644 Impl(_binding_0, ) => {
1645 Impl (
1646 _visitor.fold_item_impl(_binding_0),
1647 )
1648 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001649 Macro(_binding_0, ) => {
1650 Macro (
1651 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001652 )
1653 }
David Tolnay500d8322017-12-18 00:32:51 -08001654 Macro2(_binding_0, ) => {
1655 Macro2 (
1656 _visitor.fold_item_macro2(_binding_0),
1657 )
1658 }
Nika Layzell27726662017-10-24 23:16:35 -04001659 }
1660}
1661# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001662pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1663 ItemConst {
1664 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1665 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001666 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001667 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001668 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001669 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001670 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001671 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001672 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001673 }
1674}
1675# [ cfg ( feature = "full" ) ]
1676pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1677 ItemDefaultImpl {
1678 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay9b258702017-12-29 02:24:41 -05001679 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001680 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001681 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001682 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1683 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001684 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001685 }
1686}
1687# [ cfg ( feature = "full" ) ]
1688pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1689 ItemEnum {
1690 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1691 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001692 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001693 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001694 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001695 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001696 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1697 }
1698}
1699# [ cfg ( feature = "full" ) ]
1700pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1701 ItemExternCrate {
1702 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1703 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001704 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1705 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001706 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001707 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001708 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001709 _visitor.fold_ident(( it ) . 1),
1710 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001711 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001712 }
1713}
1714# [ cfg ( feature = "full" ) ]
1715pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1716 ItemFn {
1717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1718 vis: _visitor.fold_visibility(_i . vis),
David Tolnay360a6342017-12-29 02:22:11 -05001719 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001720 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001721 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001722 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001723 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001724 block: Box::new(_visitor.fold_block(* _i . block)),
1725 }
1726}
1727# [ cfg ( feature = "full" ) ]
1728pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1729 ItemForeignMod {
1730 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1731 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001732 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001733 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1734 }
1735}
1736# [ cfg ( feature = "full" ) ]
1737pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1738 ItemImpl {
1739 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay360a6342017-12-29 02:22:11 -05001740 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001741 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001742 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001744 trait_: (_i . trait_).map(|it| { (
David Tolnay360a6342017-12-29 02:22:11 -05001745 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001746 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001747 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001748 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001749 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001750 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001751 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1752 }
1753}
1754# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001755pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1756 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001758 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001759 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001760 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001761 }
1762}
1763# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001764pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1765 ItemMacro2 {
1766 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1767 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001768 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001769 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001770 args: _i . args,
1771 body: _i . body,
1772 }
1773}
1774# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001775pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001776 ItemMod {
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 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001780 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001781 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001782 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001783 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1784 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001785 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001786 }
1787}
1788# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001789pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001790 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001792 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001793 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001794 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001795 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001796 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001797 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001798 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001799 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001801 }
1802}
1803# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001804pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001805 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001806 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001807 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_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),
1811 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001812 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001813 }
1814}
1815# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001816pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001817 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001818 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001819 vis: _visitor.fold_visibility(_i . vis),
David Tolnay9b258702017-12-29 02:24:41 -05001820 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001821 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1822 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_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 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001826 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001827 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001828 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1829 }
1830}
1831# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001832pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1833 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001834 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001835 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001836 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001837 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001838 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001839 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001840 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001841 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001842 }
1843}
1844# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001845pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001846 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001847 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001848 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001849 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001850 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001851 generics: _visitor.fold_generics(_i . generics),
1852 data: _visitor.fold_variant_data(_i . data),
1853 }
1854}
1855# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001856pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001857 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001858 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001859 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001860 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1861 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001862 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1863 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001865 }
1866}
1867
Nika Layzella6f46c42017-10-26 15:26:16 -04001868pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001869 LifetimeDef {
1870 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001871 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001872 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001873 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1874 }
1875}
1876
1877pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1878 Lit {
1879 value: _i . value,
1880 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001881 }
1882}
1883# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001884pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001885 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001886 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001887 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1888 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1889 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1890 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1891 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1892 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1893 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001894 }
1895}
Nika Layzell27726662017-10-24 23:16:35 -04001896
David Tolnaydecf28d2017-11-11 11:56:45 -08001897pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1898 Macro {
1899 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001900 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001901 tokens: _i . tokens,
1902 }
1903}
David Tolnay14982012017-12-29 00:49:51 -05001904
David Tolnay85b69a42017-12-27 20:43:10 -05001905pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1906 use ::Member::*;
1907 match _i {
1908 Named(_binding_0, ) => {
1909 Named (
1910 _visitor.fold_ident(_binding_0),
1911 )
1912 }
1913 Unnamed(_binding_0, ) => {
1914 Unnamed (
1915 _visitor.fold_index(_binding_0),
1916 )
1917 }
1918 }
1919}
David Tolnaydecf28d2017-11-11 11:56:45 -08001920
Nika Layzella6f46c42017-10-26 15:26:16 -04001921pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001922 use ::MetaItem::*;
1923 match _i {
1924 Term(_binding_0, ) => {
1925 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001926 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001927 )
1928 }
1929 List(_binding_0, ) => {
1930 List (
1931 _visitor.fold_meta_item_list(_binding_0),
1932 )
1933 }
1934 NameValue(_binding_0, ) => {
1935 NameValue (
1936 _visitor.fold_meta_name_value(_binding_0),
1937 )
1938 }
1939 }
1940}
1941
Nika Layzella6f46c42017-10-26 15:26:16 -04001942pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001943 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001944 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001945 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001946 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1947 }
1948}
1949
Nika Layzella6f46c42017-10-26 15:26:16 -04001950pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001951 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05001952 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001953 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05001954 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04001955 }
1956}
1957# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001958pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001959 MethodSig {
David Tolnay360a6342017-12-29 02:22:11 -05001960 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay9b258702017-12-29 02:24:41 -05001961 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001962 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001963 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001964 decl: _visitor.fold_fn_decl(_i . decl),
1965 }
1966}
David Tolnayd60cfec2017-12-29 00:21:38 -05001967# [ cfg ( feature = "full" ) ]
1968pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
1969 MethodTurbofish {
1970 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
1971 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
1972 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
1973 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
1974 }
1975}
Nika Layzell27726662017-10-24 23:16:35 -04001976
Nika Layzella6f46c42017-10-26 15:26:16 -04001977pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001978 use ::NestedMetaItem::*;
1979 match _i {
1980 MetaItem(_binding_0, ) => {
1981 MetaItem (
1982 _visitor.fold_meta_item(_binding_0),
1983 )
1984 }
1985 Literal(_binding_0, ) => {
1986 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05001987 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001988 )
1989 }
1990 }
1991}
1992
Nika Layzellc08227a2017-12-04 16:30:17 -05001993pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
1994 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05001995 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001996 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001997 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001998 }
1999}
2000# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002001pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002002 use ::Pat::*;
2003 match _i {
2004 Wild(_binding_0, ) => {
2005 Wild (
2006 _visitor.fold_pat_wild(_binding_0),
2007 )
2008 }
2009 Ident(_binding_0, ) => {
2010 Ident (
2011 _visitor.fold_pat_ident(_binding_0),
2012 )
2013 }
2014 Struct(_binding_0, ) => {
2015 Struct (
2016 _visitor.fold_pat_struct(_binding_0),
2017 )
2018 }
2019 TupleStruct(_binding_0, ) => {
2020 TupleStruct (
2021 _visitor.fold_pat_tuple_struct(_binding_0),
2022 )
2023 }
2024 Path(_binding_0, ) => {
2025 Path (
2026 _visitor.fold_pat_path(_binding_0),
2027 )
2028 }
2029 Tuple(_binding_0, ) => {
2030 Tuple (
2031 _visitor.fold_pat_tuple(_binding_0),
2032 )
2033 }
2034 Box(_binding_0, ) => {
2035 Box (
2036 _visitor.fold_pat_box(_binding_0),
2037 )
2038 }
2039 Ref(_binding_0, ) => {
2040 Ref (
2041 _visitor.fold_pat_ref(_binding_0),
2042 )
2043 }
2044 Lit(_binding_0, ) => {
2045 Lit (
2046 _visitor.fold_pat_lit(_binding_0),
2047 )
2048 }
2049 Range(_binding_0, ) => {
2050 Range (
2051 _visitor.fold_pat_range(_binding_0),
2052 )
2053 }
2054 Slice(_binding_0, ) => {
2055 Slice (
2056 _visitor.fold_pat_slice(_binding_0),
2057 )
2058 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002059 Macro(_binding_0, ) => {
2060 Macro (
2061 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002062 )
2063 }
2064 }
2065}
2066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002067pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002068 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002069 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002070 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002071 }
2072}
2073# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002074pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002075 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002076 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2077 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002078 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002079 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002080 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002081 }
2082}
2083# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002084pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002085 PatLit {
2086 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2087 }
2088}
2089# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002090pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002091 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002092 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002093 path: _visitor.fold_path(_i . path),
2094 }
2095}
2096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002097pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002098 PatRange {
2099 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002100 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002101 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002102 }
2103}
2104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002105pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002106 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002107 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002108 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002109 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002110 }
2111}
2112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002113pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002114 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002115 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002116 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002117 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002118 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002119 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002120 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002121 }
2122}
2123# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002124pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002125 PatStruct {
2126 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002127 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002128 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002129 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002130 }
2131}
2132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002133pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002134 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002135 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002136 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002137 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002138 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2139 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002140 }
2141}
2142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002143pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002144 PatTupleStruct {
2145 path: _visitor.fold_path(_i . path),
2146 pat: _visitor.fold_pat_tuple(_i . pat),
2147 }
2148}
2149# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002150pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002151 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002152 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002153 }
2154}
2155
Nika Layzella6f46c42017-10-26 15:26:16 -04002156pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002157 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002158 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002159 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2160 }
2161}
Nika Layzellc08227a2017-12-04 16:30:17 -05002162
2163pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2164 use ::PathArguments::*;
2165 match _i {
2166 None => { None }
2167 AngleBracketed(_binding_0, ) => {
2168 AngleBracketed (
2169 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2170 )
2171 }
2172 Parenthesized(_binding_0, ) => {
2173 Parenthesized (
2174 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2175 )
2176 }
2177 }
2178}
Nika Layzell27726662017-10-24 23:16:35 -04002179
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002181 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002182 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002183 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
2185}
Nika Layzell27726662017-10-24 23:16:35 -04002186
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002188 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002189 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002190 trait_ref: _visitor.fold_path(_i . trait_ref),
2191 }
2192}
2193
Nika Layzella6f46c42017-10-26 15:26:16 -04002194pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002195 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002196 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002197 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002198 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002199 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2200 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002201 }
2202}
2203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002205 use ::RangeLimits::*;
2206 match _i {
2207 HalfOpen(_binding_0, ) => {
2208 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002209 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002210 )
2211 }
2212 Closed(_binding_0, ) => {
2213 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002214 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002215 )
2216 }
2217 }
2218}
David Tolnayf93b90d2017-11-11 19:21:26 -08002219
2220pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2221 use ::ReturnType::*;
2222 match _i {
2223 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002224 Type(_binding_0, _binding_1, ) => {
2225 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002226 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2227 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002228 )
2229 }
2230 }
2231}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002232
2233pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2234 _i
2235}
Nika Layzell27726662017-10-24 23:16:35 -04002236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002237pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002238 use ::Stmt::*;
2239 match _i {
2240 Local(_binding_0, ) => {
2241 Local (
2242 Box::new(_visitor.fold_local(* _binding_0)),
2243 )
2244 }
2245 Item(_binding_0, ) => {
2246 Item (
2247 Box::new(_visitor.fold_item(* _binding_0)),
2248 )
2249 }
2250 Expr(_binding_0, ) => {
2251 Expr (
2252 Box::new(_visitor.fold_expr(* _binding_0)),
2253 )
2254 }
2255 Semi(_binding_0, _binding_1, ) => {
2256 Semi (
2257 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002258 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002259 )
2260 }
Nika Layzell27726662017-10-24 23:16:35 -04002261 }
2262}
2263
Nika Layzella6f46c42017-10-26 15:26:16 -04002264pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002265 use ::TraitBoundModifier::*;
2266 match _i {
2267 None => { None }
2268 Maybe(_binding_0, ) => {
2269 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002270 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002271 )
2272 }
2273 }
2274}
2275# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002276pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002277 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002278 match _i {
2279 Const(_binding_0, ) => {
2280 Const (
2281 _visitor.fold_trait_item_const(_binding_0),
2282 )
2283 }
2284 Method(_binding_0, ) => {
2285 Method (
2286 _visitor.fold_trait_item_method(_binding_0),
2287 )
2288 }
2289 Type(_binding_0, ) => {
2290 Type (
2291 _visitor.fold_trait_item_type(_binding_0),
2292 )
2293 }
2294 Macro(_binding_0, ) => {
2295 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002296 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002297 )
2298 }
2299 }
2300}
2301# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002302pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2303 TraitItemConst {
2304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002305 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002306 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002307 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002308 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002309 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002310 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002311 _visitor.fold_expr(( it ) . 1),
2312 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002313 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002314 }
2315}
2316# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002317pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2318 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002320 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002321 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002322 }
2323}
2324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002325pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002326 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002327 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002328 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002329 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002330 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002331 }
2332}
2333# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002334pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002335 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002336 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002337 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002338 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002339 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002340 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002341 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002342 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002343 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002344 _visitor.fold_type(( it ) . 1),
2345 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002346 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002347 }
2348}
2349
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002350pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2351 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002352 match _i {
2353 Slice(_binding_0, ) => {
2354 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002355 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002356 )
2357 }
2358 Array(_binding_0, ) => {
2359 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002360 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002361 )
2362 }
2363 Ptr(_binding_0, ) => {
2364 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002365 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002366 )
2367 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002368 Reference(_binding_0, ) => {
2369 Reference (
2370 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002371 )
2372 }
2373 BareFn(_binding_0, ) => {
2374 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002375 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002376 )
2377 }
2378 Never(_binding_0, ) => {
2379 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002380 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002381 )
2382 }
David Tolnay05362582017-12-26 01:33:57 -05002383 Tuple(_binding_0, ) => {
2384 Tuple (
2385 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002386 )
2387 }
2388 Path(_binding_0, ) => {
2389 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002390 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002391 )
2392 }
2393 TraitObject(_binding_0, ) => {
2394 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002395 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002396 )
2397 }
2398 ImplTrait(_binding_0, ) => {
2399 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002400 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002401 )
2402 }
2403 Paren(_binding_0, ) => {
2404 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002405 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002406 )
2407 }
2408 Group(_binding_0, ) => {
2409 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002410 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002411 )
2412 }
2413 Infer(_binding_0, ) => {
2414 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002416 )
2417 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002418 Macro(_binding_0, ) => {
2419 Macro (
2420 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002421 )
2422 }
2423 }
2424}
2425
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002426pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2427 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002428 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002429 elem: Box::new(_visitor.fold_type(* _i . elem)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002430 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002431 len: _visitor.fold_expr(_i . len),
Nika Layzell27726662017-10-24 23:16:35 -04002432 }
2433}
2434
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002435pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2436 TypeBareFn {
David Tolnaybe7a9592017-12-29 02:39:53 -05002437 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2438 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2439 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2440 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2441 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2442 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2443 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2444 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002445 }
2446}
2447
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002448pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2449 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002450 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002451 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002452 ty: _visitor.fold_type(_i . ty),
2453 }
2454}
2455
2456pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2457 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002458 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002459 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002460 }
2461}
2462
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002463pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2464 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002465 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002467 }
2468}
2469
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2471 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002472 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002473 }
2474}
2475
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002476pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2477 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002478 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002479 }
2480}
2481
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002482pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2483 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002484 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002485 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002486 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002487 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002488 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002489 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002490 }
2491}
2492
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002493pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2494 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002495 match _i {
2496 Trait(_binding_0, _binding_1, ) => {
2497 Trait (
2498 _visitor.fold_poly_trait_ref(_binding_0),
2499 _visitor.fold_trait_bound_modifier(_binding_1),
2500 )
2501 }
2502 Region(_binding_0, ) => {
2503 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002504 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002505 )
2506 }
2507 }
2508}
2509
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002510pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2511 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002512 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002513 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002514 }
2515}
2516
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002517pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2518 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002519 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002520 path: _visitor.fold_path(_i . path),
2521 }
2522}
2523
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002524pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2525 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002526 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2527 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002528 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2529 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002530 }
2531}
2532
David Tolnay0a89b4d2017-11-13 00:55:45 -08002533pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2534 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002535 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002536 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay136aaa32017-12-29 02:37:36 -05002537 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2538 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002539 }
2540}
2541
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2543 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002544 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002545 elem: Box::new(_visitor.fold_type(* _i . elem)),
Nika Layzell27726662017-10-24 23:16:35 -04002546 }
2547}
2548
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2550 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002551 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002552 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002553 }
2554}
2555
David Tolnay05362582017-12-26 01:33:57 -05002556pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2557 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002558 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayeadbda32017-12-29 02:33:47 -05002559 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002560 }
2561}
2562
Nika Layzella6f46c42017-10-26 15:26:16 -04002563pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002564 use ::UnOp::*;
2565 match _i {
2566 Deref(_binding_0, ) => {
2567 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002568 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002569 )
2570 }
2571 Not(_binding_0, ) => {
2572 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002573 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002574 )
2575 }
2576 Neg(_binding_0, ) => {
2577 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002578 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002579 )
2580 }
2581 }
2582}
David Tolnay5f332a92017-12-26 00:42:45 -05002583# [ cfg ( feature = "full" ) ]
2584pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2585 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002586 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002587 }
2588}
2589# [ cfg ( feature = "full" ) ]
2590pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2591 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002592 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002593 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2594 }
2595}
2596# [ cfg ( feature = "full" ) ]
2597pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2598 UsePath {
2599 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002600 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002601 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002602 _visitor.fold_ident(( it ) . 1),
2603 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002604 }
2605}
2606# [ cfg ( feature = "full" ) ]
2607pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2608 use ::UseTree::*;
2609 match _i {
2610 Path(_binding_0, ) => {
2611 Path (
2612 _visitor.fold_use_path(_binding_0),
2613 )
2614 }
2615 Glob(_binding_0, ) => {
2616 Glob (
2617 _visitor.fold_use_glob(_binding_0),
2618 )
2619 }
2620 List(_binding_0, ) => {
2621 List (
2622 _visitor.fold_use_list(_binding_0),
2623 )
2624 }
2625 }
2626}
Nika Layzell27726662017-10-24 23:16:35 -04002627
Nika Layzella6f46c42017-10-26 15:26:16 -04002628pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002629 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002630 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002631 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002632 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002633 discriminant: (_i . discriminant).map(|it| { (
2634 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2635 _visitor.fold_expr(( it ) . 1),
2636 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002637 }
2638}
2639
Nika Layzella6f46c42017-10-26 15:26:16 -04002640pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002641 use ::VariantData::*;
2642 match _i {
2643 Struct(_binding_0, _binding_1, ) => {
2644 Struct (
2645 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002646 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
2649 Tuple(_binding_0, _binding_1, ) => {
2650 Tuple (
2651 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002652 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 )
2654 }
2655 Unit => { Unit }
2656 }
2657}
Nika Layzell27726662017-10-24 23:16:35 -04002658
Nika Layzella6f46c42017-10-26 15:26:16 -04002659pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002660 VisCrate {
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 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002664 }
2665}
2666
Nika Layzella6f46c42017-10-26 15:26:16 -04002667pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002668 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002669 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002670 }
2671}
2672
Nika Layzella6f46c42017-10-26 15:26:16 -04002673pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002674 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002675 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002676 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002677 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002678 path: Box::new(_visitor.fold_path(* _i . path)),
2679 }
2680}
2681
Nika Layzella6f46c42017-10-26 15:26:16 -04002682pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002683 use ::Visibility::*;
2684 match _i {
2685 Public(_binding_0, ) => {
2686 Public (
2687 _visitor.fold_vis_public(_binding_0),
2688 )
2689 }
2690 Crate(_binding_0, ) => {
2691 Crate (
2692 _visitor.fold_vis_crate(_binding_0),
2693 )
2694 }
2695 Restricted(_binding_0, ) => {
2696 Restricted (
2697 _visitor.fold_vis_restricted(_binding_0),
2698 )
2699 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002700 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002701 }
2702}
2703
Nika Layzella6f46c42017-10-26 15:26:16 -04002704pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002705 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002706 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002707 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002708 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002709 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002710 }
2711}
2712
Nika Layzella6f46c42017-10-26 15:26:16 -04002713pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002714 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002715 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002716 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2717 }
2718}
2719
Nika Layzella6f46c42017-10-26 15:26:16 -04002720pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002721 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002722 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002723 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002724 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002725 }
2726}
2727
Nika Layzella6f46c42017-10-26 15:26:16 -04002728pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002729 use ::WherePredicate::*;
2730 match _i {
2731 BoundPredicate(_binding_0, ) => {
2732 BoundPredicate (
2733 _visitor.fold_where_bound_predicate(_binding_0),
2734 )
2735 }
2736 RegionPredicate(_binding_0, ) => {
2737 RegionPredicate (
2738 _visitor.fold_where_region_predicate(_binding_0),
2739 )
2740 }
2741 EqPredicate(_binding_0, ) => {
2742 EqPredicate (
2743 _visitor.fold_where_eq_predicate(_binding_0),
2744 )
2745 }
2746 }
2747}
2748
Nika Layzella6f46c42017-10-26 15:26:16 -04002749pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002750 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002751 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002752 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002753 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002754 }
2755}
2756