blob: 0e937546c38c76caf99e66f8dfde69a4a0065430 [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_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzellc08227a2017-12-04 16:30:17 -0500271fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500298
299fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800308
309fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500310
311fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800321fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800327fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
336
337fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
338
339fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
340
341fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
342
343fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
344
345fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
346
347fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
348
349fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
350
351fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
352
David Tolnay0a89b4d2017-11-13 00:55:45 -0800353fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800354
355fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
356
357fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
358
David Tolnay05362582017-12-26 01:33:57 -0500359fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360
Nika Layzella6f46c42017-10-26 15:26:16 -0400361fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500364# [ cfg ( feature = "full" ) ]
365fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
366# [ cfg ( feature = "full" ) ]
367fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
368# [ cfg ( feature = "full" ) ]
369fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
395}
396
David Tolnayd0adf522017-12-29 01:30:07 -0500397pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
398 _i.span = _visitor.fold_span(_i.span);
399 _i
400}
401
402pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
403 _i.span = _visitor.fold_span(_i.span);
404 _i
405}
406
Nika Layzell27726662017-10-24 23:16:35 -0400407
Nika Layzella6f46c42017-10-26 15:26:16 -0400408pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400409 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500410 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400411 kind: _visitor.fold_abi_kind(_i . kind),
412 }
413}
414
Nika Layzella6f46c42017-10-26 15:26:16 -0400415pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400416 use ::AbiKind::*;
417 match _i {
418 Named(_binding_0, ) => {
419 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500420 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400421 )
422 }
423 Default => { Default }
424 }
425}
426
Nika Layzellc08227a2017-12-04 16:30:17 -0500427pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
428 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500429 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500430 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500431 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500432 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgCaptured {
438 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800440 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400441 }
442}
443# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400444pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400445 ArgSelf {
David Tolnay24237fb2017-12-29 02:15:26 -0500446 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500447 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400448 }
449}
450# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400451pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400452 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500453 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500454 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnay24237fb2017-12-29 02:15:26 -0500455 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500456 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400457 }
458}
459# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400460pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400461 Arm {
462 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
463 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500464 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400465 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500466 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400467 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500468 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400469 }
470}
471
Nika Layzella6f46c42017-10-26 15:26:16 -0400472pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400473 use ::AttrStyle::*;
474 match _i {
475 Outer => { Outer }
476 Inner(_binding_0, ) => {
477 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400479 )
480 }
481 }
482}
483
Nika Layzella6f46c42017-10-26 15:26:16 -0400484pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400485 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500486 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500487 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500488 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400489 path: _visitor.fold_path(_i . path),
490 tts: _i . tts,
491 is_sugared_doc: _i . is_sugared_doc,
492 }
493}
494
Nika Layzella6f46c42017-10-26 15:26:16 -0400495pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400496 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500497 name: (_i . name).map(|it| { (
498 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500499 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500500 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800501 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400502 }
503}
504
Nika Layzella6f46c42017-10-26 15:26:16 -0400505pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400506 use ::BareFnArgName::*;
507 match _i {
508 Named(_binding_0, ) => {
509 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500510 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400511 )
512 }
513 Wild(_binding_0, ) => {
514 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500515 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400516 )
517 }
518 }
519}
520
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800521pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
522 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400523 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400524 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500525 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500526 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500527 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400528 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500529 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800530 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400531 }
532}
533
Nika Layzella6f46c42017-10-26 15:26:16 -0400534pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400535 use ::BinOp::*;
536 match _i {
537 Add(_binding_0, ) => {
538 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500539 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400540 )
541 }
542 Sub(_binding_0, ) => {
543 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500544 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400545 )
546 }
547 Mul(_binding_0, ) => {
548 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500549 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400550 )
551 }
552 Div(_binding_0, ) => {
553 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500554 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400555 )
556 }
557 Rem(_binding_0, ) => {
558 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500559 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400560 )
561 }
562 And(_binding_0, ) => {
563 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500564 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400565 )
566 }
567 Or(_binding_0, ) => {
568 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500569 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400570 )
571 }
572 BitXor(_binding_0, ) => {
573 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500574 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400575 )
576 }
577 BitAnd(_binding_0, ) => {
578 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500579 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400580 )
581 }
582 BitOr(_binding_0, ) => {
583 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500584 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400585 )
586 }
587 Shl(_binding_0, ) => {
588 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500589 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400590 )
591 }
592 Shr(_binding_0, ) => {
593 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500594 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400595 )
596 }
597 Eq(_binding_0, ) => {
598 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500599 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400600 )
601 }
602 Lt(_binding_0, ) => {
603 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500604 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400605 )
606 }
607 Le(_binding_0, ) => {
608 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500609 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400610 )
611 }
612 Ne(_binding_0, ) => {
613 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500614 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400615 )
616 }
617 Ge(_binding_0, ) => {
618 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500619 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400620 )
621 }
622 Gt(_binding_0, ) => {
623 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500624 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400625 )
626 }
627 AddEq(_binding_0, ) => {
628 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500629 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400630 )
631 }
632 SubEq(_binding_0, ) => {
633 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500634 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400635 )
636 }
637 MulEq(_binding_0, ) => {
638 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500639 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400640 )
641 }
642 DivEq(_binding_0, ) => {
643 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500644 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400645 )
646 }
647 RemEq(_binding_0, ) => {
648 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500649 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400650 )
651 }
652 BitXorEq(_binding_0, ) => {
653 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500654 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400655 )
656 }
657 BitAndEq(_binding_0, ) => {
658 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500659 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400660 )
661 }
662 BitOrEq(_binding_0, ) => {
663 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500664 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400665 )
666 }
667 ShlEq(_binding_0, ) => {
668 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500669 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400670 )
671 }
672 ShrEq(_binding_0, ) => {
673 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500674 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400675 )
676 }
677 }
678}
679# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400680pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400681 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500682 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400683 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
684 }
685}
686
Nika Layzella6f46c42017-10-26 15:26:16 -0400687pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400688 use ::Body::*;
689 match _i {
690 Enum(_binding_0, ) => {
691 Enum (
692 _visitor.fold_body_enum(_binding_0),
693 )
694 }
695 Struct(_binding_0, ) => {
696 Struct (
697 _visitor.fold_body_struct(_binding_0),
698 )
699 }
700 }
701}
702
Nika Layzella6f46c42017-10-26 15:26:16 -0400703pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400704 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500705 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500706 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400707 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
708 }
709}
710
Nika Layzella6f46c42017-10-26 15:26:16 -0400711pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400712 BodyStruct {
713 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
715 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400716 }
717}
718
Nika Layzella6f46c42017-10-26 15:26:16 -0400719pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400720 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500721 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
722 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400723 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500724 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400725 }
726}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500727
728pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
729 ConstParam {
730 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500731 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500732 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500733 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500734 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500735 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500736 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
737 }
738}
Nika Layzell27726662017-10-24 23:16:35 -0400739# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400740pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400741 use ::Constness::*;
742 match _i {
743 Const(_binding_0, ) => {
744 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500745 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400746 )
747 }
748 NotConst => { NotConst }
749 }
750}
751# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400752pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400753 use ::Defaultness::*;
754 match _i {
755 Default(_binding_0, ) => {
756 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500757 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400758 )
759 }
760 Final => { Final }
761 }
762}
763
Nika Layzella6f46c42017-10-26 15:26:16 -0400764pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400765 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400766 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500767 vis: _visitor.fold_visibility(_i . vis),
768 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400769 generics: _visitor.fold_generics(_i . generics),
770 body: _visitor.fold_body(_i . body),
771 }
772}
773
Nika Layzella6f46c42017-10-26 15:26:16 -0400774pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500775 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400776 match _i {
777 Box(_binding_0, ) => {
778 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400779 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400780 )
781 }
782 InPlace(_binding_0, ) => {
783 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400784 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400785 )
786 }
787 Array(_binding_0, ) => {
788 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400789 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400790 )
791 }
792 Call(_binding_0, ) => {
793 Call (
794 _visitor.fold_expr_call(_binding_0),
795 )
796 }
797 MethodCall(_binding_0, ) => {
798 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400799 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400800 )
801 }
David Tolnay05362582017-12-26 01:33:57 -0500802 Tuple(_binding_0, ) => {
803 Tuple (
804 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 )
806 }
807 Binary(_binding_0, ) => {
808 Binary (
809 _visitor.fold_expr_binary(_binding_0),
810 )
811 }
812 Unary(_binding_0, ) => {
813 Unary (
814 _visitor.fold_expr_unary(_binding_0),
815 )
816 }
817 Lit(_binding_0, ) => {
818 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500819 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
822 Cast(_binding_0, ) => {
823 Cast (
824 _visitor.fold_expr_cast(_binding_0),
825 )
826 }
827 Type(_binding_0, ) => {
828 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500829 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
832 If(_binding_0, ) => {
833 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
837 IfLet(_binding_0, ) => {
838 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400839 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
842 While(_binding_0, ) => {
843 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400844 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
847 WhileLet(_binding_0, ) => {
848 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400850 )
851 }
852 ForLoop(_binding_0, ) => {
853 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400854 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
857 Loop(_binding_0, ) => {
858 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
862 Match(_binding_0, ) => {
863 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
867 Closure(_binding_0, ) => {
868 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
Nika Layzell640832a2017-12-04 13:37:09 -0500872 Unsafe(_binding_0, ) => {
873 Unsafe (
874 full!(_visitor.fold_expr_unsafe(_binding_0)),
875 )
876 }
Nika Layzell27726662017-10-24 23:16:35 -0400877 Block(_binding_0, ) => {
878 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
882 Assign(_binding_0, ) => {
883 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
887 AssignOp(_binding_0, ) => {
888 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
892 Field(_binding_0, ) => {
893 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
Nika Layzell27726662017-10-24 23:16:35 -0400897 Index(_binding_0, ) => {
898 Index (
899 _visitor.fold_expr_index(_binding_0),
900 )
901 }
902 Range(_binding_0, ) => {
903 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
907 Path(_binding_0, ) => {
908 Path (
909 _visitor.fold_expr_path(_binding_0),
910 )
911 }
912 AddrOf(_binding_0, ) => {
913 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Break(_binding_0, ) => {
918 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400919 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
922 Continue(_binding_0, ) => {
923 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
David Tolnayc246cd32017-12-28 23:14:32 -0500927 Return(_binding_0, ) => {
928 Return (
929 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800932 Macro(_binding_0, ) => {
933 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500934 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400935 )
936 }
937 Struct(_binding_0, ) => {
938 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
942 Repeat(_binding_0, ) => {
943 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400944 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400945 )
946 }
947 Paren(_binding_0, ) => {
948 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500949 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
952 Group(_binding_0, ) => {
953 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500954 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400955 )
956 }
957 Try(_binding_0, ) => {
958 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400959 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400960 )
961 }
962 Catch(_binding_0, ) => {
963 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400964 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400965 )
966 }
967 Yield(_binding_0, ) => {
968 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400969 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
972 }
973}
974# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500975pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
976 ExprAddrOf {
977 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
978 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -0500979 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500980 expr: Box::new(_visitor.fold_expr(* _i . expr)),
981 }
982}
983# [ cfg ( feature = "full" ) ]
984pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
985 ExprArray {
986 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
987 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -0500988 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -0500989 }
990}
991# [ cfg ( feature = "full" ) ]
992pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
993 ExprAssign {
994 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
995 left: Box::new(_visitor.fold_expr(* _i . left)),
996 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
997 right: Box::new(_visitor.fold_expr(* _i . right)),
998 }
999}
1000# [ cfg ( feature = "full" ) ]
1001pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1002 ExprAssignOp {
1003 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1004 left: Box::new(_visitor.fold_expr(* _i . left)),
1005 op: _visitor.fold_bin_op(_i . op),
1006 right: Box::new(_visitor.fold_expr(* _i . right)),
1007 }
1008}
1009
1010pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1011 ExprBinary {
1012 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1013 left: Box::new(_visitor.fold_expr(* _i . left)),
1014 op: _visitor.fold_bin_op(_i . op),
1015 right: Box::new(_visitor.fold_expr(* _i . right)),
1016 }
1017}
1018# [ cfg ( feature = "full" ) ]
1019pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1020 ExprBlock {
1021 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1022 block: _visitor.fold_block(_i . block),
1023 }
1024}
1025# [ cfg ( feature = "full" ) ]
1026pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1027 ExprBox {
1028 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1029 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1030 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1031 }
1032}
1033# [ cfg ( feature = "full" ) ]
1034pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1035 ExprBreak {
1036 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1037 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1038 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1039 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1040 }
1041}
1042
1043pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1044 ExprCall {
1045 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1046 func: Box::new(_visitor.fold_expr(* _i . func)),
1047 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1048 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1049 }
1050}
1051
1052pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1053 ExprCast {
1054 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1055 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1056 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1057 ty: Box::new(_visitor.fold_type(* _i . ty)),
1058 }
1059}
1060# [ cfg ( feature = "full" ) ]
1061pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1062 ExprCatch {
1063 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1064 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1065 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1066 block: _visitor.fold_block(_i . block),
1067 }
1068}
1069# [ cfg ( feature = "full" ) ]
1070pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1071 ExprClosure {
1072 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayefc96fb2017-12-29 02:03:15 -05001073 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001074 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1075 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1076 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1077 output: _visitor.fold_return_type(_i . output),
1078 body: Box::new(_visitor.fold_expr(* _i . body)),
1079 }
1080}
1081# [ cfg ( feature = "full" ) ]
1082pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1083 ExprContinue {
1084 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1085 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1086 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1087 }
1088}
1089# [ cfg ( feature = "full" ) ]
1090pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1091 ExprField {
1092 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1093 base: Box::new(_visitor.fold_expr(* _i . base)),
1094 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1095 member: _visitor.fold_member(_i . member),
1096 }
1097}
1098# [ cfg ( feature = "full" ) ]
1099pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1100 ExprForLoop {
1101 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1102 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1103 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1104 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1105 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1106 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1107 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1108 body: _visitor.fold_block(_i . body),
1109 }
1110}
David Tolnaye98775f2017-12-28 23:17:00 -05001111# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001112pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1113 ExprGroup {
1114 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1115 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1116 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1117 }
1118}
1119# [ cfg ( feature = "full" ) ]
1120pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1121 ExprIf {
1122 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1123 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1124 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001125 then_branch: _visitor.fold_block(_i . then_branch),
1126 else_branch: (_i . else_branch).map(|it| { (
1127 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1128 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1129 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001130 }
1131}
1132# [ cfg ( feature = "full" ) ]
1133pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1134 ExprIfLet {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1137 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1138 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1139 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1140 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001141 then_branch: _visitor.fold_block(_i . then_branch),
1142 else_branch: (_i . else_branch).map(|it| { (
1143 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1144 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1145 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001146 }
1147}
1148# [ cfg ( feature = "full" ) ]
1149pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1150 ExprInPlace {
1151 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1152 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001153 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001154 value: Box::new(_visitor.fold_expr(* _i . value)),
1155 }
1156}
1157
1158pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1159 ExprIndex {
1160 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1161 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1162 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1163 index: Box::new(_visitor.fold_expr(* _i . index)),
1164 }
1165}
1166
1167pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1168 ExprLit {
1169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1170 lit: _visitor.fold_lit(_i . lit),
1171 }
1172}
1173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001174pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001175 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001176 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001177 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001178 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001179 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1180 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001181 }
1182}
1183# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001184pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1185 ExprMacro {
1186 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1187 mac: _visitor.fold_macro(_i . mac),
1188 }
1189}
1190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001191pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001192 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001193 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001194 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001195 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001196 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001197 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1198 }
1199}
1200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001201pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001202 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001203 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001204 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001205 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001206 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001207 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001208 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1209 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001210 }
1211}
David Tolnaye98775f2017-12-28 23:17:00 -05001212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001213pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001214 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001215 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001216 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001218 }
1219}
1220
Nika Layzella6f46c42017-10-26 15:26:16 -04001221pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001222 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001223 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001224 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001225 path: _visitor.fold_path(_i . path),
1226 }
1227}
1228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001229pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001230 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001231 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001232 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001233 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001234 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001235 }
1236}
1237# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001238pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001239 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001240 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001241 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001242 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001243 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001244 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1245 }
1246}
1247# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001248pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1249 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001251 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001252 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001253 }
1254}
1255# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001256pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001257 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001258 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001259 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001260 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001261 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1262 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1263 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001264 }
1265}
1266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001267pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001268 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001269 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001270 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001271 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
1273}
1274# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001275pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1276 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001277 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001278 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001279 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001280 }
1281}
David Tolnay0cf94f22017-12-28 23:46:26 -05001282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001283pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001284 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001285 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001286 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001287 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001288 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001289 }
1290}
1291
Nika Layzella6f46c42017-10-26 15:26:16 -04001292pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001293 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001294 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001295 op: _visitor.fold_un_op(_i . op),
1296 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1297 }
1298}
1299# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001300pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1301 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001302 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001303 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001304 block: _visitor.fold_block(_i . block),
1305 }
1306}
1307# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001308pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001309 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001310 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001311 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1313 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001314 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1315 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001316 }
1317}
1318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001319pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001320 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001321 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001322 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001323 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1324 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1325 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001326 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001327 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001328 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1329 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001330 }
1331}
1332# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001333pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001334 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001335 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001336 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001337 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001338 }
1339}
1340
Nika Layzella6f46c42017-10-26 15:26:16 -04001341pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001342 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001343 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001344 vis: _visitor.fold_visibility(_i . vis),
1345 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001346 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001347 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001348 }
1349}
1350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001351pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001352 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001353 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001354 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001355 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001356 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001357 }
1358}
1359# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001360pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001361 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001362 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1363 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001364 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001365 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001366 }
1367}
1368# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001369pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001370 File {
1371 shebang: _i . shebang,
1372 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1373 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1374 }
1375}
1376# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001377pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001378 use ::FnArg::*;
1379 match _i {
1380 SelfRef(_binding_0, ) => {
1381 SelfRef (
1382 _visitor.fold_arg_self_ref(_binding_0),
1383 )
1384 }
1385 SelfValue(_binding_0, ) => {
1386 SelfValue (
1387 _visitor.fold_arg_self(_binding_0),
1388 )
1389 }
1390 Captured(_binding_0, ) => {
1391 Captured (
1392 _visitor.fold_arg_captured(_binding_0),
1393 )
1394 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001395 Inferred(_binding_0, ) => {
1396 Inferred (
1397 _visitor.fold_pat(_binding_0),
1398 )
1399 }
Nika Layzell27726662017-10-24 23:16:35 -04001400 Ignored(_binding_0, ) => {
1401 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001402 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001403 )
1404 }
1405 }
1406}
1407# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001408pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001409 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001410 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001411 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001412 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001413 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001414 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001415 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001416 }
1417}
1418# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001419pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001420 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001421 match _i {
1422 Fn(_binding_0, ) => {
1423 Fn (
1424 _visitor.fold_foreign_item_fn(_binding_0),
1425 )
1426 }
1427 Static(_binding_0, ) => {
1428 Static (
1429 _visitor.fold_foreign_item_static(_binding_0),
1430 )
1431 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001432 Type(_binding_0, ) => {
1433 Type (
1434 _visitor.fold_foreign_item_type(_binding_0),
1435 )
1436 }
Nika Layzell27726662017-10-24 23:16:35 -04001437 }
1438}
1439# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001440pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1441 ForeignItemFn {
1442 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1443 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001444 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001445 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001446 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001447 }
1448}
1449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001450pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001451 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1453 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001454 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001455 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001456 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001457 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001458 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001459 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001460 }
1461}
David Tolnay199bcbb2017-11-12 10:33:52 -08001462# [ cfg ( feature = "full" ) ]
1463pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1464 ForeignItemType {
1465 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1466 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001467 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001468 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001469 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001470 }
1471}
Nika Layzell27726662017-10-24 23:16:35 -04001472
Nika Layzellc08227a2017-12-04 16:30:17 -05001473pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1474 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001475 match _i {
1476 Lifetime(_binding_0, ) => {
1477 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001478 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001479 )
1480 }
1481 Type(_binding_0, ) => {
1482 Type (
1483 _visitor.fold_type(_binding_0),
1484 )
1485 }
1486 TypeBinding(_binding_0, ) => {
1487 TypeBinding (
1488 _visitor.fold_type_binding(_binding_0),
1489 )
1490 }
Nika Layzellc680e612017-12-04 19:07:20 -05001491 Const(_binding_0, ) => {
1492 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001493 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001494 )
1495 }
Nika Layzell357885a2017-12-04 15:47:07 -05001496 }
1497}
David Tolnayd60cfec2017-12-29 00:21:38 -05001498# [ cfg ( feature = "full" ) ]
1499pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1500 use ::GenericMethodArgument::*;
1501 match _i {
1502 Type(_binding_0, ) => {
1503 Type (
1504 _visitor.fold_type(_binding_0),
1505 )
1506 }
1507 Const(_binding_0, ) => {
1508 Const (
1509 _visitor.fold_expr(_binding_0),
1510 )
1511 }
1512 }
1513}
Nika Layzell357885a2017-12-04 15:47:07 -05001514
David Tolnayc2f1aba2017-11-12 20:29:22 -08001515pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1516 use ::GenericParam::*;
1517 match _i {
1518 Lifetime(_binding_0, ) => {
1519 Lifetime (
1520 _visitor.fold_lifetime_def(_binding_0),
1521 )
1522 }
1523 Type(_binding_0, ) => {
1524 Type (
1525 _visitor.fold_type_param(_binding_0),
1526 )
1527 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001528 Const(_binding_0, ) => {
1529 Const (
1530 _visitor.fold_const_param(_binding_0),
1531 )
1532 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001533 }
1534}
1535
Nika Layzella6f46c42017-10-26 15:26:16 -04001536pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001537 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001538 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001539 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001540 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001541 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001542 }
1543}
1544# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001545pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001546 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001547 match _i {
1548 Const(_binding_0, ) => {
1549 Const (
1550 _visitor.fold_impl_item_const(_binding_0),
1551 )
1552 }
1553 Method(_binding_0, ) => {
1554 Method (
1555 _visitor.fold_impl_item_method(_binding_0),
1556 )
1557 }
1558 Type(_binding_0, ) => {
1559 Type (
1560 _visitor.fold_impl_item_type(_binding_0),
1561 )
1562 }
1563 Macro(_binding_0, ) => {
1564 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001565 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001566 )
1567 }
1568 }
1569}
1570# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001571pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1572 ImplItemConst {
1573 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1574 vis: _visitor.fold_visibility(_i . vis),
1575 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001576 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001577 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001578 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001579 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001580 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001581 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001582 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001583 }
1584}
1585# [ cfg ( feature = "full" ) ]
1586pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1587 ImplItemMacro {
1588 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1589 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001590 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001591 }
1592}
1593# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001594pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001595 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001596 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001597 vis: _visitor.fold_visibility(_i . vis),
1598 defaultness: _visitor.fold_defaultness(_i . defaultness),
1599 sig: _visitor.fold_method_sig(_i . sig),
1600 block: _visitor.fold_block(_i . block),
1601 }
1602}
1603# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001604pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001605 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001606 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001607 vis: _visitor.fold_visibility(_i . vis),
1608 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001609 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001610 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001611 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001612 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001613 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001614 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001615 }
1616}
1617# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001618pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001619 use ::ImplPolarity::*;
1620 match _i {
1621 Positive => { Positive }
1622 Negative(_binding_0, ) => {
1623 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001624 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001625 )
1626 }
1627 }
1628}
David Tolnay14982012017-12-29 00:49:51 -05001629
David Tolnay85b69a42017-12-27 20:43:10 -05001630pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1631 Index {
1632 index: _i . index,
1633 span: _visitor.fold_span(_i . span),
1634 }
1635}
1636# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001637pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001638 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001639 match _i {
1640 ExternCrate(_binding_0, ) => {
1641 ExternCrate (
1642 _visitor.fold_item_extern_crate(_binding_0),
1643 )
1644 }
1645 Use(_binding_0, ) => {
1646 Use (
1647 _visitor.fold_item_use(_binding_0),
1648 )
1649 }
1650 Static(_binding_0, ) => {
1651 Static (
1652 _visitor.fold_item_static(_binding_0),
1653 )
1654 }
1655 Const(_binding_0, ) => {
1656 Const (
1657 _visitor.fold_item_const(_binding_0),
1658 )
1659 }
1660 Fn(_binding_0, ) => {
1661 Fn (
1662 _visitor.fold_item_fn(_binding_0),
1663 )
1664 }
1665 Mod(_binding_0, ) => {
1666 Mod (
1667 _visitor.fold_item_mod(_binding_0),
1668 )
1669 }
1670 ForeignMod(_binding_0, ) => {
1671 ForeignMod (
1672 _visitor.fold_item_foreign_mod(_binding_0),
1673 )
1674 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001675 Type(_binding_0, ) => {
1676 Type (
1677 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001678 )
1679 }
1680 Enum(_binding_0, ) => {
1681 Enum (
1682 _visitor.fold_item_enum(_binding_0),
1683 )
1684 }
1685 Struct(_binding_0, ) => {
1686 Struct (
1687 _visitor.fold_item_struct(_binding_0),
1688 )
1689 }
1690 Union(_binding_0, ) => {
1691 Union (
1692 _visitor.fold_item_union(_binding_0),
1693 )
1694 }
1695 Trait(_binding_0, ) => {
1696 Trait (
1697 _visitor.fold_item_trait(_binding_0),
1698 )
1699 }
1700 DefaultImpl(_binding_0, ) => {
1701 DefaultImpl (
1702 _visitor.fold_item_default_impl(_binding_0),
1703 )
1704 }
1705 Impl(_binding_0, ) => {
1706 Impl (
1707 _visitor.fold_item_impl(_binding_0),
1708 )
1709 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001710 Macro(_binding_0, ) => {
1711 Macro (
1712 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001713 )
1714 }
David Tolnay500d8322017-12-18 00:32:51 -08001715 Macro2(_binding_0, ) => {
1716 Macro2 (
1717 _visitor.fold_item_macro2(_binding_0),
1718 )
1719 }
Nika Layzell27726662017-10-24 23:16:35 -04001720 }
1721}
1722# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001723pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1724 ItemConst {
1725 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1726 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001727 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001728 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001729 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001730 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001731 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001732 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001733 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001734 }
1735}
1736# [ cfg ( feature = "full" ) ]
1737pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1738 ItemDefaultImpl {
1739 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1740 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001741 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001742 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001743 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1744 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001745 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001746 }
1747}
1748# [ cfg ( feature = "full" ) ]
1749pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1750 ItemEnum {
1751 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1752 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001753 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001754 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001755 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001756 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1758 }
1759}
1760# [ cfg ( feature = "full" ) ]
1761pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1762 ItemExternCrate {
1763 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1764 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001765 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1766 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001767 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001768 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001769 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001770 _visitor.fold_ident(( it ) . 1),
1771 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001772 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001773 }
1774}
1775# [ cfg ( feature = "full" ) ]
1776pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1777 ItemFn {
1778 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1779 vis: _visitor.fold_visibility(_i . vis),
1780 constness: _visitor.fold_constness(_i . constness),
1781 unsafety: _visitor.fold_unsafety(_i . unsafety),
1782 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001783 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001784 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 block: Box::new(_visitor.fold_block(* _i . block)),
1786 }
1787}
1788# [ cfg ( feature = "full" ) ]
1789pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1790 ItemForeignMod {
1791 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1792 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001793 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1795 }
1796}
1797# [ cfg ( feature = "full" ) ]
1798pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1799 ItemImpl {
1800 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1801 defaultness: _visitor.fold_defaultness(_i . defaultness),
1802 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001805 trait_: (_i . trait_).map(|it| { (
1806 _visitor.fold_impl_polarity(( it ) . 0),
1807 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001808 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001809 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001810 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001811 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1813 }
1814}
1815# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001816pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1817 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001818 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001819 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001820 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001821 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001822 }
1823}
1824# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001825pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1826 ItemMacro2 {
1827 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1828 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001829 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001830 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001831 args: _i . args,
1832 body: _i . body,
1833 }
1834}
1835# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001836pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001837 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001838 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001839 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001840 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001841 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001842 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001843 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001844 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1845 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001846 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001847 }
1848}
1849# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001850pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001851 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001852 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001853 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001854 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05001855 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001856 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001857 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001858 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001860 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001861 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001862 }
1863}
1864# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001865pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001866 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001867 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001868 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001869 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001870 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001871 generics: _visitor.fold_generics(_i . generics),
1872 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001873 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001874 }
1875}
1876# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001877pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001878 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001879 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001880 vis: _visitor.fold_visibility(_i . vis),
1881 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001882 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1883 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001884 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001885 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001886 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001887 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001888 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001889 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1890 }
1891}
1892# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001893pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1894 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001895 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001896 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001897 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001898 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001899 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001900 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001901 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001902 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001903 }
1904}
1905# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001906pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001907 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001908 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001909 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001911 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001912 generics: _visitor.fold_generics(_i . generics),
1913 data: _visitor.fold_variant_data(_i . data),
1914 }
1915}
1916# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001917pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001918 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001919 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001920 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001921 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1922 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001923 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1924 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001925 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001926 }
1927}
1928
Nika Layzella6f46c42017-10-26 15:26:16 -04001929pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001930 LifetimeDef {
1931 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001932 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001933 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001934 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1935 }
1936}
1937
1938pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1939 Lit {
1940 value: _i . value,
1941 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001942 }
1943}
1944# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001945pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001946 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001947 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001948 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1949 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1950 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1951 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1952 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1953 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1954 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001955 }
1956}
Nika Layzell27726662017-10-24 23:16:35 -04001957
David Tolnaydecf28d2017-11-11 11:56:45 -08001958pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1959 Macro {
1960 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001961 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001962 tokens: _i . tokens,
1963 }
1964}
David Tolnay14982012017-12-29 00:49:51 -05001965
David Tolnay85b69a42017-12-27 20:43:10 -05001966pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1967 use ::Member::*;
1968 match _i {
1969 Named(_binding_0, ) => {
1970 Named (
1971 _visitor.fold_ident(_binding_0),
1972 )
1973 }
1974 Unnamed(_binding_0, ) => {
1975 Unnamed (
1976 _visitor.fold_index(_binding_0),
1977 )
1978 }
1979 }
1980}
David Tolnaydecf28d2017-11-11 11:56:45 -08001981
Nika Layzella6f46c42017-10-26 15:26:16 -04001982pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001983 use ::MetaItem::*;
1984 match _i {
1985 Term(_binding_0, ) => {
1986 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05001987 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001988 )
1989 }
1990 List(_binding_0, ) => {
1991 List (
1992 _visitor.fold_meta_item_list(_binding_0),
1993 )
1994 }
1995 NameValue(_binding_0, ) => {
1996 NameValue (
1997 _visitor.fold_meta_name_value(_binding_0),
1998 )
1999 }
2000 }
2001}
2002
Nika Layzella6f46c42017-10-26 15:26:16 -04002003pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002004 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002005 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002006 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002007 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2008 }
2009}
2010
Nika Layzella6f46c42017-10-26 15:26:16 -04002011pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002012 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002013 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002014 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002015 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002016 }
2017}
2018# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002019pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002020 MethodSig {
2021 constness: _visitor.fold_constness(_i . constness),
2022 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002023 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002024 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002025 decl: _visitor.fold_fn_decl(_i . decl),
2026 }
2027}
David Tolnayd60cfec2017-12-29 00:21:38 -05002028# [ cfg ( feature = "full" ) ]
2029pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2030 MethodTurbofish {
2031 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2032 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2033 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2034 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2035 }
2036}
Nika Layzell27726662017-10-24 23:16:35 -04002037
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002038pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2039 MutType {
David Tolnay24237fb2017-12-29 02:15:26 -05002040 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002041 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002042 }
2043}
2044
Nika Layzella6f46c42017-10-26 15:26:16 -04002045pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002046 use ::NestedMetaItem::*;
2047 match _i {
2048 MetaItem(_binding_0, ) => {
2049 MetaItem (
2050 _visitor.fold_meta_item(_binding_0),
2051 )
2052 }
2053 Literal(_binding_0, ) => {
2054 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002055 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002056 )
2057 }
2058 }
2059}
2060
Nika Layzellc08227a2017-12-04 16:30:17 -05002061pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2062 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002063 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002064 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002065 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002066 }
2067}
2068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002069pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002070 use ::Pat::*;
2071 match _i {
2072 Wild(_binding_0, ) => {
2073 Wild (
2074 _visitor.fold_pat_wild(_binding_0),
2075 )
2076 }
2077 Ident(_binding_0, ) => {
2078 Ident (
2079 _visitor.fold_pat_ident(_binding_0),
2080 )
2081 }
2082 Struct(_binding_0, ) => {
2083 Struct (
2084 _visitor.fold_pat_struct(_binding_0),
2085 )
2086 }
2087 TupleStruct(_binding_0, ) => {
2088 TupleStruct (
2089 _visitor.fold_pat_tuple_struct(_binding_0),
2090 )
2091 }
2092 Path(_binding_0, ) => {
2093 Path (
2094 _visitor.fold_pat_path(_binding_0),
2095 )
2096 }
2097 Tuple(_binding_0, ) => {
2098 Tuple (
2099 _visitor.fold_pat_tuple(_binding_0),
2100 )
2101 }
2102 Box(_binding_0, ) => {
2103 Box (
2104 _visitor.fold_pat_box(_binding_0),
2105 )
2106 }
2107 Ref(_binding_0, ) => {
2108 Ref (
2109 _visitor.fold_pat_ref(_binding_0),
2110 )
2111 }
2112 Lit(_binding_0, ) => {
2113 Lit (
2114 _visitor.fold_pat_lit(_binding_0),
2115 )
2116 }
2117 Range(_binding_0, ) => {
2118 Range (
2119 _visitor.fold_pat_range(_binding_0),
2120 )
2121 }
2122 Slice(_binding_0, ) => {
2123 Slice (
2124 _visitor.fold_pat_slice(_binding_0),
2125 )
2126 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002127 Macro(_binding_0, ) => {
2128 Macro (
2129 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002130 )
2131 }
2132 }
2133}
2134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002135pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002136 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002137 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002138 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002139 }
2140}
2141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002142pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002143 PatIdent {
David Tolnay24237fb2017-12-29 02:15:26 -05002144 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2145 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002146 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002147 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002148 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002149 }
2150}
2151# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002152pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002153 PatLit {
2154 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2155 }
2156}
2157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002158pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002159 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002160 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002161 path: _visitor.fold_path(_i . path),
2162 }
2163}
2164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002165pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002166 PatRange {
2167 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002168 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002169 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002170 }
2171}
2172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002173pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002174 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002175 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay24237fb2017-12-29 02:15:26 -05002176 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002177 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002178 }
2179}
2180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002181pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002182 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002183 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002184 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002185 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002186 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002187 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002188 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002189 }
2190}
2191# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002192pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002193 PatStruct {
2194 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002195 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002196 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002197 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002198 }
2199}
2200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002201pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002202 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002203 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002204 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002205 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002206 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2207 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
2209}
2210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002212 PatTupleStruct {
2213 path: _visitor.fold_path(_i . path),
2214 pat: _visitor.fold_pat_tuple(_i . pat),
2215 }
2216}
2217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002218pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002219 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002220 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002221 }
2222}
2223
Nika Layzella6f46c42017-10-26 15:26:16 -04002224pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002225 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002226 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002227 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2228 }
2229}
Nika Layzellc08227a2017-12-04 16:30:17 -05002230
2231pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2232 use ::PathArguments::*;
2233 match _i {
2234 None => { None }
2235 AngleBracketed(_binding_0, ) => {
2236 AngleBracketed (
2237 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2238 )
2239 }
2240 Parenthesized(_binding_0, ) => {
2241 Parenthesized (
2242 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2243 )
2244 }
2245 }
2246}
Nika Layzell27726662017-10-24 23:16:35 -04002247
Nika Layzella6f46c42017-10-26 15:26:16 -04002248pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002249 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002250 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002251 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002252 }
2253}
Nika Layzell27726662017-10-24 23:16:35 -04002254
Nika Layzella6f46c42017-10-26 15:26:16 -04002255pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002256 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002257 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002258 trait_ref: _visitor.fold_path(_i . trait_ref),
2259 }
2260}
2261
Nika Layzella6f46c42017-10-26 15:26:16 -04002262pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002263 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002264 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002265 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002266 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002267 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2268 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002269 }
2270}
2271# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002272pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002273 use ::RangeLimits::*;
2274 match _i {
2275 HalfOpen(_binding_0, ) => {
2276 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002277 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002278 )
2279 }
2280 Closed(_binding_0, ) => {
2281 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002282 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002283 )
2284 }
2285 }
2286}
David Tolnayf93b90d2017-11-11 19:21:26 -08002287
2288pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2289 use ::ReturnType::*;
2290 match _i {
2291 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002292 Type(_binding_0, _binding_1, ) => {
2293 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002294 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2295 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002296 )
2297 }
2298 }
2299}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002300
2301pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2302 _i
2303}
Nika Layzell27726662017-10-24 23:16:35 -04002304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002305pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002306 use ::Stmt::*;
2307 match _i {
2308 Local(_binding_0, ) => {
2309 Local (
2310 Box::new(_visitor.fold_local(* _binding_0)),
2311 )
2312 }
2313 Item(_binding_0, ) => {
2314 Item (
2315 Box::new(_visitor.fold_item(* _binding_0)),
2316 )
2317 }
2318 Expr(_binding_0, ) => {
2319 Expr (
2320 Box::new(_visitor.fold_expr(* _binding_0)),
2321 )
2322 }
2323 Semi(_binding_0, _binding_1, ) => {
2324 Semi (
2325 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002326 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002327 )
2328 }
Nika Layzell27726662017-10-24 23:16:35 -04002329 }
2330}
2331
Nika Layzella6f46c42017-10-26 15:26:16 -04002332pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002333 use ::TraitBoundModifier::*;
2334 match _i {
2335 None => { None }
2336 Maybe(_binding_0, ) => {
2337 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002338 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002339 )
2340 }
2341 }
2342}
2343# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002344pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002345 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002346 match _i {
2347 Const(_binding_0, ) => {
2348 Const (
2349 _visitor.fold_trait_item_const(_binding_0),
2350 )
2351 }
2352 Method(_binding_0, ) => {
2353 Method (
2354 _visitor.fold_trait_item_method(_binding_0),
2355 )
2356 }
2357 Type(_binding_0, ) => {
2358 Type (
2359 _visitor.fold_trait_item_type(_binding_0),
2360 )
2361 }
2362 Macro(_binding_0, ) => {
2363 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002364 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002365 )
2366 }
2367 }
2368}
2369# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002370pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2371 TraitItemConst {
2372 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002373 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002374 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002375 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002376 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002377 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002378 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002379 _visitor.fold_expr(( it ) . 1),
2380 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002381 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002382 }
2383}
2384# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002385pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2386 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002387 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002388 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002389 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002390 }
2391}
2392# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002393pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002394 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002395 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002396 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002397 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002398 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002399 }
2400}
2401# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002402pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002403 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002404 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002405 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002406 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002407 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002408 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002409 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002410 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002411 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002412 _visitor.fold_type(( it ) . 1),
2413 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002414 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002415 }
2416}
2417
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002418pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2419 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002420 match _i {
2421 Slice(_binding_0, ) => {
2422 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002423 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002424 )
2425 }
2426 Array(_binding_0, ) => {
2427 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002428 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002429 )
2430 }
2431 Ptr(_binding_0, ) => {
2432 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002433 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002434 )
2435 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002436 Reference(_binding_0, ) => {
2437 Reference (
2438 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002439 )
2440 }
2441 BareFn(_binding_0, ) => {
2442 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002443 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002444 )
2445 }
2446 Never(_binding_0, ) => {
2447 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002448 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002449 )
2450 }
David Tolnay05362582017-12-26 01:33:57 -05002451 Tuple(_binding_0, ) => {
2452 Tuple (
2453 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002454 )
2455 }
2456 Path(_binding_0, ) => {
2457 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002458 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002459 )
2460 }
2461 TraitObject(_binding_0, ) => {
2462 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002463 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002464 )
2465 }
2466 ImplTrait(_binding_0, ) => {
2467 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002468 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002469 )
2470 }
2471 Paren(_binding_0, ) => {
2472 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002473 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002474 )
2475 }
2476 Group(_binding_0, ) => {
2477 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002478 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002479 )
2480 }
2481 Infer(_binding_0, ) => {
2482 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002483 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002484 )
2485 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002486 Macro(_binding_0, ) => {
2487 Macro (
2488 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002489 )
2490 }
2491 }
2492}
2493
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002494pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2495 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002496 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002497 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002498 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002499 amt: _visitor.fold_expr(_i . amt),
2500 }
2501}
2502
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2504 TypeBareFn {
2505 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002506 }
2507}
2508
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2510 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002511 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002512 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002513 ty: _visitor.fold_type(_i . ty),
2514 }
2515}
2516
2517pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2518 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002519 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002520 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002521 }
2522}
2523
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002524pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2525 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002526 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002527 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002528 }
2529}
2530
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2532 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002533 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002534 }
2535}
2536
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002537pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2538 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002539 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002540 }
2541}
2542
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2544 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002545 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002546 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002547 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002548 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002549 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002551 }
2552}
2553
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002554pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2555 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002556 match _i {
2557 Trait(_binding_0, _binding_1, ) => {
2558 Trait (
2559 _visitor.fold_poly_trait_ref(_binding_0),
2560 _visitor.fold_trait_bound_modifier(_binding_1),
2561 )
2562 }
2563 Region(_binding_0, ) => {
2564 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002565 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002566 )
2567 }
2568 }
2569}
2570
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002571pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2572 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002573 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002575 }
2576}
2577
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002578pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2579 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002580 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002581 path: _visitor.fold_path(_i . path),
2582 }
2583}
2584
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2586 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2588 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002589 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002590 }
2591}
2592
David Tolnay0a89b4d2017-11-13 00:55:45 -08002593pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2594 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002596 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002598 }
2599}
2600
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002601pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2602 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002603 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002604 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002605 }
2606}
2607
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002608pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2609 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002610 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002612 }
2613}
2614
David Tolnay05362582017-12-26 01:33:57 -05002615pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2616 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002617 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002618 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002619 }
2620}
2621
Nika Layzella6f46c42017-10-26 15:26:16 -04002622pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002623 use ::UnOp::*;
2624 match _i {
2625 Deref(_binding_0, ) => {
2626 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002627 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002628 )
2629 }
2630 Not(_binding_0, ) => {
2631 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002632 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002633 )
2634 }
2635 Neg(_binding_0, ) => {
2636 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002637 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002638 )
2639 }
2640 }
2641}
2642
Nika Layzella6f46c42017-10-26 15:26:16 -04002643pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002644 use ::Unsafety::*;
2645 match _i {
2646 Unsafe(_binding_0, ) => {
2647 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002648 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002649 )
2650 }
2651 Normal => { Normal }
2652 }
2653}
David Tolnay5f332a92017-12-26 00:42:45 -05002654# [ cfg ( feature = "full" ) ]
2655pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2656 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002657 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002658 }
2659}
2660# [ cfg ( feature = "full" ) ]
2661pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2662 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002663 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002664 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2665 }
2666}
2667# [ cfg ( feature = "full" ) ]
2668pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2669 UsePath {
2670 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002671 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002672 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002673 _visitor.fold_ident(( it ) . 1),
2674 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002675 }
2676}
2677# [ cfg ( feature = "full" ) ]
2678pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2679 use ::UseTree::*;
2680 match _i {
2681 Path(_binding_0, ) => {
2682 Path (
2683 _visitor.fold_use_path(_binding_0),
2684 )
2685 }
2686 Glob(_binding_0, ) => {
2687 Glob (
2688 _visitor.fold_use_glob(_binding_0),
2689 )
2690 }
2691 List(_binding_0, ) => {
2692 List (
2693 _visitor.fold_use_list(_binding_0),
2694 )
2695 }
2696 }
2697}
Nika Layzell27726662017-10-24 23:16:35 -04002698
Nika Layzella6f46c42017-10-26 15:26:16 -04002699pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002700 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002701 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002702 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002703 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002704 discriminant: (_i . discriminant).map(|it| { (
2705 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2706 _visitor.fold_expr(( it ) . 1),
2707 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002708 }
2709}
2710
Nika Layzella6f46c42017-10-26 15:26:16 -04002711pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002712 use ::VariantData::*;
2713 match _i {
2714 Struct(_binding_0, _binding_1, ) => {
2715 Struct (
2716 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002717 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002718 )
2719 }
2720 Tuple(_binding_0, _binding_1, ) => {
2721 Tuple (
2722 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002723 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002724 )
2725 }
2726 Unit => { Unit }
2727 }
2728}
Nika Layzell27726662017-10-24 23:16:35 -04002729
Nika Layzella6f46c42017-10-26 15:26:16 -04002730pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002731 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002732 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002733 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002734 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002735 }
2736}
2737
Nika Layzella6f46c42017-10-26 15:26:16 -04002738pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002739 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002740 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002741 }
2742}
2743
Nika Layzella6f46c42017-10-26 15:26:16 -04002744pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002745 VisRestricted {
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 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002749 path: Box::new(_visitor.fold_path(* _i . path)),
2750 }
2751}
2752
Nika Layzella6f46c42017-10-26 15:26:16 -04002753pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002754 use ::Visibility::*;
2755 match _i {
2756 Public(_binding_0, ) => {
2757 Public (
2758 _visitor.fold_vis_public(_binding_0),
2759 )
2760 }
2761 Crate(_binding_0, ) => {
2762 Crate (
2763 _visitor.fold_vis_crate(_binding_0),
2764 )
2765 }
2766 Restricted(_binding_0, ) => {
2767 Restricted (
2768 _visitor.fold_vis_restricted(_binding_0),
2769 )
2770 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002771 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002772 }
2773}
2774
Nika Layzella6f46c42017-10-26 15:26:16 -04002775pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002776 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002777 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002778 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002779 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002780 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
2782}
2783
Nika Layzella6f46c42017-10-26 15:26:16 -04002784pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002785 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002786 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002787 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2788 }
2789}
2790
Nika Layzella6f46c42017-10-26 15:26:16 -04002791pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002792 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002793 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002795 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002796 }
2797}
2798
Nika Layzella6f46c42017-10-26 15:26:16 -04002799pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002800 use ::WherePredicate::*;
2801 match _i {
2802 BoundPredicate(_binding_0, ) => {
2803 BoundPredicate (
2804 _visitor.fold_where_bound_predicate(_binding_0),
2805 )
2806 }
2807 RegionPredicate(_binding_0, ) => {
2808 RegionPredicate (
2809 _visitor.fold_where_region_predicate(_binding_0),
2810 )
2811 }
2812 EqPredicate(_binding_0, ) => {
2813 EqPredicate (
2814 _visitor.fold_where_eq_predicate(_binding_0),
2815 )
2816 }
2817 }
2818}
2819
Nika Layzella6f46c42017-10-26 15:26:16 -04002820pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002821 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002822 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002823 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002824 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002825 }
2826}
2827