blob: e623a0e3fa0a8c2e8f4b792dfc29ec4d1f509c9b [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046
Nika Layzellc08227a2017-12-04 16:30:17 -050047fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
David Tolnayfd6bf5c2017-11-12 09:41:14 -080065fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050078
79fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040083fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128
David Tolnay8c91b882017-12-28 23:04:32 -0500129fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500133fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500147fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500153fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500159fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800184# [ cfg ( feature = "full" ) ]
185fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186
Nika Layzellc08227a2017-12-04 16:30:17 -0500187fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500188# [ cfg ( feature = "full" ) ]
189fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500190
David Tolnayc2f1aba2017-11-12 20:29:22 -0800191fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
192
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500194
195fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800201fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500208
David Tolnay85b69a42017-12-27 20:43:10 -0500209fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800227fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800229fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800239fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244
David Tolnay4ba63a02017-12-28 15:53:05 -0500245fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
246
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500248
249fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
David Tolnaydecf28d2017-11-11 11:56:45 -0800253fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500254
David Tolnay85b69a42017-12-27 20:43:10 -0500255fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800256
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500264# [ cfg ( feature = "full" ) ]
265fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800267fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzellc08227a2017-12-04 16:30:17 -0500273fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500300
301fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800310
311fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500312
313fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800323fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
338
339fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
340
341fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
342
343fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
344
345fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
346
347fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
348
349fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
350
351fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
352
353fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
354
David Tolnay0a89b4d2017-11-13 00:55:45 -0800355fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800356
357fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
358
359fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
360
David Tolnay05362582017-12-26 01:33:57 -0500361fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500366# [ cfg ( feature = "full" ) ]
367fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
368# [ cfg ( feature = "full" ) ]
369fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
397}
398
David Tolnayd0adf522017-12-29 01:30:07 -0500399pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
400 _i.span = _visitor.fold_span(_i.span);
401 _i
402}
403
404pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
405 _i.span = _visitor.fold_span(_i.span);
406 _i
407}
408
Nika Layzell27726662017-10-24 23:16:35 -0400409
Nika Layzella6f46c42017-10-26 15:26:16 -0400410pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400411 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500412 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400413 kind: _visitor.fold_abi_kind(_i . kind),
414 }
415}
416
Nika Layzella6f46c42017-10-26 15:26:16 -0400417pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400418 use ::AbiKind::*;
419 match _i {
420 Named(_binding_0, ) => {
421 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500422 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400423 )
424 }
425 Default => { Default }
426 }
427}
428
Nika Layzellc08227a2017-12-04 16:30:17 -0500429pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
430 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500431 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500432 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500433 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500434 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400435 }
436}
437# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400438pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400439 ArgCaptured {
440 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500441 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800442 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400443 }
444}
445# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400446pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400447 ArgSelf {
448 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500449 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400450 }
451}
452# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400453pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400454 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500455 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500456 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400457 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500458 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 }
460}
461# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400462pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400463 Arm {
464 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
465 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500466 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400467 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400469 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400471 }
472}
473
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400475 use ::AttrStyle::*;
476 match _i {
477 Outer => { Outer }
478 Inner(_binding_0, ) => {
479 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500480 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 )
482 }
483 }
484}
485
Nika Layzella6f46c42017-10-26 15:26:16 -0400486pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400487 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500488 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500489 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500490 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400491 path: _visitor.fold_path(_i . path),
492 tts: _i . tts,
493 is_sugared_doc: _i . is_sugared_doc,
494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400498 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500499 name: (_i . name).map(|it| { (
500 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500501 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500502 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800503 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400504 }
505}
506
Nika Layzella6f46c42017-10-26 15:26:16 -0400507pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400508 use ::BareFnArgName::*;
509 match _i {
510 Named(_binding_0, ) => {
511 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500512 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400513 )
514 }
515 Wild(_binding_0, ) => {
516 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400518 )
519 }
520 }
521}
522
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800523pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
524 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400525 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400526 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500527 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500528 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500529 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400530 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800532 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400533 }
534}
535
Nika Layzella6f46c42017-10-26 15:26:16 -0400536pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400537 use ::BinOp::*;
538 match _i {
539 Add(_binding_0, ) => {
540 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 Sub(_binding_0, ) => {
545 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500546 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400547 )
548 }
549 Mul(_binding_0, ) => {
550 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
554 Div(_binding_0, ) => {
555 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
559 Rem(_binding_0, ) => {
560 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
564 And(_binding_0, ) => {
565 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
569 Or(_binding_0, ) => {
570 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
574 BitXor(_binding_0, ) => {
575 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
579 BitAnd(_binding_0, ) => {
580 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
584 BitOr(_binding_0, ) => {
585 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
589 Shl(_binding_0, ) => {
590 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
594 Shr(_binding_0, ) => {
595 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
599 Eq(_binding_0, ) => {
600 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
604 Lt(_binding_0, ) => {
605 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
609 Le(_binding_0, ) => {
610 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
614 Ne(_binding_0, ) => {
615 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
619 Ge(_binding_0, ) => {
620 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
624 Gt(_binding_0, ) => {
625 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
629 AddEq(_binding_0, ) => {
630 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
634 SubEq(_binding_0, ) => {
635 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
639 MulEq(_binding_0, ) => {
640 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
644 DivEq(_binding_0, ) => {
645 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
649 RemEq(_binding_0, ) => {
650 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
654 BitXorEq(_binding_0, ) => {
655 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500656 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400657 )
658 }
659 BitAndEq(_binding_0, ) => {
660 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500661 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 )
663 }
664 BitOrEq(_binding_0, ) => {
665 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400667 )
668 }
669 ShlEq(_binding_0, ) => {
670 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500671 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400672 )
673 }
674 ShrEq(_binding_0, ) => {
675 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500676 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400677 )
678 }
679 }
680}
681# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400682pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400683 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500684 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400685 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
686 }
687}
688
Nika Layzella6f46c42017-10-26 15:26:16 -0400689pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400690 use ::Body::*;
691 match _i {
692 Enum(_binding_0, ) => {
693 Enum (
694 _visitor.fold_body_enum(_binding_0),
695 )
696 }
697 Struct(_binding_0, ) => {
698 Struct (
699 _visitor.fold_body_struct(_binding_0),
700 )
701 }
702 }
703}
704
Nika Layzella6f46c42017-10-26 15:26:16 -0400705pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400706 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500707 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500708 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400709 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
710 }
711}
712
Nika Layzella6f46c42017-10-26 15:26:16 -0400713pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400714 BodyStruct {
715 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500716 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
717 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400718 }
719}
720
Nika Layzella6f46c42017-10-26 15:26:16 -0400721pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400722 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
724 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400725 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500726 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400727 }
728}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500729
730pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
731 ConstParam {
732 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500733 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500734 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500735 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500736 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500737 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500738 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
739 }
740}
Nika Layzell27726662017-10-24 23:16:35 -0400741# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400742pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400743 use ::Constness::*;
744 match _i {
745 Const(_binding_0, ) => {
746 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500747 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400748 )
749 }
750 NotConst => { NotConst }
751 }
752}
753# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400754pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400755 use ::Defaultness::*;
756 match _i {
757 Default(_binding_0, ) => {
758 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500759 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400760 )
761 }
762 Final => { Final }
763 }
764}
765
Nika Layzella6f46c42017-10-26 15:26:16 -0400766pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400767 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400768 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500769 vis: _visitor.fold_visibility(_i . vis),
770 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400771 generics: _visitor.fold_generics(_i . generics),
772 body: _visitor.fold_body(_i . body),
773 }
774}
775
Nika Layzella6f46c42017-10-26 15:26:16 -0400776pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500777 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400778 match _i {
779 Box(_binding_0, ) => {
780 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400781 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400782 )
783 }
784 InPlace(_binding_0, ) => {
785 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400786 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400787 )
788 }
789 Array(_binding_0, ) => {
790 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400791 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400792 )
793 }
794 Call(_binding_0, ) => {
795 Call (
796 _visitor.fold_expr_call(_binding_0),
797 )
798 }
799 MethodCall(_binding_0, ) => {
800 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400801 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400802 )
803 }
David Tolnay05362582017-12-26 01:33:57 -0500804 Tuple(_binding_0, ) => {
805 Tuple (
806 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400807 )
808 }
809 Binary(_binding_0, ) => {
810 Binary (
811 _visitor.fold_expr_binary(_binding_0),
812 )
813 }
814 Unary(_binding_0, ) => {
815 Unary (
816 _visitor.fold_expr_unary(_binding_0),
817 )
818 }
819 Lit(_binding_0, ) => {
820 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500821 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400822 )
823 }
824 Cast(_binding_0, ) => {
825 Cast (
826 _visitor.fold_expr_cast(_binding_0),
827 )
828 }
829 Type(_binding_0, ) => {
830 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500831 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400832 )
833 }
834 If(_binding_0, ) => {
835 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400836 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400837 )
838 }
839 IfLet(_binding_0, ) => {
840 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400841 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400842 )
843 }
844 While(_binding_0, ) => {
845 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400846 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400847 )
848 }
849 WhileLet(_binding_0, ) => {
850 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400852 )
853 }
854 ForLoop(_binding_0, ) => {
855 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400856 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400857 )
858 }
859 Loop(_binding_0, ) => {
860 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400861 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400862 )
863 }
864 Match(_binding_0, ) => {
865 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400866 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 )
868 }
869 Closure(_binding_0, ) => {
870 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400871 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400872 )
873 }
Nika Layzell640832a2017-12-04 13:37:09 -0500874 Unsafe(_binding_0, ) => {
875 Unsafe (
876 full!(_visitor.fold_expr_unsafe(_binding_0)),
877 )
878 }
Nika Layzell27726662017-10-24 23:16:35 -0400879 Block(_binding_0, ) => {
880 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400881 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400882 )
883 }
884 Assign(_binding_0, ) => {
885 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400886 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400887 )
888 }
889 AssignOp(_binding_0, ) => {
890 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400891 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400892 )
893 }
894 Field(_binding_0, ) => {
895 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400896 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400897 )
898 }
Nika Layzell27726662017-10-24 23:16:35 -0400899 Index(_binding_0, ) => {
900 Index (
901 _visitor.fold_expr_index(_binding_0),
902 )
903 }
904 Range(_binding_0, ) => {
905 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400906 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400907 )
908 }
909 Path(_binding_0, ) => {
910 Path (
911 _visitor.fold_expr_path(_binding_0),
912 )
913 }
914 AddrOf(_binding_0, ) => {
915 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400916 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400917 )
918 }
919 Break(_binding_0, ) => {
920 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400921 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400922 )
923 }
924 Continue(_binding_0, ) => {
925 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400926 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400927 )
928 }
David Tolnayc246cd32017-12-28 23:14:32 -0500929 Return(_binding_0, ) => {
930 Return (
931 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400932 )
933 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800934 Macro(_binding_0, ) => {
935 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500936 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400937 )
938 }
939 Struct(_binding_0, ) => {
940 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400941 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400942 )
943 }
944 Repeat(_binding_0, ) => {
945 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400946 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400947 )
948 }
949 Paren(_binding_0, ) => {
950 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500951 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400952 )
953 }
954 Group(_binding_0, ) => {
955 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500956 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400957 )
958 }
959 Try(_binding_0, ) => {
960 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400961 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400962 )
963 }
964 Catch(_binding_0, ) => {
965 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400966 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400967 )
968 }
969 Yield(_binding_0, ) => {
970 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400971 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400972 )
973 }
974 }
975}
976# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500977pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
978 ExprAddrOf {
979 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
980 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
981 mutbl: _visitor.fold_mutability(_i . mutbl),
982 expr: Box::new(_visitor.fold_expr(* _i . expr)),
983 }
984}
985# [ cfg ( feature = "full" ) ]
986pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
987 ExprArray {
988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
989 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500990 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500991 }
992}
993# [ cfg ( feature = "full" ) ]
994pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
995 ExprAssign {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 left: Box::new(_visitor.fold_expr(* _i . left)),
998 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
999 right: Box::new(_visitor.fold_expr(* _i . right)),
1000 }
1001}
1002# [ cfg ( feature = "full" ) ]
1003pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1004 ExprAssignOp {
1005 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1006 left: Box::new(_visitor.fold_expr(* _i . left)),
1007 op: _visitor.fold_bin_op(_i . op),
1008 right: Box::new(_visitor.fold_expr(* _i . right)),
1009 }
1010}
1011
1012pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1013 ExprBinary {
1014 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1015 left: Box::new(_visitor.fold_expr(* _i . left)),
1016 op: _visitor.fold_bin_op(_i . op),
1017 right: Box::new(_visitor.fold_expr(* _i . right)),
1018 }
1019}
1020# [ cfg ( feature = "full" ) ]
1021pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1022 ExprBlock {
1023 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1024 block: _visitor.fold_block(_i . block),
1025 }
1026}
1027# [ cfg ( feature = "full" ) ]
1028pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1029 ExprBox {
1030 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1031 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1032 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1033 }
1034}
1035# [ cfg ( feature = "full" ) ]
1036pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1037 ExprBreak {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1039 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1040 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1041 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1042 }
1043}
1044
1045pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1046 ExprCall {
1047 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1048 func: Box::new(_visitor.fold_expr(* _i . func)),
1049 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1050 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1051 }
1052}
1053
1054pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1055 ExprCast {
1056 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1057 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1058 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1059 ty: Box::new(_visitor.fold_type(* _i . ty)),
1060 }
1061}
1062# [ cfg ( feature = "full" ) ]
1063pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1064 ExprCatch {
1065 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1066 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1067 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1068 block: _visitor.fold_block(_i . block),
1069 }
1070}
1071# [ cfg ( feature = "full" ) ]
1072pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1073 ExprClosure {
1074 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001075 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001076 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1077 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1078 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1079 output: _visitor.fold_return_type(_i . output),
1080 body: Box::new(_visitor.fold_expr(* _i . body)),
1081 }
1082}
1083# [ cfg ( feature = "full" ) ]
1084pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1085 ExprContinue {
1086 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1087 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1088 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1089 }
1090}
1091# [ cfg ( feature = "full" ) ]
1092pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1093 ExprField {
1094 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1095 base: Box::new(_visitor.fold_expr(* _i . base)),
1096 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1097 member: _visitor.fold_member(_i . member),
1098 }
1099}
1100# [ cfg ( feature = "full" ) ]
1101pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1102 ExprForLoop {
1103 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1104 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1105 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1106 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1107 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1108 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1109 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1110 body: _visitor.fold_block(_i . body),
1111 }
1112}
David Tolnaye98775f2017-12-28 23:17:00 -05001113# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001114pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1115 ExprGroup {
1116 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1117 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1118 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1119 }
1120}
1121# [ cfg ( feature = "full" ) ]
1122pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1123 ExprIf {
1124 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1125 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1126 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001127 then_branch: _visitor.fold_block(_i . then_branch),
1128 else_branch: (_i . else_branch).map(|it| { (
1129 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1130 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1131 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001132 }
1133}
1134# [ cfg ( feature = "full" ) ]
1135pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1136 ExprIfLet {
1137 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1138 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1139 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1140 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1141 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1142 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001143 then_branch: _visitor.fold_block(_i . then_branch),
1144 else_branch: (_i . else_branch).map(|it| { (
1145 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1146 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1147 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001148 }
1149}
1150# [ cfg ( feature = "full" ) ]
1151pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1152 ExprInPlace {
1153 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1154 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001155 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001156 value: Box::new(_visitor.fold_expr(* _i . value)),
1157 }
1158}
1159
1160pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1161 ExprIndex {
1162 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1163 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1164 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1165 index: Box::new(_visitor.fold_expr(* _i . index)),
1166 }
1167}
1168
1169pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1170 ExprLit {
1171 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1172 lit: _visitor.fold_lit(_i . lit),
1173 }
1174}
1175# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001176pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001177 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001178 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001179 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001180 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001181 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1182 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001183 }
1184}
1185# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001186pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1187 ExprMacro {
1188 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1189 mac: _visitor.fold_macro(_i . mac),
1190 }
1191}
1192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001193pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001194 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001195 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001196 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001197 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001198 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001199 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1200 }
1201}
1202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001203pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001204 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001205 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001206 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001207 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001208 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001209 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001210 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1211 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001212 }
1213}
David Tolnaye98775f2017-12-28 23:17:00 -05001214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001215pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001216 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001217 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001218 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001219 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001220 }
1221}
1222
Nika Layzella6f46c42017-10-26 15:26:16 -04001223pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001224 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001225 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001226 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001227 path: _visitor.fold_path(_i . path),
1228 }
1229}
1230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001231pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001232 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001233 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001234 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001235 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001236 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001237 }
1238}
1239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001240pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001241 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001242 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001243 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001244 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001245 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001246 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1247 }
1248}
1249# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001250pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1251 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001252 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001253 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001254 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001258pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001259 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001261 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001262 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001263 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1264 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1265 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001266 }
1267}
1268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001269pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001270 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001271 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001272 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001273 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001274 }
1275}
1276# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001277pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1278 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001279 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001280 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001281 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001282 }
1283}
David Tolnay0cf94f22017-12-28 23:46:26 -05001284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001285pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001286 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001287 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001288 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001289 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001290 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001291 }
1292}
1293
Nika Layzella6f46c42017-10-26 15:26:16 -04001294pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001295 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001296 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001297 op: _visitor.fold_un_op(_i . op),
1298 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1299 }
1300}
1301# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001302pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1303 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001305 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001306 block: _visitor.fold_block(_i . block),
1307 }
1308}
1309# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001310pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001311 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001312 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001313 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001314 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1315 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001316 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1317 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001318 }
1319}
1320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001321pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001322 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001323 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001324 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001325 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1326 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1327 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001328 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001329 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001330 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1331 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001332 }
1333}
1334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001335pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001336 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001337 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001338 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001339 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001340 }
1341}
1342
Nika Layzella6f46c42017-10-26 15:26:16 -04001343pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001344 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001346 vis: _visitor.fold_visibility(_i . vis),
1347 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001348 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001349 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001350 }
1351}
1352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001353pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001354 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001355 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001356 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001357 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001358 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001359 }
1360}
1361# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001362pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001363 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001364 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1365 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001366 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001367 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001368 }
1369}
1370# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001371pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001372 File {
1373 shebang: _i . shebang,
1374 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1375 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1376 }
1377}
1378# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001379pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001380 use ::FnArg::*;
1381 match _i {
1382 SelfRef(_binding_0, ) => {
1383 SelfRef (
1384 _visitor.fold_arg_self_ref(_binding_0),
1385 )
1386 }
1387 SelfValue(_binding_0, ) => {
1388 SelfValue (
1389 _visitor.fold_arg_self(_binding_0),
1390 )
1391 }
1392 Captured(_binding_0, ) => {
1393 Captured (
1394 _visitor.fold_arg_captured(_binding_0),
1395 )
1396 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001397 Inferred(_binding_0, ) => {
1398 Inferred (
1399 _visitor.fold_pat(_binding_0),
1400 )
1401 }
Nika Layzell27726662017-10-24 23:16:35 -04001402 Ignored(_binding_0, ) => {
1403 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001404 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001405 )
1406 }
1407 }
1408}
1409# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001410pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001411 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001412 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001413 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001414 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001415 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001416 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001417 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001418 }
1419}
1420# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001421pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001422 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001423 match _i {
1424 Fn(_binding_0, ) => {
1425 Fn (
1426 _visitor.fold_foreign_item_fn(_binding_0),
1427 )
1428 }
1429 Static(_binding_0, ) => {
1430 Static (
1431 _visitor.fold_foreign_item_static(_binding_0),
1432 )
1433 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001434 Type(_binding_0, ) => {
1435 Type (
1436 _visitor.fold_foreign_item_type(_binding_0),
1437 )
1438 }
Nika Layzell27726662017-10-24 23:16:35 -04001439 }
1440}
1441# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001442pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1443 ForeignItemFn {
1444 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1445 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001446 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001447 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001448 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001449 }
1450}
1451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001452pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001453 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1455 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001456 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001457 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001458 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001459 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001460 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001461 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001462 }
1463}
David Tolnay199bcbb2017-11-12 10:33:52 -08001464# [ cfg ( feature = "full" ) ]
1465pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1466 ForeignItemType {
1467 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1468 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001469 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001470 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001471 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001472 }
1473}
Nika Layzell27726662017-10-24 23:16:35 -04001474
Nika Layzellc08227a2017-12-04 16:30:17 -05001475pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1476 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001477 match _i {
1478 Lifetime(_binding_0, ) => {
1479 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001480 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001481 )
1482 }
1483 Type(_binding_0, ) => {
1484 Type (
1485 _visitor.fold_type(_binding_0),
1486 )
1487 }
1488 TypeBinding(_binding_0, ) => {
1489 TypeBinding (
1490 _visitor.fold_type_binding(_binding_0),
1491 )
1492 }
Nika Layzellc680e612017-12-04 19:07:20 -05001493 Const(_binding_0, ) => {
1494 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001495 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001496 )
1497 }
Nika Layzell357885a2017-12-04 15:47:07 -05001498 }
1499}
David Tolnayd60cfec2017-12-29 00:21:38 -05001500# [ cfg ( feature = "full" ) ]
1501pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1502 use ::GenericMethodArgument::*;
1503 match _i {
1504 Type(_binding_0, ) => {
1505 Type (
1506 _visitor.fold_type(_binding_0),
1507 )
1508 }
1509 Const(_binding_0, ) => {
1510 Const (
1511 _visitor.fold_expr(_binding_0),
1512 )
1513 }
1514 }
1515}
Nika Layzell357885a2017-12-04 15:47:07 -05001516
David Tolnayc2f1aba2017-11-12 20:29:22 -08001517pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1518 use ::GenericParam::*;
1519 match _i {
1520 Lifetime(_binding_0, ) => {
1521 Lifetime (
1522 _visitor.fold_lifetime_def(_binding_0),
1523 )
1524 }
1525 Type(_binding_0, ) => {
1526 Type (
1527 _visitor.fold_type_param(_binding_0),
1528 )
1529 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001530 Const(_binding_0, ) => {
1531 Const (
1532 _visitor.fold_const_param(_binding_0),
1533 )
1534 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001535 }
1536}
1537
Nika Layzella6f46c42017-10-26 15:26:16 -04001538pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001539 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001540 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001541 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001542 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001543 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001544 }
1545}
1546# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001547pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001548 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001549 match _i {
1550 Const(_binding_0, ) => {
1551 Const (
1552 _visitor.fold_impl_item_const(_binding_0),
1553 )
1554 }
1555 Method(_binding_0, ) => {
1556 Method (
1557 _visitor.fold_impl_item_method(_binding_0),
1558 )
1559 }
1560 Type(_binding_0, ) => {
1561 Type (
1562 _visitor.fold_impl_item_type(_binding_0),
1563 )
1564 }
1565 Macro(_binding_0, ) => {
1566 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001567 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001568 )
1569 }
1570 }
1571}
1572# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001573pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1574 ImplItemConst {
1575 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1576 vis: _visitor.fold_visibility(_i . vis),
1577 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001578 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001579 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001581 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001582 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001583 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001584 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001585 }
1586}
1587# [ cfg ( feature = "full" ) ]
1588pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1589 ImplItemMacro {
1590 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1591 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001592 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001593 }
1594}
1595# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001596pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001597 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001598 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001599 vis: _visitor.fold_visibility(_i . vis),
1600 defaultness: _visitor.fold_defaultness(_i . defaultness),
1601 sig: _visitor.fold_method_sig(_i . sig),
1602 block: _visitor.fold_block(_i . block),
1603 }
1604}
1605# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001606pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001607 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001608 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001609 vis: _visitor.fold_visibility(_i . vis),
1610 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001611 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001612 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001613 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001614 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001615 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001616 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001617 }
1618}
1619# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001620pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001621 use ::ImplPolarity::*;
1622 match _i {
1623 Positive => { Positive }
1624 Negative(_binding_0, ) => {
1625 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001626 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001627 )
1628 }
1629 }
1630}
David Tolnay14982012017-12-29 00:49:51 -05001631
David Tolnay85b69a42017-12-27 20:43:10 -05001632pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1633 Index {
1634 index: _i . index,
1635 span: _visitor.fold_span(_i . span),
1636 }
1637}
1638# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001639pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001640 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001641 match _i {
1642 ExternCrate(_binding_0, ) => {
1643 ExternCrate (
1644 _visitor.fold_item_extern_crate(_binding_0),
1645 )
1646 }
1647 Use(_binding_0, ) => {
1648 Use (
1649 _visitor.fold_item_use(_binding_0),
1650 )
1651 }
1652 Static(_binding_0, ) => {
1653 Static (
1654 _visitor.fold_item_static(_binding_0),
1655 )
1656 }
1657 Const(_binding_0, ) => {
1658 Const (
1659 _visitor.fold_item_const(_binding_0),
1660 )
1661 }
1662 Fn(_binding_0, ) => {
1663 Fn (
1664 _visitor.fold_item_fn(_binding_0),
1665 )
1666 }
1667 Mod(_binding_0, ) => {
1668 Mod (
1669 _visitor.fold_item_mod(_binding_0),
1670 )
1671 }
1672 ForeignMod(_binding_0, ) => {
1673 ForeignMod (
1674 _visitor.fold_item_foreign_mod(_binding_0),
1675 )
1676 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001677 Type(_binding_0, ) => {
1678 Type (
1679 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001680 )
1681 }
1682 Enum(_binding_0, ) => {
1683 Enum (
1684 _visitor.fold_item_enum(_binding_0),
1685 )
1686 }
1687 Struct(_binding_0, ) => {
1688 Struct (
1689 _visitor.fold_item_struct(_binding_0),
1690 )
1691 }
1692 Union(_binding_0, ) => {
1693 Union (
1694 _visitor.fold_item_union(_binding_0),
1695 )
1696 }
1697 Trait(_binding_0, ) => {
1698 Trait (
1699 _visitor.fold_item_trait(_binding_0),
1700 )
1701 }
1702 DefaultImpl(_binding_0, ) => {
1703 DefaultImpl (
1704 _visitor.fold_item_default_impl(_binding_0),
1705 )
1706 }
1707 Impl(_binding_0, ) => {
1708 Impl (
1709 _visitor.fold_item_impl(_binding_0),
1710 )
1711 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001712 Macro(_binding_0, ) => {
1713 Macro (
1714 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001715 )
1716 }
David Tolnay500d8322017-12-18 00:32:51 -08001717 Macro2(_binding_0, ) => {
1718 Macro2 (
1719 _visitor.fold_item_macro2(_binding_0),
1720 )
1721 }
Nika Layzell27726662017-10-24 23:16:35 -04001722 }
1723}
1724# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001725pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1726 ItemConst {
1727 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1728 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001729 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001730 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001731 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001732 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001733 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001734 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001735 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001736 }
1737}
1738# [ cfg ( feature = "full" ) ]
1739pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1740 ItemDefaultImpl {
1741 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1742 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001743 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001744 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001745 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1746 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001747 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001748 }
1749}
1750# [ cfg ( feature = "full" ) ]
1751pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1752 ItemEnum {
1753 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1754 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001755 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001756 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001758 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001759 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1760 }
1761}
1762# [ cfg ( feature = "full" ) ]
1763pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1764 ItemExternCrate {
1765 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1766 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001767 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1768 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001769 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001770 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001771 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001772 _visitor.fold_ident(( it ) . 1),
1773 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001774 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001775 }
1776}
1777# [ cfg ( feature = "full" ) ]
1778pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1779 ItemFn {
1780 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1781 vis: _visitor.fold_visibility(_i . vis),
1782 constness: _visitor.fold_constness(_i . constness),
1783 unsafety: _visitor.fold_unsafety(_i . unsafety),
1784 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001785 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001786 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001787 block: Box::new(_visitor.fold_block(* _i . block)),
1788 }
1789}
1790# [ cfg ( feature = "full" ) ]
1791pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1792 ItemForeignMod {
1793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1794 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001795 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1797 }
1798}
1799# [ cfg ( feature = "full" ) ]
1800pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1801 ItemImpl {
1802 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1803 defaultness: _visitor.fold_defaultness(_i . defaultness),
1804 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001805 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001806 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001807 trait_: (_i . trait_).map(|it| { (
1808 _visitor.fold_impl_polarity(( it ) . 0),
1809 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001810 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001811 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001812 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001813 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001814 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1815 }
1816}
1817# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001818pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1819 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001821 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001822 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001823 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001824 }
1825}
1826# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001827pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1828 ItemMacro2 {
1829 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1830 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001831 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001832 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001833 args: _i . args,
1834 body: _i . body,
1835 }
1836}
1837# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001838pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001839 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001840 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001841 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001843 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001844 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001845 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001846 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1847 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001848 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001849 }
1850}
1851# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001852pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001853 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001854 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001855 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001857 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001858 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001860 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001861 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001862 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001864 }
1865}
1866# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001867pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001868 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001869 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001870 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001871 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001872 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001873 generics: _visitor.fold_generics(_i . generics),
1874 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001875 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001876 }
1877}
1878# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001879pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001880 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001881 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001882 vis: _visitor.fold_visibility(_i . vis),
1883 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001884 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1885 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001886 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001887 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001888 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001889 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001890 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001891 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1892 }
1893}
1894# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001895pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1896 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001897 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001898 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001899 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001900 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001901 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001903 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001904 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001905 }
1906}
1907# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001908pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001909 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001910 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001911 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001912 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001913 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001914 generics: _visitor.fold_generics(_i . generics),
1915 data: _visitor.fold_variant_data(_i . data),
1916 }
1917}
1918# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001919pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001920 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001921 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001922 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001923 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1924 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001925 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1926 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001927 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001928 }
1929}
1930
Nika Layzella6f46c42017-10-26 15:26:16 -04001931pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001932 LifetimeDef {
1933 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001934 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001935 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001936 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1937 }
1938}
1939
1940pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1941 Lit {
1942 value: _i . value,
1943 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001944 }
1945}
1946# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001947pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001948 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001949 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001950 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1951 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1952 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1953 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1954 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1955 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1956 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001957 }
1958}
Nika Layzell27726662017-10-24 23:16:35 -04001959
David Tolnaydecf28d2017-11-11 11:56:45 -08001960pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1961 Macro {
1962 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001963 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001964 tokens: _i . tokens,
1965 }
1966}
David Tolnay14982012017-12-29 00:49:51 -05001967
David Tolnay85b69a42017-12-27 20:43:10 -05001968pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1969 use ::Member::*;
1970 match _i {
1971 Named(_binding_0, ) => {
1972 Named (
1973 _visitor.fold_ident(_binding_0),
1974 )
1975 }
1976 Unnamed(_binding_0, ) => {
1977 Unnamed (
1978 _visitor.fold_index(_binding_0),
1979 )
1980 }
1981 }
1982}
David Tolnaydecf28d2017-11-11 11:56:45 -08001983
Nika Layzella6f46c42017-10-26 15:26:16 -04001984pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001985 use ::MetaItem::*;
1986 match _i {
1987 Term(_binding_0, ) => {
1988 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001989 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001990 )
1991 }
1992 List(_binding_0, ) => {
1993 List (
1994 _visitor.fold_meta_item_list(_binding_0),
1995 )
1996 }
1997 NameValue(_binding_0, ) => {
1998 NameValue (
1999 _visitor.fold_meta_name_value(_binding_0),
2000 )
2001 }
2002 }
2003}
2004
Nika Layzella6f46c42017-10-26 15:26:16 -04002005pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002006 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002007 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002008 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002009 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2010 }
2011}
2012
Nika Layzella6f46c42017-10-26 15:26:16 -04002013pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002014 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002015 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002016 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002017 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002018 }
2019}
2020# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002021pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002022 MethodSig {
2023 constness: _visitor.fold_constness(_i . constness),
2024 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002025 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002026 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002027 decl: _visitor.fold_fn_decl(_i . decl),
2028 }
2029}
David Tolnayd60cfec2017-12-29 00:21:38 -05002030# [ cfg ( feature = "full" ) ]
2031pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2032 MethodTurbofish {
2033 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2034 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2035 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2036 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2037 }
2038}
Nika Layzell27726662017-10-24 23:16:35 -04002039
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002040pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2041 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002042 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002043 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002044 }
2045}
2046
Nika Layzella6f46c42017-10-26 15:26:16 -04002047pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002048 use ::Mutability::*;
2049 match _i {
2050 Mutable(_binding_0, ) => {
2051 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002052 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002053 )
2054 }
2055 Immutable => { Immutable }
2056 }
2057}
2058
Nika Layzella6f46c42017-10-26 15:26:16 -04002059pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002060 use ::NestedMetaItem::*;
2061 match _i {
2062 MetaItem(_binding_0, ) => {
2063 MetaItem (
2064 _visitor.fold_meta_item(_binding_0),
2065 )
2066 }
2067 Literal(_binding_0, ) => {
2068 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002069 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002070 )
2071 }
2072 }
2073}
2074
Nika Layzellc08227a2017-12-04 16:30:17 -05002075pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2076 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002077 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002078 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002079 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002080 }
2081}
2082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002083pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002084 use ::Pat::*;
2085 match _i {
2086 Wild(_binding_0, ) => {
2087 Wild (
2088 _visitor.fold_pat_wild(_binding_0),
2089 )
2090 }
2091 Ident(_binding_0, ) => {
2092 Ident (
2093 _visitor.fold_pat_ident(_binding_0),
2094 )
2095 }
2096 Struct(_binding_0, ) => {
2097 Struct (
2098 _visitor.fold_pat_struct(_binding_0),
2099 )
2100 }
2101 TupleStruct(_binding_0, ) => {
2102 TupleStruct (
2103 _visitor.fold_pat_tuple_struct(_binding_0),
2104 )
2105 }
2106 Path(_binding_0, ) => {
2107 Path (
2108 _visitor.fold_pat_path(_binding_0),
2109 )
2110 }
2111 Tuple(_binding_0, ) => {
2112 Tuple (
2113 _visitor.fold_pat_tuple(_binding_0),
2114 )
2115 }
2116 Box(_binding_0, ) => {
2117 Box (
2118 _visitor.fold_pat_box(_binding_0),
2119 )
2120 }
2121 Ref(_binding_0, ) => {
2122 Ref (
2123 _visitor.fold_pat_ref(_binding_0),
2124 )
2125 }
2126 Lit(_binding_0, ) => {
2127 Lit (
2128 _visitor.fold_pat_lit(_binding_0),
2129 )
2130 }
2131 Range(_binding_0, ) => {
2132 Range (
2133 _visitor.fold_pat_range(_binding_0),
2134 )
2135 }
2136 Slice(_binding_0, ) => {
2137 Slice (
2138 _visitor.fold_pat_slice(_binding_0),
2139 )
2140 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002141 Macro(_binding_0, ) => {
2142 Macro (
2143 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002144 )
2145 }
2146 }
2147}
2148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002149pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002150 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002151 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002152 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002153 }
2154}
2155# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002156pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002157 PatIdent {
David Tolnayefc96fb2017-12-29 02:03:15 -05002158 mode: (_i . mode).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2159 mutability: _visitor.fold_mutability(_i . mutability),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002160 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002161 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002162 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002163 }
2164}
2165# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002166pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002167 PatLit {
2168 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2169 }
2170}
2171# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002172pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002173 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002174 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002175 path: _visitor.fold_path(_i . path),
2176 }
2177}
2178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002179pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002180 PatRange {
2181 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002182 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002183 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002184 }
2185}
2186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002188 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002189 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002190 mutbl: _visitor.fold_mutability(_i . mutbl),
2191 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
2193}
2194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002195pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002196 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002197 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002198 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002199 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002200 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002201 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002202 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002203 }
2204}
2205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002206pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002207 PatStruct {
2208 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002209 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002210 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002211 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002212 }
2213}
2214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002215pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002216 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002217 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002218 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002219 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002220 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2221 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002222 }
2223}
2224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002225pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002226 PatTupleStruct {
2227 path: _visitor.fold_path(_i . path),
2228 pat: _visitor.fold_pat_tuple(_i . pat),
2229 }
2230}
2231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002232pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002233 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002234 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002235 }
2236}
2237
Nika Layzella6f46c42017-10-26 15:26:16 -04002238pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002239 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002240 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002241 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2242 }
2243}
Nika Layzellc08227a2017-12-04 16:30:17 -05002244
2245pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2246 use ::PathArguments::*;
2247 match _i {
2248 None => { None }
2249 AngleBracketed(_binding_0, ) => {
2250 AngleBracketed (
2251 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2252 )
2253 }
2254 Parenthesized(_binding_0, ) => {
2255 Parenthesized (
2256 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2257 )
2258 }
2259 }
2260}
Nika Layzell27726662017-10-24 23:16:35 -04002261
Nika Layzella6f46c42017-10-26 15:26:16 -04002262pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002263 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002264 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002265 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002266 }
2267}
Nika Layzell27726662017-10-24 23:16:35 -04002268
Nika Layzella6f46c42017-10-26 15:26:16 -04002269pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002270 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002271 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002272 trait_ref: _visitor.fold_path(_i . trait_ref),
2273 }
2274}
2275
Nika Layzella6f46c42017-10-26 15:26:16 -04002276pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002277 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002278 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002279 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002280 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002281 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2282 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002283 }
2284}
2285# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002286pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002287 use ::RangeLimits::*;
2288 match _i {
2289 HalfOpen(_binding_0, ) => {
2290 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002291 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002292 )
2293 }
2294 Closed(_binding_0, ) => {
2295 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002296 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002297 )
2298 }
2299 }
2300}
David Tolnayf93b90d2017-11-11 19:21:26 -08002301
2302pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2303 use ::ReturnType::*;
2304 match _i {
2305 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002306 Type(_binding_0, _binding_1, ) => {
2307 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002308 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2309 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002310 )
2311 }
2312 }
2313}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002314
2315pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2316 _i
2317}
Nika Layzell27726662017-10-24 23:16:35 -04002318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002319pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002320 use ::Stmt::*;
2321 match _i {
2322 Local(_binding_0, ) => {
2323 Local (
2324 Box::new(_visitor.fold_local(* _binding_0)),
2325 )
2326 }
2327 Item(_binding_0, ) => {
2328 Item (
2329 Box::new(_visitor.fold_item(* _binding_0)),
2330 )
2331 }
2332 Expr(_binding_0, ) => {
2333 Expr (
2334 Box::new(_visitor.fold_expr(* _binding_0)),
2335 )
2336 }
2337 Semi(_binding_0, _binding_1, ) => {
2338 Semi (
2339 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002340 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002341 )
2342 }
Nika Layzell27726662017-10-24 23:16:35 -04002343 }
2344}
2345
Nika Layzella6f46c42017-10-26 15:26:16 -04002346pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002347 use ::TraitBoundModifier::*;
2348 match _i {
2349 None => { None }
2350 Maybe(_binding_0, ) => {
2351 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002352 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002353 )
2354 }
2355 }
2356}
2357# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002358pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002359 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002360 match _i {
2361 Const(_binding_0, ) => {
2362 Const (
2363 _visitor.fold_trait_item_const(_binding_0),
2364 )
2365 }
2366 Method(_binding_0, ) => {
2367 Method (
2368 _visitor.fold_trait_item_method(_binding_0),
2369 )
2370 }
2371 Type(_binding_0, ) => {
2372 Type (
2373 _visitor.fold_trait_item_type(_binding_0),
2374 )
2375 }
2376 Macro(_binding_0, ) => {
2377 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002378 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002379 )
2380 }
2381 }
2382}
2383# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002384pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2385 TraitItemConst {
2386 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002387 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002388 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002389 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002390 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002391 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002392 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002393 _visitor.fold_expr(( it ) . 1),
2394 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002395 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002396 }
2397}
2398# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002399pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2400 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002401 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002402 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002403 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002404 }
2405}
2406# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002407pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002408 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002409 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002410 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002411 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002412 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002413 }
2414}
2415# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002416pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002417 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002418 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002419 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002420 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002421 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002422 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002423 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002424 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002425 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002426 _visitor.fold_type(( it ) . 1),
2427 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002428 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002429 }
2430}
2431
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002432pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2433 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002434 match _i {
2435 Slice(_binding_0, ) => {
2436 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002437 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002438 )
2439 }
2440 Array(_binding_0, ) => {
2441 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002442 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002443 )
2444 }
2445 Ptr(_binding_0, ) => {
2446 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002447 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002448 )
2449 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002450 Reference(_binding_0, ) => {
2451 Reference (
2452 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002453 )
2454 }
2455 BareFn(_binding_0, ) => {
2456 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002457 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002458 )
2459 }
2460 Never(_binding_0, ) => {
2461 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002462 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002463 )
2464 }
David Tolnay05362582017-12-26 01:33:57 -05002465 Tuple(_binding_0, ) => {
2466 Tuple (
2467 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002468 )
2469 }
2470 Path(_binding_0, ) => {
2471 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002472 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002473 )
2474 }
2475 TraitObject(_binding_0, ) => {
2476 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002477 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002478 )
2479 }
2480 ImplTrait(_binding_0, ) => {
2481 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002482 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002483 )
2484 }
2485 Paren(_binding_0, ) => {
2486 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002487 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002488 )
2489 }
2490 Group(_binding_0, ) => {
2491 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002492 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002493 )
2494 }
2495 Infer(_binding_0, ) => {
2496 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002497 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002498 )
2499 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002500 Macro(_binding_0, ) => {
2501 Macro (
2502 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002503 )
2504 }
2505 }
2506}
2507
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002508pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2509 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002510 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002511 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002512 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002513 amt: _visitor.fold_expr(_i . amt),
2514 }
2515}
2516
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002517pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2518 TypeBareFn {
2519 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002520 }
2521}
2522
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2524 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002525 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002526 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002527 ty: _visitor.fold_type(_i . ty),
2528 }
2529}
2530
2531pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2532 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002533 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002534 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002535 }
2536}
2537
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002538pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2539 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002540 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002541 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002542 }
2543}
2544
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002545pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2546 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002548 }
2549}
2550
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002551pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2552 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002553 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2558 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002559 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002560 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002562 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002563 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002564 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002565 }
2566}
2567
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2569 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002570 match _i {
2571 Trait(_binding_0, _binding_1, ) => {
2572 Trait (
2573 _visitor.fold_poly_trait_ref(_binding_0),
2574 _visitor.fold_trait_bound_modifier(_binding_1),
2575 )
2576 }
2577 Region(_binding_0, ) => {
2578 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002579 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002580 )
2581 }
2582 }
2583}
2584
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2586 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002587 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002588 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002589 }
2590}
2591
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002592pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2593 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002594 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002595 path: _visitor.fold_path(_i . path),
2596 }
2597}
2598
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002599pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2600 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002601 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2602 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002603 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002604 }
2605}
2606
David Tolnay0a89b4d2017-11-13 00:55:45 -08002607pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2608 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002609 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002610 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002612 }
2613}
2614
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002615pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2616 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002617 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002618 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002619 }
2620}
2621
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2623 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002624 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002625 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002626 }
2627}
2628
David Tolnay05362582017-12-26 01:33:57 -05002629pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2630 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002631 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002632 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002633 }
2634}
2635
Nika Layzella6f46c42017-10-26 15:26:16 -04002636pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002637 use ::UnOp::*;
2638 match _i {
2639 Deref(_binding_0, ) => {
2640 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002641 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002642 )
2643 }
2644 Not(_binding_0, ) => {
2645 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002646 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002647 )
2648 }
2649 Neg(_binding_0, ) => {
2650 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002651 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002652 )
2653 }
2654 }
2655}
2656
Nika Layzella6f46c42017-10-26 15:26:16 -04002657pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002658 use ::Unsafety::*;
2659 match _i {
2660 Unsafe(_binding_0, ) => {
2661 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002662 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002663 )
2664 }
2665 Normal => { Normal }
2666 }
2667}
David Tolnay5f332a92017-12-26 00:42:45 -05002668# [ cfg ( feature = "full" ) ]
2669pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2670 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002671 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002672 }
2673}
2674# [ cfg ( feature = "full" ) ]
2675pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2676 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002677 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002678 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2679 }
2680}
2681# [ cfg ( feature = "full" ) ]
2682pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2683 UsePath {
2684 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002685 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002686 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002687 _visitor.fold_ident(( it ) . 1),
2688 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002689 }
2690}
2691# [ cfg ( feature = "full" ) ]
2692pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2693 use ::UseTree::*;
2694 match _i {
2695 Path(_binding_0, ) => {
2696 Path (
2697 _visitor.fold_use_path(_binding_0),
2698 )
2699 }
2700 Glob(_binding_0, ) => {
2701 Glob (
2702 _visitor.fold_use_glob(_binding_0),
2703 )
2704 }
2705 List(_binding_0, ) => {
2706 List (
2707 _visitor.fold_use_list(_binding_0),
2708 )
2709 }
2710 }
2711}
Nika Layzell27726662017-10-24 23:16:35 -04002712
Nika Layzella6f46c42017-10-26 15:26:16 -04002713pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002714 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002715 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002716 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002717 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002718 discriminant: (_i . discriminant).map(|it| { (
2719 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2720 _visitor.fold_expr(( it ) . 1),
2721 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002722 }
2723}
2724
Nika Layzella6f46c42017-10-26 15:26:16 -04002725pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002726 use ::VariantData::*;
2727 match _i {
2728 Struct(_binding_0, _binding_1, ) => {
2729 Struct (
2730 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002731 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002732 )
2733 }
2734 Tuple(_binding_0, _binding_1, ) => {
2735 Tuple (
2736 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002737 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002738 )
2739 }
2740 Unit => { Unit }
2741 }
2742}
Nika Layzell27726662017-10-24 23:16:35 -04002743
Nika Layzella6f46c42017-10-26 15:26:16 -04002744pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002745 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002746 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002747 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002748 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002749 }
2750}
2751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002753 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002755 }
2756}
2757
Nika Layzella6f46c42017-10-26 15:26:16 -04002758pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002759 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002760 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002761 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002762 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002763 path: Box::new(_visitor.fold_path(* _i . path)),
2764 }
2765}
2766
Nika Layzella6f46c42017-10-26 15:26:16 -04002767pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002768 use ::Visibility::*;
2769 match _i {
2770 Public(_binding_0, ) => {
2771 Public (
2772 _visitor.fold_vis_public(_binding_0),
2773 )
2774 }
2775 Crate(_binding_0, ) => {
2776 Crate (
2777 _visitor.fold_vis_crate(_binding_0),
2778 )
2779 }
2780 Restricted(_binding_0, ) => {
2781 Restricted (
2782 _visitor.fold_vis_restricted(_binding_0),
2783 )
2784 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002785 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002786 }
2787}
2788
Nika Layzella6f46c42017-10-26 15:26:16 -04002789pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002790 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002791 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002792 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002793 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002794 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002795 }
2796}
2797
Nika Layzella6f46c42017-10-26 15:26:16 -04002798pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002799 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002800 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002801 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2802 }
2803}
2804
Nika Layzella6f46c42017-10-26 15:26:16 -04002805pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002806 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002807 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002808 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002809 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002810 }
2811}
2812
Nika Layzella6f46c42017-10-26 15:26:16 -04002813pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002814 use ::WherePredicate::*;
2815 match _i {
2816 BoundPredicate(_binding_0, ) => {
2817 BoundPredicate (
2818 _visitor.fold_where_bound_predicate(_binding_0),
2819 )
2820 }
2821 RegionPredicate(_binding_0, ) => {
2822 RegionPredicate (
2823 _visitor.fold_where_region_predicate(_binding_0),
2824 )
2825 }
2826 EqPredicate(_binding_0, ) => {
2827 EqPredicate (
2828 _visitor.fold_where_eq_predicate(_binding_0),
2829 )
2830 }
2831 }
2832}
2833
Nika Layzella6f46c42017-10-26 15:26:16 -04002834pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002835 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002836 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002837 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002838 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002839 }
2840}
2841