blob: 25ddbc6141c407e5c04cae02bc7e0121283b158b [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_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050082
83fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132
David Tolnay8c91b882017-12-28 23:04:32 -0500133fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500137fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500151fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500157fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500163fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800188# [ cfg ( feature = "full" ) ]
189fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190
Nika Layzellc08227a2017-12-04 16:30:17 -0500191fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500192# [ cfg ( feature = "full" ) ]
193fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500194
David Tolnayc2f1aba2017-11-12 20:29:22 -0800195fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
196
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500198
199fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800205fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500213fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800231fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800233fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800243fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248
David Tolnay4ba63a02017-12-28 15:53:05 -0500249fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500252
253fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
David Tolnaydecf28d2017-11-11 11:56:45 -0800257fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay85b69a42017-12-27 20:43:10 -0500258# [ cfg ( feature = "full" ) ]
259fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500268# [ cfg ( feature = "full" ) ]
269fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800271fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
Nika Layzellc08227a2017-12-04 16:30:17 -0500277fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500304
305fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800314
315fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500316
317fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800327fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
Nika Layzella6f46c42017-10-26 15:26:16 -0400339fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800341fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
342
343fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
344
345fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
346
347fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
348
349fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
350
351fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
352
353fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
354
355fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
356
357fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
358
David Tolnay0a89b4d2017-11-13 00:55:45 -0800359fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360
361fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
362
363fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
364
David Tolnay05362582017-12-26 01:33:57 -0500365fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500370# [ cfg ( feature = "full" ) ]
371fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
376# [ cfg ( feature = "full" ) ]
377fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
401}
402
403
Nika Layzella6f46c42017-10-26 15:26:16 -0400404pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400405 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500406 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400407 kind: _visitor.fold_abi_kind(_i . kind),
408 }
409}
410
Nika Layzella6f46c42017-10-26 15:26:16 -0400411pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400412 use ::AbiKind::*;
413 match _i {
414 Named(_binding_0, ) => {
415 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500416 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400417 )
418 }
419 Default => { Default }
420 }
421}
422
Nika Layzellc08227a2017-12-04 16:30:17 -0500423pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
424 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500425 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500426 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500427 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500428 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400429 }
430}
431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400432pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400433 ArgCaptured {
434 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500435 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800436 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400437 }
438}
439# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400440pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400441 ArgSelf {
442 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500443 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400444 }
445}
446# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400447pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400448 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500449 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500450 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400451 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500452 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400453 }
454}
455# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400456pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400457 Arm {
458 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
459 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400461 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500462 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400463 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500464 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400465 }
466}
467
Nika Layzella6f46c42017-10-26 15:26:16 -0400468pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400469 use ::AttrStyle::*;
470 match _i {
471 Outer => { Outer }
472 Inner(_binding_0, ) => {
473 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400475 )
476 }
477 }
478}
479
Nika Layzella6f46c42017-10-26 15:26:16 -0400480pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400481 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500482 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500483 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500484 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400485 path: _visitor.fold_path(_i . path),
486 tts: _i . tts,
487 is_sugared_doc: _i . is_sugared_doc,
488 }
489}
490
Nika Layzella6f46c42017-10-26 15:26:16 -0400491pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400492 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500493 name: (_i . name).map(|it| { (
494 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500495 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500496 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800497 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400498 }
499}
500
Nika Layzella6f46c42017-10-26 15:26:16 -0400501pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400502 use ::BareFnArgName::*;
503 match _i {
504 Named(_binding_0, ) => {
505 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500506 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400507 )
508 }
509 Wild(_binding_0, ) => {
510 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500511 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400512 )
513 }
514 }
515}
516
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800517pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
518 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400519 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400520 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500522 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500523 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400524 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500525 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800526 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400527 }
528}
529
Nika Layzella6f46c42017-10-26 15:26:16 -0400530pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400531 use ::BinOp::*;
532 match _i {
533 Add(_binding_0, ) => {
534 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500535 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400536 )
537 }
538 Sub(_binding_0, ) => {
539 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500540 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400541 )
542 }
543 Mul(_binding_0, ) => {
544 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 Div(_binding_0, ) => {
549 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500550 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400551 )
552 }
553 Rem(_binding_0, ) => {
554 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
558 And(_binding_0, ) => {
559 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
563 Or(_binding_0, ) => {
564 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
568 BitXor(_binding_0, ) => {
569 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
573 BitAnd(_binding_0, ) => {
574 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
578 BitOr(_binding_0, ) => {
579 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
583 Shl(_binding_0, ) => {
584 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
588 Shr(_binding_0, ) => {
589 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
593 Eq(_binding_0, ) => {
594 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
598 Lt(_binding_0, ) => {
599 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
603 Le(_binding_0, ) => {
604 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
608 Ne(_binding_0, ) => {
609 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
613 Ge(_binding_0, ) => {
614 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
618 Gt(_binding_0, ) => {
619 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
623 AddEq(_binding_0, ) => {
624 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
628 SubEq(_binding_0, ) => {
629 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
633 MulEq(_binding_0, ) => {
634 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
638 DivEq(_binding_0, ) => {
639 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
643 RemEq(_binding_0, ) => {
644 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
648 BitXorEq(_binding_0, ) => {
649 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
653 BitAndEq(_binding_0, ) => {
654 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
658 BitOrEq(_binding_0, ) => {
659 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500660 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400661 )
662 }
663 ShlEq(_binding_0, ) => {
664 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500665 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400666 )
667 }
668 ShrEq(_binding_0, ) => {
669 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500670 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400671 )
672 }
673 }
674}
675# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400676pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400677 use ::BindingMode::*;
678 match _i {
679 ByRef(_binding_0, _binding_1, ) => {
680 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500681 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400682 _visitor.fold_mutability(_binding_1),
683 )
684 }
685 ByValue(_binding_0, ) => {
686 ByValue (
687 _visitor.fold_mutability(_binding_0),
688 )
689 }
690 }
691}
692# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400693pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400694 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500695 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400696 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
697 }
698}
699
Nika Layzella6f46c42017-10-26 15:26:16 -0400700pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400701 use ::Body::*;
702 match _i {
703 Enum(_binding_0, ) => {
704 Enum (
705 _visitor.fold_body_enum(_binding_0),
706 )
707 }
708 Struct(_binding_0, ) => {
709 Struct (
710 _visitor.fold_body_struct(_binding_0),
711 )
712 }
713 }
714}
715
Nika Layzella6f46c42017-10-26 15:26:16 -0400716pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400717 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500718 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500719 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400720 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
721 }
722}
723
Nika Layzella6f46c42017-10-26 15:26:16 -0400724pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400725 BodyStruct {
726 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500727 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
728 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400729 }
730}
731
Nika Layzella6f46c42017-10-26 15:26:16 -0400732pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400733 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500734 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
735 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400736 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500737 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400738 }
739}
740# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400741pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400742 use ::CaptureBy::*;
743 match _i {
744 Value(_binding_0, ) => {
745 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500746 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400747 )
748 }
749 Ref => { Ref }
750 }
751}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500752
753pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
754 ConstParam {
755 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500757 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500758 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500759 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500760 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500761 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
762 }
763}
Nika Layzell27726662017-10-24 23:16:35 -0400764# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400765pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400766 use ::Constness::*;
767 match _i {
768 Const(_binding_0, ) => {
769 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500770 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400771 )
772 }
773 NotConst => { NotConst }
774 }
775}
776# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400777pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400778 use ::Defaultness::*;
779 match _i {
780 Default(_binding_0, ) => {
781 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500782 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400783 )
784 }
785 Final => { Final }
786 }
787}
788
Nika Layzella6f46c42017-10-26 15:26:16 -0400789pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400790 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400791 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500792 vis: _visitor.fold_visibility(_i . vis),
793 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400794 generics: _visitor.fold_generics(_i . generics),
795 body: _visitor.fold_body(_i . body),
796 }
797}
798
Nika Layzella6f46c42017-10-26 15:26:16 -0400799pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500800 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400801 match _i {
802 Box(_binding_0, ) => {
803 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400804 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400805 )
806 }
807 InPlace(_binding_0, ) => {
808 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400809 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400810 )
811 }
812 Array(_binding_0, ) => {
813 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
817 Call(_binding_0, ) => {
818 Call (
819 _visitor.fold_expr_call(_binding_0),
820 )
821 }
822 MethodCall(_binding_0, ) => {
823 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
David Tolnay05362582017-12-26 01:33:57 -0500827 Tuple(_binding_0, ) => {
828 Tuple (
829 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400830 )
831 }
832 Binary(_binding_0, ) => {
833 Binary (
834 _visitor.fold_expr_binary(_binding_0),
835 )
836 }
837 Unary(_binding_0, ) => {
838 Unary (
839 _visitor.fold_expr_unary(_binding_0),
840 )
841 }
842 Lit(_binding_0, ) => {
843 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500844 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400845 )
846 }
847 Cast(_binding_0, ) => {
848 Cast (
849 _visitor.fold_expr_cast(_binding_0),
850 )
851 }
852 Type(_binding_0, ) => {
853 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500854 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
857 If(_binding_0, ) => {
858 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400859 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400860 )
861 }
862 IfLet(_binding_0, ) => {
863 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400864 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
867 While(_binding_0, ) => {
868 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
872 WhileLet(_binding_0, ) => {
873 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
877 ForLoop(_binding_0, ) => {
878 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
882 Loop(_binding_0, ) => {
883 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
887 Match(_binding_0, ) => {
888 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
892 Closure(_binding_0, ) => {
893 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
Nika Layzell640832a2017-12-04 13:37:09 -0500897 Unsafe(_binding_0, ) => {
898 Unsafe (
899 full!(_visitor.fold_expr_unsafe(_binding_0)),
900 )
901 }
Nika Layzell27726662017-10-24 23:16:35 -0400902 Block(_binding_0, ) => {
903 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
907 Assign(_binding_0, ) => {
908 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400909 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400910 )
911 }
912 AssignOp(_binding_0, ) => {
913 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Field(_binding_0, ) => {
918 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400919 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
Nika Layzell27726662017-10-24 23:16:35 -0400922 Index(_binding_0, ) => {
923 Index (
924 _visitor.fold_expr_index(_binding_0),
925 )
926 }
927 Range(_binding_0, ) => {
928 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
932 Path(_binding_0, ) => {
933 Path (
934 _visitor.fold_expr_path(_binding_0),
935 )
936 }
937 AddrOf(_binding_0, ) => {
938 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
942 Break(_binding_0, ) => {
943 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400944 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400945 )
946 }
947 Continue(_binding_0, ) => {
948 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400949 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
David Tolnayc246cd32017-12-28 23:14:32 -0500952 Return(_binding_0, ) => {
953 Return (
954 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400955 )
956 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800957 Macro(_binding_0, ) => {
958 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500959 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400960 )
961 }
962 Struct(_binding_0, ) => {
963 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400964 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400965 )
966 }
967 Repeat(_binding_0, ) => {
968 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400969 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
972 Paren(_binding_0, ) => {
973 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500974 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400975 )
976 }
977 Group(_binding_0, ) => {
978 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500979 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400980 )
981 }
982 Try(_binding_0, ) => {
983 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400984 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400985 )
986 }
987 Catch(_binding_0, ) => {
988 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400989 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400990 )
991 }
992 Yield(_binding_0, ) => {
993 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400994 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400995 )
996 }
997 }
998}
999# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001000pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
1001 ExprAddrOf {
1002 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1003 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1004 mutbl: _visitor.fold_mutability(_i . mutbl),
1005 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1006 }
1007}
1008# [ cfg ( feature = "full" ) ]
1009pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
1010 ExprArray {
1011 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1012 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001013 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001014 }
1015}
1016# [ cfg ( feature = "full" ) ]
1017pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1018 ExprAssign {
1019 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1020 left: Box::new(_visitor.fold_expr(* _i . left)),
1021 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1022 right: Box::new(_visitor.fold_expr(* _i . right)),
1023 }
1024}
1025# [ cfg ( feature = "full" ) ]
1026pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1027 ExprAssignOp {
1028 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1029 left: Box::new(_visitor.fold_expr(* _i . left)),
1030 op: _visitor.fold_bin_op(_i . op),
1031 right: Box::new(_visitor.fold_expr(* _i . right)),
1032 }
1033}
1034
1035pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1036 ExprBinary {
1037 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1038 left: Box::new(_visitor.fold_expr(* _i . left)),
1039 op: _visitor.fold_bin_op(_i . op),
1040 right: Box::new(_visitor.fold_expr(* _i . right)),
1041 }
1042}
1043# [ cfg ( feature = "full" ) ]
1044pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1045 ExprBlock {
1046 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1047 block: _visitor.fold_block(_i . block),
1048 }
1049}
1050# [ cfg ( feature = "full" ) ]
1051pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1052 ExprBox {
1053 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1054 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1055 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1056 }
1057}
1058# [ cfg ( feature = "full" ) ]
1059pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1060 ExprBreak {
1061 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1062 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1063 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1064 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1065 }
1066}
1067
1068pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1069 ExprCall {
1070 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1071 func: Box::new(_visitor.fold_expr(* _i . func)),
1072 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1073 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1074 }
1075}
1076
1077pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1078 ExprCast {
1079 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1080 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1081 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1082 ty: Box::new(_visitor.fold_type(* _i . ty)),
1083 }
1084}
1085# [ cfg ( feature = "full" ) ]
1086pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1087 ExprCatch {
1088 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1089 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1090 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1091 block: _visitor.fold_block(_i . block),
1092 }
1093}
1094# [ cfg ( feature = "full" ) ]
1095pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1096 ExprClosure {
1097 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1098 capture: _visitor.fold_capture_by(_i . capture),
1099 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1100 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1101 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1102 output: _visitor.fold_return_type(_i . output),
1103 body: Box::new(_visitor.fold_expr(* _i . body)),
1104 }
1105}
1106# [ cfg ( feature = "full" ) ]
1107pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1108 ExprContinue {
1109 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1110 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1111 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1112 }
1113}
1114# [ cfg ( feature = "full" ) ]
1115pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1116 ExprField {
1117 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1118 base: Box::new(_visitor.fold_expr(* _i . base)),
1119 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1120 member: _visitor.fold_member(_i . member),
1121 }
1122}
1123# [ cfg ( feature = "full" ) ]
1124pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1125 ExprForLoop {
1126 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1127 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1128 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1129 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1130 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1131 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1132 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1133 body: _visitor.fold_block(_i . body),
1134 }
1135}
David Tolnaye98775f2017-12-28 23:17:00 -05001136# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001137pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1138 ExprGroup {
1139 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1140 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1141 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1142 }
1143}
1144# [ cfg ( feature = "full" ) ]
1145pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1146 ExprIf {
1147 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1148 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1149 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1150 if_true: _visitor.fold_block(_i . if_true),
1151 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1152 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1153 }
1154}
1155# [ cfg ( feature = "full" ) ]
1156pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1157 ExprIfLet {
1158 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1159 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1160 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1161 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1162 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1163 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1164 if_true: _visitor.fold_block(_i . if_true),
1165 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1166 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1167 }
1168}
1169# [ cfg ( feature = "full" ) ]
1170pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1171 ExprInPlace {
1172 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1173 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001174 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001175 value: Box::new(_visitor.fold_expr(* _i . value)),
1176 }
1177}
1178
1179pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1180 ExprIndex {
1181 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1182 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1183 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1184 index: Box::new(_visitor.fold_expr(* _i . index)),
1185 }
1186}
1187
1188pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1189 ExprLit {
1190 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1191 lit: _visitor.fold_lit(_i . lit),
1192 }
1193}
1194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001195pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001197 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001198 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001199 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001200 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1201 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001202 }
1203}
1204# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001205pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1206 ExprMacro {
1207 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1208 mac: _visitor.fold_macro(_i . mac),
1209 }
1210}
1211# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001212pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001213 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001214 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001215 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001216 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001217 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001218 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1219 }
1220}
1221# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001222pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001223 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001224 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001225 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001226 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001227 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001228 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001229 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1230 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001231 }
1232}
David Tolnaye98775f2017-12-28 23:17:00 -05001233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001234pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001236 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001237 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001238 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001239 }
1240}
1241
Nika Layzella6f46c42017-10-26 15:26:16 -04001242pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001243 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001244 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001245 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001246 path: _visitor.fold_path(_i . path),
1247 }
1248}
1249# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001250pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001251 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001252 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001253 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001254 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001255 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001256 }
1257}
1258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001259pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001260 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001261 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001262 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001263 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001264 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001265 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1266 }
1267}
1268# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001269pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1270 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001271 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001272 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001273 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001274 }
1275}
1276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001277pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001278 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001279 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001280 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001281 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001282 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1283 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1284 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001285 }
1286}
1287# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001288pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001289 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001290 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001291 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001292 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001293 }
1294}
1295# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001296pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1297 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001298 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001299 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001300 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001301 }
1302}
David Tolnay0cf94f22017-12-28 23:46:26 -05001303# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001304pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001305 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001306 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001307 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001308 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001309 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001310 }
1311}
1312
Nika Layzella6f46c42017-10-26 15:26:16 -04001313pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001314 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001315 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001316 op: _visitor.fold_un_op(_i . op),
1317 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1318 }
1319}
1320# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001321pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1322 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001323 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001324 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001325 block: _visitor.fold_block(_i . block),
1326 }
1327}
1328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001329pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001330 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001331 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001332 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001333 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1334 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001335 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1336 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001337 }
1338}
1339# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001340pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001341 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001342 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001343 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001344 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1345 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1346 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001347 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001348 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001349 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1350 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001351 }
1352}
1353# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001354pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001355 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001356 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001357 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001358 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001359 }
1360}
1361
Nika Layzella6f46c42017-10-26 15:26:16 -04001362pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001363 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001364 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001365 vis: _visitor.fold_visibility(_i . vis),
1366 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001367 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001368 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001369 }
1370}
1371# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001372pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001373 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001374 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001375 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001376 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001377 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1378 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001379 }
1380}
1381# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001382pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001383 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001384 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1385 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001386 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001387 expr: _visitor.fold_expr(_i . expr),
1388 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001389 }
1390}
1391# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001392pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001393 File {
1394 shebang: _i . shebang,
1395 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1396 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1397 }
1398}
1399# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001400pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001401 use ::FnArg::*;
1402 match _i {
1403 SelfRef(_binding_0, ) => {
1404 SelfRef (
1405 _visitor.fold_arg_self_ref(_binding_0),
1406 )
1407 }
1408 SelfValue(_binding_0, ) => {
1409 SelfValue (
1410 _visitor.fold_arg_self(_binding_0),
1411 )
1412 }
1413 Captured(_binding_0, ) => {
1414 Captured (
1415 _visitor.fold_arg_captured(_binding_0),
1416 )
1417 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001418 Inferred(_binding_0, ) => {
1419 Inferred (
1420 _visitor.fold_pat(_binding_0),
1421 )
1422 }
Nika Layzell27726662017-10-24 23:16:35 -04001423 Ignored(_binding_0, ) => {
1424 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001425 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001426 )
1427 }
1428 }
1429}
1430# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001431pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001432 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001433 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001434 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001435 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001436 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001438 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001439 }
1440}
1441# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001442pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001443 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001444 match _i {
1445 Fn(_binding_0, ) => {
1446 Fn (
1447 _visitor.fold_foreign_item_fn(_binding_0),
1448 )
1449 }
1450 Static(_binding_0, ) => {
1451 Static (
1452 _visitor.fold_foreign_item_static(_binding_0),
1453 )
1454 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001455 Type(_binding_0, ) => {
1456 Type (
1457 _visitor.fold_foreign_item_type(_binding_0),
1458 )
1459 }
Nika Layzell27726662017-10-24 23:16:35 -04001460 }
1461}
1462# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001463pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1464 ForeignItemFn {
1465 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1466 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001467 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001468 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001469 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001470 }
1471}
1472# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001473pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001474 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001475 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1476 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001477 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001478 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001479 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001480 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001481 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001482 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001483 }
1484}
David Tolnay199bcbb2017-11-12 10:33:52 -08001485# [ cfg ( feature = "full" ) ]
1486pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1487 ForeignItemType {
1488 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1489 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001490 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001491 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001492 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001493 }
1494}
Nika Layzell27726662017-10-24 23:16:35 -04001495
Nika Layzellc08227a2017-12-04 16:30:17 -05001496pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1497 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001498 match _i {
1499 Lifetime(_binding_0, ) => {
1500 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001501 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001502 )
1503 }
1504 Type(_binding_0, ) => {
1505 Type (
1506 _visitor.fold_type(_binding_0),
1507 )
1508 }
1509 TypeBinding(_binding_0, ) => {
1510 TypeBinding (
1511 _visitor.fold_type_binding(_binding_0),
1512 )
1513 }
Nika Layzellc680e612017-12-04 19:07:20 -05001514 Const(_binding_0, ) => {
1515 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001516 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001517 )
1518 }
Nika Layzell357885a2017-12-04 15:47:07 -05001519 }
1520}
David Tolnayd60cfec2017-12-29 00:21:38 -05001521# [ cfg ( feature = "full" ) ]
1522pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1523 use ::GenericMethodArgument::*;
1524 match _i {
1525 Type(_binding_0, ) => {
1526 Type (
1527 _visitor.fold_type(_binding_0),
1528 )
1529 }
1530 Const(_binding_0, ) => {
1531 Const (
1532 _visitor.fold_expr(_binding_0),
1533 )
1534 }
1535 }
1536}
Nika Layzell357885a2017-12-04 15:47:07 -05001537
David Tolnayc2f1aba2017-11-12 20:29:22 -08001538pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1539 use ::GenericParam::*;
1540 match _i {
1541 Lifetime(_binding_0, ) => {
1542 Lifetime (
1543 _visitor.fold_lifetime_def(_binding_0),
1544 )
1545 }
1546 Type(_binding_0, ) => {
1547 Type (
1548 _visitor.fold_type_param(_binding_0),
1549 )
1550 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001551 Const(_binding_0, ) => {
1552 Const (
1553 _visitor.fold_const_param(_binding_0),
1554 )
1555 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001556 }
1557}
1558
Nika Layzella6f46c42017-10-26 15:26:16 -04001559pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001560 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001561 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001562 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001563 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001564 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001565 }
1566}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001567
1568pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001569 Ident {
1570 sym: _i . sym,
1571 span: _visitor.fold_span(_i . span),
1572 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001573}
Nika Layzell27726662017-10-24 23:16:35 -04001574# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001575pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001576 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001577 match _i {
1578 Const(_binding_0, ) => {
1579 Const (
1580 _visitor.fold_impl_item_const(_binding_0),
1581 )
1582 }
1583 Method(_binding_0, ) => {
1584 Method (
1585 _visitor.fold_impl_item_method(_binding_0),
1586 )
1587 }
1588 Type(_binding_0, ) => {
1589 Type (
1590 _visitor.fold_impl_item_type(_binding_0),
1591 )
1592 }
1593 Macro(_binding_0, ) => {
1594 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001595 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001596 )
1597 }
1598 }
1599}
1600# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001601pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1602 ImplItemConst {
1603 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1604 vis: _visitor.fold_visibility(_i . vis),
1605 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001606 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001607 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001608 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001609 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001610 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001611 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001612 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001613 }
1614}
1615# [ cfg ( feature = "full" ) ]
1616pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1617 ImplItemMacro {
1618 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1619 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001620 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001621 }
1622}
1623# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001624pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001625 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001626 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001627 vis: _visitor.fold_visibility(_i . vis),
1628 defaultness: _visitor.fold_defaultness(_i . defaultness),
1629 sig: _visitor.fold_method_sig(_i . sig),
1630 block: _visitor.fold_block(_i . block),
1631 }
1632}
1633# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001634pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001635 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001636 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001637 vis: _visitor.fold_visibility(_i . vis),
1638 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001639 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001640 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001641 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001642 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001643 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001644 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001645 }
1646}
1647# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001648pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001649 use ::ImplPolarity::*;
1650 match _i {
1651 Positive => { Positive }
1652 Negative(_binding_0, ) => {
1653 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001654 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001655 )
1656 }
1657 }
1658}
1659# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001660pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1661 Index {
1662 index: _i . index,
1663 span: _visitor.fold_span(_i . span),
1664 }
1665}
1666# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001667pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001668 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001669 match _i {
1670 ExternCrate(_binding_0, ) => {
1671 ExternCrate (
1672 _visitor.fold_item_extern_crate(_binding_0),
1673 )
1674 }
1675 Use(_binding_0, ) => {
1676 Use (
1677 _visitor.fold_item_use(_binding_0),
1678 )
1679 }
1680 Static(_binding_0, ) => {
1681 Static (
1682 _visitor.fold_item_static(_binding_0),
1683 )
1684 }
1685 Const(_binding_0, ) => {
1686 Const (
1687 _visitor.fold_item_const(_binding_0),
1688 )
1689 }
1690 Fn(_binding_0, ) => {
1691 Fn (
1692 _visitor.fold_item_fn(_binding_0),
1693 )
1694 }
1695 Mod(_binding_0, ) => {
1696 Mod (
1697 _visitor.fold_item_mod(_binding_0),
1698 )
1699 }
1700 ForeignMod(_binding_0, ) => {
1701 ForeignMod (
1702 _visitor.fold_item_foreign_mod(_binding_0),
1703 )
1704 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001705 Type(_binding_0, ) => {
1706 Type (
1707 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001708 )
1709 }
1710 Enum(_binding_0, ) => {
1711 Enum (
1712 _visitor.fold_item_enum(_binding_0),
1713 )
1714 }
1715 Struct(_binding_0, ) => {
1716 Struct (
1717 _visitor.fold_item_struct(_binding_0),
1718 )
1719 }
1720 Union(_binding_0, ) => {
1721 Union (
1722 _visitor.fold_item_union(_binding_0),
1723 )
1724 }
1725 Trait(_binding_0, ) => {
1726 Trait (
1727 _visitor.fold_item_trait(_binding_0),
1728 )
1729 }
1730 DefaultImpl(_binding_0, ) => {
1731 DefaultImpl (
1732 _visitor.fold_item_default_impl(_binding_0),
1733 )
1734 }
1735 Impl(_binding_0, ) => {
1736 Impl (
1737 _visitor.fold_item_impl(_binding_0),
1738 )
1739 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001740 Macro(_binding_0, ) => {
1741 Macro (
1742 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001743 )
1744 }
David Tolnay500d8322017-12-18 00:32:51 -08001745 Macro2(_binding_0, ) => {
1746 Macro2 (
1747 _visitor.fold_item_macro2(_binding_0),
1748 )
1749 }
Nika Layzell27726662017-10-24 23:16:35 -04001750 }
1751}
1752# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001753pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1754 ItemConst {
1755 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1756 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001757 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001758 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001759 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001760 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001761 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001762 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001763 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001764 }
1765}
1766# [ cfg ( feature = "full" ) ]
1767pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1768 ItemDefaultImpl {
1769 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1770 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001771 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001772 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001773 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1774 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001775 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001776 }
1777}
1778# [ cfg ( feature = "full" ) ]
1779pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1780 ItemEnum {
1781 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1782 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001783 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001784 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001785 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001786 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001787 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1788 }
1789}
1790# [ cfg ( feature = "full" ) ]
1791pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1792 ItemExternCrate {
1793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1794 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001795 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1796 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001797 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001798 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001799 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001800 _visitor.fold_ident(( it ) . 1),
1801 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001802 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001803 }
1804}
1805# [ cfg ( feature = "full" ) ]
1806pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1807 ItemFn {
1808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1809 vis: _visitor.fold_visibility(_i . vis),
1810 constness: _visitor.fold_constness(_i . constness),
1811 unsafety: _visitor.fold_unsafety(_i . unsafety),
1812 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001813 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001814 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001815 block: Box::new(_visitor.fold_block(* _i . block)),
1816 }
1817}
1818# [ cfg ( feature = "full" ) ]
1819pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1820 ItemForeignMod {
1821 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1822 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001823 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001824 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1825 }
1826}
1827# [ cfg ( feature = "full" ) ]
1828pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1829 ItemImpl {
1830 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1831 defaultness: _visitor.fold_defaultness(_i . defaultness),
1832 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001833 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001834 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001835 trait_: (_i . trait_).map(|it| { (
1836 _visitor.fold_impl_polarity(( it ) . 0),
1837 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001839 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001840 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001841 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001842 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1843 }
1844}
1845# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001846pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1847 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001848 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001849 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001850 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001851 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001852 }
1853}
1854# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001855pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1856 ItemMacro2 {
1857 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1858 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001860 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001861 args: _i . args,
1862 body: _i . body,
1863 }
1864}
1865# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001866pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001867 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001868 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001869 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001870 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001871 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001872 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001873 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001874 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1875 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001876 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001877 }
1878}
1879# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001880pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001881 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001882 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001883 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001884 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001885 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001886 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001887 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001888 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001890 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001892 }
1893}
1894# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001895pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001896 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001897 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001898 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001899 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001900 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001901 generics: _visitor.fold_generics(_i . generics),
1902 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001903 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001904 }
1905}
1906# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001907pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001908 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001909 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001910 vis: _visitor.fold_visibility(_i . vis),
1911 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001912 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1913 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001914 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001915 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001917 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001918 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001919 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1920 }
1921}
1922# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001923pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1924 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001925 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001926 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001927 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001928 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001929 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001930 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001931 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001932 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001933 }
1934}
1935# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001936pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001937 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001938 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001939 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001940 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001941 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001942 generics: _visitor.fold_generics(_i . generics),
1943 data: _visitor.fold_variant_data(_i . data),
1944 }
1945}
1946# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001947pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001948 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001949 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001950 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001951 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1952 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001953 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1954 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001955 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001956 }
1957}
1958
David Tolnay4ba63a02017-12-28 15:53:05 -05001959pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1960 Lifetime {
1961 sym: _i . sym,
1962 span: _visitor.fold_span(_i . span),
1963 }
1964}
1965
Nika Layzella6f46c42017-10-26 15:26:16 -04001966pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001967 LifetimeDef {
1968 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001969 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001970 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001971 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1972 }
1973}
1974
1975pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1976 Lit {
1977 value: _i . value,
1978 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001979 }
1980}
1981# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001982pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001983 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001985 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1986 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1987 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1988 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1989 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1990 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1991 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001992 }
1993}
Nika Layzell27726662017-10-24 23:16:35 -04001994
David Tolnaydecf28d2017-11-11 11:56:45 -08001995pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1996 Macro {
1997 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001998 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001999 tokens: _i . tokens,
2000 }
2001}
David Tolnay85b69a42017-12-27 20:43:10 -05002002# [ cfg ( feature = "full" ) ]
2003pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2004 use ::Member::*;
2005 match _i {
2006 Named(_binding_0, ) => {
2007 Named (
2008 _visitor.fold_ident(_binding_0),
2009 )
2010 }
2011 Unnamed(_binding_0, ) => {
2012 Unnamed (
2013 _visitor.fold_index(_binding_0),
2014 )
2015 }
2016 }
2017}
David Tolnaydecf28d2017-11-11 11:56:45 -08002018
Nika Layzella6f46c42017-10-26 15:26:16 -04002019pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002020 use ::MetaItem::*;
2021 match _i {
2022 Term(_binding_0, ) => {
2023 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002024 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002025 )
2026 }
2027 List(_binding_0, ) => {
2028 List (
2029 _visitor.fold_meta_item_list(_binding_0),
2030 )
2031 }
2032 NameValue(_binding_0, ) => {
2033 NameValue (
2034 _visitor.fold_meta_name_value(_binding_0),
2035 )
2036 }
2037 }
2038}
2039
Nika Layzella6f46c42017-10-26 15:26:16 -04002040pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002041 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002042 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002043 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002044 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2045 }
2046}
2047
Nika Layzella6f46c42017-10-26 15:26:16 -04002048pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002049 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002050 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002051 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002052 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002053 }
2054}
2055# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002056pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002057 MethodSig {
2058 constness: _visitor.fold_constness(_i . constness),
2059 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002060 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002061 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002062 decl: _visitor.fold_fn_decl(_i . decl),
2063 }
2064}
David Tolnayd60cfec2017-12-29 00:21:38 -05002065# [ cfg ( feature = "full" ) ]
2066pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2067 MethodTurbofish {
2068 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2069 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2070 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2071 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2072 }
2073}
Nika Layzell27726662017-10-24 23:16:35 -04002074
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002075pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2076 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002077 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002078 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002079 }
2080}
2081
Nika Layzella6f46c42017-10-26 15:26:16 -04002082pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002083 use ::Mutability::*;
2084 match _i {
2085 Mutable(_binding_0, ) => {
2086 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002087 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002088 )
2089 }
2090 Immutable => { Immutable }
2091 }
2092}
2093
Nika Layzella6f46c42017-10-26 15:26:16 -04002094pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002095 use ::NestedMetaItem::*;
2096 match _i {
2097 MetaItem(_binding_0, ) => {
2098 MetaItem (
2099 _visitor.fold_meta_item(_binding_0),
2100 )
2101 }
2102 Literal(_binding_0, ) => {
2103 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002104 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002105 )
2106 }
2107 }
2108}
2109
Nika Layzellc08227a2017-12-04 16:30:17 -05002110pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2111 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002112 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002113 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002114 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002115 }
2116}
2117# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002118pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002119 use ::Pat::*;
2120 match _i {
2121 Wild(_binding_0, ) => {
2122 Wild (
2123 _visitor.fold_pat_wild(_binding_0),
2124 )
2125 }
2126 Ident(_binding_0, ) => {
2127 Ident (
2128 _visitor.fold_pat_ident(_binding_0),
2129 )
2130 }
2131 Struct(_binding_0, ) => {
2132 Struct (
2133 _visitor.fold_pat_struct(_binding_0),
2134 )
2135 }
2136 TupleStruct(_binding_0, ) => {
2137 TupleStruct (
2138 _visitor.fold_pat_tuple_struct(_binding_0),
2139 )
2140 }
2141 Path(_binding_0, ) => {
2142 Path (
2143 _visitor.fold_pat_path(_binding_0),
2144 )
2145 }
2146 Tuple(_binding_0, ) => {
2147 Tuple (
2148 _visitor.fold_pat_tuple(_binding_0),
2149 )
2150 }
2151 Box(_binding_0, ) => {
2152 Box (
2153 _visitor.fold_pat_box(_binding_0),
2154 )
2155 }
2156 Ref(_binding_0, ) => {
2157 Ref (
2158 _visitor.fold_pat_ref(_binding_0),
2159 )
2160 }
2161 Lit(_binding_0, ) => {
2162 Lit (
2163 _visitor.fold_pat_lit(_binding_0),
2164 )
2165 }
2166 Range(_binding_0, ) => {
2167 Range (
2168 _visitor.fold_pat_range(_binding_0),
2169 )
2170 }
2171 Slice(_binding_0, ) => {
2172 Slice (
2173 _visitor.fold_pat_slice(_binding_0),
2174 )
2175 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002176 Macro(_binding_0, ) => {
2177 Macro (
2178 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002179 )
2180 }
2181 }
2182}
2183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002184pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002185 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002186 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002187 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002188 }
2189}
2190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002191pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002192 PatIdent {
2193 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002194 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002195 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002196 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002197 }
2198}
2199# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002200pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002201 PatLit {
2202 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2203 }
2204}
2205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002206pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002207 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002208 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002209 path: _visitor.fold_path(_i . path),
2210 }
2211}
2212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002213pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002214 PatRange {
2215 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002216 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002217 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002218 }
2219}
2220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002221pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002222 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002223 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002224 mutbl: _visitor.fold_mutability(_i . mutbl),
2225 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002226 }
2227}
2228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002229pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002230 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002231 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002232 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002233 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002234 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002235 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2236 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002237 }
2238}
2239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002240pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002241 PatStruct {
2242 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002243 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002244 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002245 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002246 }
2247}
2248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002250 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002251 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002252 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002253 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002254 dots_pos: _i . dots_pos,
2255 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002256 }
2257}
2258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002259pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002260 PatTupleStruct {
2261 path: _visitor.fold_path(_i . path),
2262 pat: _visitor.fold_pat_tuple(_i . pat),
2263 }
2264}
2265# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002266pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002267 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002268 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002269 }
2270}
2271
Nika Layzella6f46c42017-10-26 15:26:16 -04002272pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002273 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002274 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002275 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2276 }
2277}
Nika Layzellc08227a2017-12-04 16:30:17 -05002278
2279pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2280 use ::PathArguments::*;
2281 match _i {
2282 None => { None }
2283 AngleBracketed(_binding_0, ) => {
2284 AngleBracketed (
2285 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2286 )
2287 }
2288 Parenthesized(_binding_0, ) => {
2289 Parenthesized (
2290 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2291 )
2292 }
2293 }
2294}
Nika Layzell27726662017-10-24 23:16:35 -04002295
Nika Layzella6f46c42017-10-26 15:26:16 -04002296pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002297 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002298 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002299 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002300 }
2301}
Nika Layzell27726662017-10-24 23:16:35 -04002302
Nika Layzella6f46c42017-10-26 15:26:16 -04002303pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002304 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002305 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002306 trait_ref: _visitor.fold_path(_i . trait_ref),
2307 }
2308}
2309
Nika Layzella6f46c42017-10-26 15:26:16 -04002310pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002311 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002312 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002313 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002314 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002315 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2316 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002317 }
2318}
2319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002320pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002321 use ::RangeLimits::*;
2322 match _i {
2323 HalfOpen(_binding_0, ) => {
2324 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002326 )
2327 }
2328 Closed(_binding_0, ) => {
2329 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002330 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002331 )
2332 }
2333 }
2334}
David Tolnayf93b90d2017-11-11 19:21:26 -08002335
2336pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2337 use ::ReturnType::*;
2338 match _i {
2339 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002340 Type(_binding_0, _binding_1, ) => {
2341 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002342 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2343 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002344 )
2345 }
2346 }
2347}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002348
2349pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2350 _i
2351}
Nika Layzell27726662017-10-24 23:16:35 -04002352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002353pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002354 use ::Stmt::*;
2355 match _i {
2356 Local(_binding_0, ) => {
2357 Local (
2358 Box::new(_visitor.fold_local(* _binding_0)),
2359 )
2360 }
2361 Item(_binding_0, ) => {
2362 Item (
2363 Box::new(_visitor.fold_item(* _binding_0)),
2364 )
2365 }
2366 Expr(_binding_0, ) => {
2367 Expr (
2368 Box::new(_visitor.fold_expr(* _binding_0)),
2369 )
2370 }
2371 Semi(_binding_0, _binding_1, ) => {
2372 Semi (
2373 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002374 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002375 )
2376 }
Nika Layzell27726662017-10-24 23:16:35 -04002377 }
2378}
2379
Nika Layzella6f46c42017-10-26 15:26:16 -04002380pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002381 use ::TraitBoundModifier::*;
2382 match _i {
2383 None => { None }
2384 Maybe(_binding_0, ) => {
2385 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002386 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 }
2390}
2391# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002392pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002393 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002394 match _i {
2395 Const(_binding_0, ) => {
2396 Const (
2397 _visitor.fold_trait_item_const(_binding_0),
2398 )
2399 }
2400 Method(_binding_0, ) => {
2401 Method (
2402 _visitor.fold_trait_item_method(_binding_0),
2403 )
2404 }
2405 Type(_binding_0, ) => {
2406 Type (
2407 _visitor.fold_trait_item_type(_binding_0),
2408 )
2409 }
2410 Macro(_binding_0, ) => {
2411 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002412 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002413 )
2414 }
2415 }
2416}
2417# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002418pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2419 TraitItemConst {
2420 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002422 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002423 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002425 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002426 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002427 _visitor.fold_expr(( it ) . 1),
2428 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002429 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002430 }
2431}
2432# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002433pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2434 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002435 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002436 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002437 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002438 }
2439}
2440# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002441pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002442 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002443 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002444 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002445 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002446 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002447 }
2448}
2449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002450pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002451 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002453 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002454 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002455 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002456 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002457 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002458 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002459 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002460 _visitor.fold_type(( it ) . 1),
2461 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002462 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002463 }
2464}
2465
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2467 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002468 match _i {
2469 Slice(_binding_0, ) => {
2470 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
2474 Array(_binding_0, ) => {
2475 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002476 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002477 )
2478 }
2479 Ptr(_binding_0, ) => {
2480 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002481 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002482 )
2483 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002484 Reference(_binding_0, ) => {
2485 Reference (
2486 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002487 )
2488 }
2489 BareFn(_binding_0, ) => {
2490 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002491 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002492 )
2493 }
2494 Never(_binding_0, ) => {
2495 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002497 )
2498 }
David Tolnay05362582017-12-26 01:33:57 -05002499 Tuple(_binding_0, ) => {
2500 Tuple (
2501 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002502 )
2503 }
2504 Path(_binding_0, ) => {
2505 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002506 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002507 )
2508 }
2509 TraitObject(_binding_0, ) => {
2510 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002511 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002512 )
2513 }
2514 ImplTrait(_binding_0, ) => {
2515 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002517 )
2518 }
2519 Paren(_binding_0, ) => {
2520 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002521 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002522 )
2523 }
2524 Group(_binding_0, ) => {
2525 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002526 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002527 )
2528 }
2529 Infer(_binding_0, ) => {
2530 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002532 )
2533 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002534 Macro(_binding_0, ) => {
2535 Macro (
2536 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002537 )
2538 }
2539 }
2540}
2541
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2543 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002544 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002545 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002546 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002547 amt: _visitor.fold_expr(_i . amt),
2548 }
2549}
2550
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002551pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2552 TypeBareFn {
2553 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2558 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002559 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002560 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002561 ty: _visitor.fold_type(_i . ty),
2562 }
2563}
2564
2565pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2566 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002567 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002569 }
2570}
2571
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2573 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002574 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002575 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002576 }
2577}
2578
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002579pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2580 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002581 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002582 }
2583}
2584
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2586 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002588 }
2589}
2590
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2592 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002593 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002594 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002597 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002598 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002599 }
2600}
2601
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002602pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2603 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002604 match _i {
2605 Trait(_binding_0, _binding_1, ) => {
2606 Trait (
2607 _visitor.fold_poly_trait_ref(_binding_0),
2608 _visitor.fold_trait_bound_modifier(_binding_1),
2609 )
2610 }
2611 Region(_binding_0, ) => {
2612 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002613 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002614 )
2615 }
2616 }
2617}
2618
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002619pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2620 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002621 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002623 }
2624}
2625
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2627 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002628 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002629 path: _visitor.fold_path(_i . path),
2630 }
2631}
2632
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002633pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2634 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002635 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2636 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002638 }
2639}
2640
David Tolnay0a89b4d2017-11-13 00:55:45 -08002641pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2642 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002643 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002644 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002645 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002646 }
2647}
2648
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002649pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2650 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002651 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002652 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
2654}
2655
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002656pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2657 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002658 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002659 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
2661}
2662
David Tolnay05362582017-12-26 01:33:57 -05002663pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2664 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002665 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002666 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002667 }
2668}
2669
Nika Layzella6f46c42017-10-26 15:26:16 -04002670pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002671 use ::UnOp::*;
2672 match _i {
2673 Deref(_binding_0, ) => {
2674 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002675 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002676 )
2677 }
2678 Not(_binding_0, ) => {
2679 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002680 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002681 )
2682 }
2683 Neg(_binding_0, ) => {
2684 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002685 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002686 )
2687 }
2688 }
2689}
2690
Nika Layzella6f46c42017-10-26 15:26:16 -04002691pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002692 use ::Unsafety::*;
2693 match _i {
2694 Unsafe(_binding_0, ) => {
2695 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002696 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002697 )
2698 }
2699 Normal => { Normal }
2700 }
2701}
David Tolnay5f332a92017-12-26 00:42:45 -05002702# [ cfg ( feature = "full" ) ]
2703pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2704 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002705 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002706 }
2707}
2708# [ cfg ( feature = "full" ) ]
2709pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2710 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002711 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002712 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2713 }
2714}
2715# [ cfg ( feature = "full" ) ]
2716pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2717 UsePath {
2718 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002719 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002720 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002721 _visitor.fold_ident(( it ) . 1),
2722 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002723 }
2724}
2725# [ cfg ( feature = "full" ) ]
2726pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2727 use ::UseTree::*;
2728 match _i {
2729 Path(_binding_0, ) => {
2730 Path (
2731 _visitor.fold_use_path(_binding_0),
2732 )
2733 }
2734 Glob(_binding_0, ) => {
2735 Glob (
2736 _visitor.fold_use_glob(_binding_0),
2737 )
2738 }
2739 List(_binding_0, ) => {
2740 List (
2741 _visitor.fold_use_list(_binding_0),
2742 )
2743 }
2744 }
2745}
Nika Layzell27726662017-10-24 23:16:35 -04002746
Nika Layzella6f46c42017-10-26 15:26:16 -04002747pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002748 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002749 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002750 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002751 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002752 discriminant: (_i . discriminant).map(|it| { (
2753 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2754 _visitor.fold_expr(( it ) . 1),
2755 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
2757}
2758
Nika Layzella6f46c42017-10-26 15:26:16 -04002759pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002760 use ::VariantData::*;
2761 match _i {
2762 Struct(_binding_0, _binding_1, ) => {
2763 Struct (
2764 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002765 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002766 )
2767 }
2768 Tuple(_binding_0, _binding_1, ) => {
2769 Tuple (
2770 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002771 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002772 )
2773 }
2774 Unit => { Unit }
2775 }
2776}
Nika Layzell27726662017-10-24 23:16:35 -04002777
Nika Layzella6f46c42017-10-26 15:26:16 -04002778pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002779 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002780 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002781 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002782 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
2785
Nika Layzella6f46c42017-10-26 15:26:16 -04002786pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002787 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002789 }
2790}
2791
Nika Layzella6f46c42017-10-26 15:26:16 -04002792pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002793 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002795 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002796 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002797 path: Box::new(_visitor.fold_path(* _i . path)),
2798 }
2799}
2800
Nika Layzella6f46c42017-10-26 15:26:16 -04002801pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002802 use ::Visibility::*;
2803 match _i {
2804 Public(_binding_0, ) => {
2805 Public (
2806 _visitor.fold_vis_public(_binding_0),
2807 )
2808 }
2809 Crate(_binding_0, ) => {
2810 Crate (
2811 _visitor.fold_vis_crate(_binding_0),
2812 )
2813 }
2814 Restricted(_binding_0, ) => {
2815 Restricted (
2816 _visitor.fold_vis_restricted(_binding_0),
2817 )
2818 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002819 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002820 }
2821}
2822
Nika Layzella6f46c42017-10-26 15:26:16 -04002823pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002824 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002825 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002826 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002827 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002828 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002829 }
2830}
2831
Nika Layzella6f46c42017-10-26 15:26:16 -04002832pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002833 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002834 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002835 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2836 }
2837}
2838
Nika Layzella6f46c42017-10-26 15:26:16 -04002839pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002840 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002841 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002842 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002843 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002844 }
2845}
2846
Nika Layzella6f46c42017-10-26 15:26:16 -04002847pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002848 use ::WherePredicate::*;
2849 match _i {
2850 BoundPredicate(_binding_0, ) => {
2851 BoundPredicate (
2852 _visitor.fold_where_bound_predicate(_binding_0),
2853 )
2854 }
2855 RegionPredicate(_binding_0, ) => {
2856 RegionPredicate (
2857 _visitor.fold_where_region_predicate(_binding_0),
2858 )
2859 }
2860 EqPredicate(_binding_0, ) => {
2861 EqPredicate (
2862 _visitor.fold_where_eq_predicate(_binding_0),
2863 )
2864 }
2865 }
2866}
2867
Nika Layzella6f46c42017-10-26 15:26:16 -04002868pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002869 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002870 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002871 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002872 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002873 }
2874}
2875