blob: 9f4f9cb123f23008587cb1d6d6bd3736d4258717 [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) }
David Tolnay14982012017-12-29 00:49:51 -0500212
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 Tolnay14982012017-12-29 00:49:51 -0500258
David Tolnay85b69a42017-12-27 20:43:10 -0500259fn 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)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001150 then_branch: _visitor.fold_block(_i . then_branch),
1151 else_branch: (_i . else_branch).map(|it| { (
1152 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1153 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1154 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001155 }
1156}
1157# [ cfg ( feature = "full" ) ]
1158pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1159 ExprIfLet {
1160 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1161 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1162 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1163 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1164 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1165 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001166 then_branch: _visitor.fold_block(_i . then_branch),
1167 else_branch: (_i . else_branch).map(|it| { (
1168 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1169 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1170 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001171 }
1172}
1173# [ cfg ( feature = "full" ) ]
1174pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1175 ExprInPlace {
1176 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1177 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001178 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001179 value: Box::new(_visitor.fold_expr(* _i . value)),
1180 }
1181}
1182
1183pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1184 ExprIndex {
1185 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1186 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1187 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1188 index: Box::new(_visitor.fold_expr(* _i . index)),
1189 }
1190}
1191
1192pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1193 ExprLit {
1194 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1195 lit: _visitor.fold_lit(_i . lit),
1196 }
1197}
1198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001199pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001200 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001201 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001202 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001203 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001204 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1205 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001206 }
1207}
1208# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001209pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1210 ExprMacro {
1211 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1212 mac: _visitor.fold_macro(_i . mac),
1213 }
1214}
1215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001216pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001218 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001219 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001220 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001221 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001222 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1223 }
1224}
1225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001226pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001229 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001230 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001231 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001232 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001233 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1234 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001235 }
1236}
David Tolnaye98775f2017-12-28 23:17:00 -05001237# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001238pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001239 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001240 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001241 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001242 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001243 }
1244}
1245
Nika Layzella6f46c42017-10-26 15:26:16 -04001246pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001247 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001248 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001249 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001250 path: _visitor.fold_path(_i . path),
1251 }
1252}
1253# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001254pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001255 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001256 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001257 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001258 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001259 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001260 }
1261}
1262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001263pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001264 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001265 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001266 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001267 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001268 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001269 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1270 }
1271}
1272# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001273pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1274 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001275 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001276 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001277 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001278 }
1279}
1280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001281pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001282 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001283 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001284 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001285 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001286 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1287 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1288 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001289 }
1290}
1291# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001292pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001293 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001294 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001295 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001296 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001297 }
1298}
1299# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001300pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1301 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001302 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001303 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001304 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001305 }
1306}
David Tolnay0cf94f22017-12-28 23:46:26 -05001307# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001308pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001309 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001310 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001311 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001312 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001313 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001314 }
1315}
1316
Nika Layzella6f46c42017-10-26 15:26:16 -04001317pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001318 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001319 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001320 op: _visitor.fold_un_op(_i . op),
1321 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1322 }
1323}
1324# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001325pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1326 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001327 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001328 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001329 block: _visitor.fold_block(_i . block),
1330 }
1331}
1332# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001333pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001334 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001335 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001336 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001337 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1338 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001339 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1340 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001341 }
1342}
1343# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001344pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001345 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001346 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001347 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001348 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1349 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1350 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001351 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001352 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001353 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1354 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001355 }
1356}
1357# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001358pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001359 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001360 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001361 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001362 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001363 }
1364}
1365
Nika Layzella6f46c42017-10-26 15:26:16 -04001366pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001367 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001368 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001369 vis: _visitor.fold_visibility(_i . vis),
1370 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001371 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001372 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001373 }
1374}
1375# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001376pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001377 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001378 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001379 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001380 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001381 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1382 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001383 }
1384}
1385# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001386pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001387 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001388 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1389 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001390 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001391 expr: _visitor.fold_expr(_i . expr),
1392 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001393 }
1394}
1395# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001396pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001397 File {
1398 shebang: _i . shebang,
1399 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1400 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1401 }
1402}
1403# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001404pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001405 use ::FnArg::*;
1406 match _i {
1407 SelfRef(_binding_0, ) => {
1408 SelfRef (
1409 _visitor.fold_arg_self_ref(_binding_0),
1410 )
1411 }
1412 SelfValue(_binding_0, ) => {
1413 SelfValue (
1414 _visitor.fold_arg_self(_binding_0),
1415 )
1416 }
1417 Captured(_binding_0, ) => {
1418 Captured (
1419 _visitor.fold_arg_captured(_binding_0),
1420 )
1421 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001422 Inferred(_binding_0, ) => {
1423 Inferred (
1424 _visitor.fold_pat(_binding_0),
1425 )
1426 }
Nika Layzell27726662017-10-24 23:16:35 -04001427 Ignored(_binding_0, ) => {
1428 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001429 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001430 )
1431 }
1432 }
1433}
1434# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001435pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001436 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001437 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001438 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001439 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001440 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001441 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001442 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001443 }
1444}
1445# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001446pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001447 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001448 match _i {
1449 Fn(_binding_0, ) => {
1450 Fn (
1451 _visitor.fold_foreign_item_fn(_binding_0),
1452 )
1453 }
1454 Static(_binding_0, ) => {
1455 Static (
1456 _visitor.fold_foreign_item_static(_binding_0),
1457 )
1458 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001459 Type(_binding_0, ) => {
1460 Type (
1461 _visitor.fold_foreign_item_type(_binding_0),
1462 )
1463 }
Nika Layzell27726662017-10-24 23:16:35 -04001464 }
1465}
1466# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001467pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1468 ForeignItemFn {
1469 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1470 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001471 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001472 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001473 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001474 }
1475}
1476# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001477pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001478 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001479 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1480 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001481 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001482 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001483 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001484 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001485 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001486 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001487 }
1488}
David Tolnay199bcbb2017-11-12 10:33:52 -08001489# [ cfg ( feature = "full" ) ]
1490pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1491 ForeignItemType {
1492 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1493 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001494 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001495 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001496 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001497 }
1498}
Nika Layzell27726662017-10-24 23:16:35 -04001499
Nika Layzellc08227a2017-12-04 16:30:17 -05001500pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1501 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001502 match _i {
1503 Lifetime(_binding_0, ) => {
1504 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001505 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001506 )
1507 }
1508 Type(_binding_0, ) => {
1509 Type (
1510 _visitor.fold_type(_binding_0),
1511 )
1512 }
1513 TypeBinding(_binding_0, ) => {
1514 TypeBinding (
1515 _visitor.fold_type_binding(_binding_0),
1516 )
1517 }
Nika Layzellc680e612017-12-04 19:07:20 -05001518 Const(_binding_0, ) => {
1519 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001520 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001521 )
1522 }
Nika Layzell357885a2017-12-04 15:47:07 -05001523 }
1524}
David Tolnayd60cfec2017-12-29 00:21:38 -05001525# [ cfg ( feature = "full" ) ]
1526pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1527 use ::GenericMethodArgument::*;
1528 match _i {
1529 Type(_binding_0, ) => {
1530 Type (
1531 _visitor.fold_type(_binding_0),
1532 )
1533 }
1534 Const(_binding_0, ) => {
1535 Const (
1536 _visitor.fold_expr(_binding_0),
1537 )
1538 }
1539 }
1540}
Nika Layzell357885a2017-12-04 15:47:07 -05001541
David Tolnayc2f1aba2017-11-12 20:29:22 -08001542pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1543 use ::GenericParam::*;
1544 match _i {
1545 Lifetime(_binding_0, ) => {
1546 Lifetime (
1547 _visitor.fold_lifetime_def(_binding_0),
1548 )
1549 }
1550 Type(_binding_0, ) => {
1551 Type (
1552 _visitor.fold_type_param(_binding_0),
1553 )
1554 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001555 Const(_binding_0, ) => {
1556 Const (
1557 _visitor.fold_const_param(_binding_0),
1558 )
1559 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001560 }
1561}
1562
Nika Layzella6f46c42017-10-26 15:26:16 -04001563pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001564 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001565 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001566 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001567 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001568 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001569 }
1570}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001571
1572pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001573 Ident {
1574 sym: _i . sym,
1575 span: _visitor.fold_span(_i . span),
1576 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001577}
Nika Layzell27726662017-10-24 23:16:35 -04001578# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001579pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001580 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001581 match _i {
1582 Const(_binding_0, ) => {
1583 Const (
1584 _visitor.fold_impl_item_const(_binding_0),
1585 )
1586 }
1587 Method(_binding_0, ) => {
1588 Method (
1589 _visitor.fold_impl_item_method(_binding_0),
1590 )
1591 }
1592 Type(_binding_0, ) => {
1593 Type (
1594 _visitor.fold_impl_item_type(_binding_0),
1595 )
1596 }
1597 Macro(_binding_0, ) => {
1598 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001599 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001600 )
1601 }
1602 }
1603}
1604# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001605pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1606 ImplItemConst {
1607 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1608 vis: _visitor.fold_visibility(_i . vis),
1609 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001610 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001611 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001612 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001613 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001614 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001615 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001616 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001617 }
1618}
1619# [ cfg ( feature = "full" ) ]
1620pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1621 ImplItemMacro {
1622 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1623 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001624 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001625 }
1626}
1627# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001628pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001629 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001630 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001631 vis: _visitor.fold_visibility(_i . vis),
1632 defaultness: _visitor.fold_defaultness(_i . defaultness),
1633 sig: _visitor.fold_method_sig(_i . sig),
1634 block: _visitor.fold_block(_i . block),
1635 }
1636}
1637# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001638pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001639 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001640 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001641 vis: _visitor.fold_visibility(_i . vis),
1642 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001643 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001644 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001645 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001646 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001647 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001648 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001649 }
1650}
1651# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001652pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001653 use ::ImplPolarity::*;
1654 match _i {
1655 Positive => { Positive }
1656 Negative(_binding_0, ) => {
1657 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001658 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001659 )
1660 }
1661 }
1662}
David Tolnay14982012017-12-29 00:49:51 -05001663
David Tolnay85b69a42017-12-27 20:43:10 -05001664pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1665 Index {
1666 index: _i . index,
1667 span: _visitor.fold_span(_i . span),
1668 }
1669}
1670# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001671pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001672 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001673 match _i {
1674 ExternCrate(_binding_0, ) => {
1675 ExternCrate (
1676 _visitor.fold_item_extern_crate(_binding_0),
1677 )
1678 }
1679 Use(_binding_0, ) => {
1680 Use (
1681 _visitor.fold_item_use(_binding_0),
1682 )
1683 }
1684 Static(_binding_0, ) => {
1685 Static (
1686 _visitor.fold_item_static(_binding_0),
1687 )
1688 }
1689 Const(_binding_0, ) => {
1690 Const (
1691 _visitor.fold_item_const(_binding_0),
1692 )
1693 }
1694 Fn(_binding_0, ) => {
1695 Fn (
1696 _visitor.fold_item_fn(_binding_0),
1697 )
1698 }
1699 Mod(_binding_0, ) => {
1700 Mod (
1701 _visitor.fold_item_mod(_binding_0),
1702 )
1703 }
1704 ForeignMod(_binding_0, ) => {
1705 ForeignMod (
1706 _visitor.fold_item_foreign_mod(_binding_0),
1707 )
1708 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001709 Type(_binding_0, ) => {
1710 Type (
1711 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001712 )
1713 }
1714 Enum(_binding_0, ) => {
1715 Enum (
1716 _visitor.fold_item_enum(_binding_0),
1717 )
1718 }
1719 Struct(_binding_0, ) => {
1720 Struct (
1721 _visitor.fold_item_struct(_binding_0),
1722 )
1723 }
1724 Union(_binding_0, ) => {
1725 Union (
1726 _visitor.fold_item_union(_binding_0),
1727 )
1728 }
1729 Trait(_binding_0, ) => {
1730 Trait (
1731 _visitor.fold_item_trait(_binding_0),
1732 )
1733 }
1734 DefaultImpl(_binding_0, ) => {
1735 DefaultImpl (
1736 _visitor.fold_item_default_impl(_binding_0),
1737 )
1738 }
1739 Impl(_binding_0, ) => {
1740 Impl (
1741 _visitor.fold_item_impl(_binding_0),
1742 )
1743 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001744 Macro(_binding_0, ) => {
1745 Macro (
1746 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001747 )
1748 }
David Tolnay500d8322017-12-18 00:32:51 -08001749 Macro2(_binding_0, ) => {
1750 Macro2 (
1751 _visitor.fold_item_macro2(_binding_0),
1752 )
1753 }
Nika Layzell27726662017-10-24 23:16:35 -04001754 }
1755}
1756# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001757pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1758 ItemConst {
1759 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1760 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001761 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001762 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001763 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001764 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001765 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001766 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001767 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001768 }
1769}
1770# [ cfg ( feature = "full" ) ]
1771pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1772 ItemDefaultImpl {
1773 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1774 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001775 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001776 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001777 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1778 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001779 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001780 }
1781}
1782# [ cfg ( feature = "full" ) ]
1783pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1784 ItemEnum {
1785 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1786 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001787 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001788 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001789 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001790 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001791 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1792 }
1793}
1794# [ cfg ( feature = "full" ) ]
1795pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1796 ItemExternCrate {
1797 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1798 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001799 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1800 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001801 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001802 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001803 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001804 _visitor.fold_ident(( it ) . 1),
1805 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001807 }
1808}
1809# [ cfg ( feature = "full" ) ]
1810pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1811 ItemFn {
1812 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1813 vis: _visitor.fold_visibility(_i . vis),
1814 constness: _visitor.fold_constness(_i . constness),
1815 unsafety: _visitor.fold_unsafety(_i . unsafety),
1816 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001817 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001818 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001819 block: Box::new(_visitor.fold_block(* _i . block)),
1820 }
1821}
1822# [ cfg ( feature = "full" ) ]
1823pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1824 ItemForeignMod {
1825 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1826 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001827 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001828 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1829 }
1830}
1831# [ cfg ( feature = "full" ) ]
1832pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1833 ItemImpl {
1834 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1835 defaultness: _visitor.fold_defaultness(_i . defaultness),
1836 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001837 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001838 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001839 trait_: (_i . trait_).map(|it| { (
1840 _visitor.fold_impl_polarity(( it ) . 0),
1841 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001843 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001844 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001845 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001846 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1847 }
1848}
1849# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001850pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1851 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001852 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001853 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001854 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001855 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001856 }
1857}
1858# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001859pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1860 ItemMacro2 {
1861 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1862 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001863 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001864 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001865 args: _i . args,
1866 body: _i . body,
1867 }
1868}
1869# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001870pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001871 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001872 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001873 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001874 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001875 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001876 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001877 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001878 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1879 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001880 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001881 }
1882}
1883# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001884pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001885 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001886 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001887 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001888 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001889 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001890 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001892 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001893 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001894 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001896 }
1897}
1898# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001899pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001900 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001901 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001902 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001903 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001904 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001905 generics: _visitor.fold_generics(_i . generics),
1906 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001907 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001908 }
1909}
1910# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001911pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001912 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001913 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001914 vis: _visitor.fold_visibility(_i . vis),
1915 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001916 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1917 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001918 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001919 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001920 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001921 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001922 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001923 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1924 }
1925}
1926# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001927pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1928 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001929 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001930 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001931 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001932 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001933 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001934 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001935 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001936 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001937 }
1938}
1939# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001940pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001941 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001942 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001943 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001944 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001945 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001946 generics: _visitor.fold_generics(_i . generics),
1947 data: _visitor.fold_variant_data(_i . data),
1948 }
1949}
1950# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001951pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001952 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001953 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001954 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001955 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1956 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001957 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1958 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001959 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001960 }
1961}
1962
David Tolnay4ba63a02017-12-28 15:53:05 -05001963pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1964 Lifetime {
1965 sym: _i . sym,
1966 span: _visitor.fold_span(_i . span),
1967 }
1968}
1969
Nika Layzella6f46c42017-10-26 15:26:16 -04001970pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001971 LifetimeDef {
1972 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001973 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001974 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001975 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1976 }
1977}
1978
1979pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1980 Lit {
1981 value: _i . value,
1982 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001983 }
1984}
1985# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001986pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001987 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001988 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001989 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1990 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1991 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1992 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1993 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1994 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1995 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001996 }
1997}
Nika Layzell27726662017-10-24 23:16:35 -04001998
David Tolnaydecf28d2017-11-11 11:56:45 -08001999pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
2000 Macro {
2001 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05002002 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08002003 tokens: _i . tokens,
2004 }
2005}
David Tolnay14982012017-12-29 00:49:51 -05002006
David Tolnay85b69a42017-12-27 20:43:10 -05002007pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2008 use ::Member::*;
2009 match _i {
2010 Named(_binding_0, ) => {
2011 Named (
2012 _visitor.fold_ident(_binding_0),
2013 )
2014 }
2015 Unnamed(_binding_0, ) => {
2016 Unnamed (
2017 _visitor.fold_index(_binding_0),
2018 )
2019 }
2020 }
2021}
David Tolnaydecf28d2017-11-11 11:56:45 -08002022
Nika Layzella6f46c42017-10-26 15:26:16 -04002023pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002024 use ::MetaItem::*;
2025 match _i {
2026 Term(_binding_0, ) => {
2027 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002028 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002029 )
2030 }
2031 List(_binding_0, ) => {
2032 List (
2033 _visitor.fold_meta_item_list(_binding_0),
2034 )
2035 }
2036 NameValue(_binding_0, ) => {
2037 NameValue (
2038 _visitor.fold_meta_name_value(_binding_0),
2039 )
2040 }
2041 }
2042}
2043
Nika Layzella6f46c42017-10-26 15:26:16 -04002044pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002045 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002046 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002047 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002048 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2049 }
2050}
2051
Nika Layzella6f46c42017-10-26 15:26:16 -04002052pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002053 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002054 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002055 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002056 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002057 }
2058}
2059# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002060pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002061 MethodSig {
2062 constness: _visitor.fold_constness(_i . constness),
2063 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002064 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002065 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002066 decl: _visitor.fold_fn_decl(_i . decl),
2067 }
2068}
David Tolnayd60cfec2017-12-29 00:21:38 -05002069# [ cfg ( feature = "full" ) ]
2070pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2071 MethodTurbofish {
2072 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2073 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2074 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2075 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2076 }
2077}
Nika Layzell27726662017-10-24 23:16:35 -04002078
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002079pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2080 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002081 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002082 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002083 }
2084}
2085
Nika Layzella6f46c42017-10-26 15:26:16 -04002086pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002087 use ::Mutability::*;
2088 match _i {
2089 Mutable(_binding_0, ) => {
2090 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002091 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002092 )
2093 }
2094 Immutable => { Immutable }
2095 }
2096}
2097
Nika Layzella6f46c42017-10-26 15:26:16 -04002098pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002099 use ::NestedMetaItem::*;
2100 match _i {
2101 MetaItem(_binding_0, ) => {
2102 MetaItem (
2103 _visitor.fold_meta_item(_binding_0),
2104 )
2105 }
2106 Literal(_binding_0, ) => {
2107 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002108 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002109 )
2110 }
2111 }
2112}
2113
Nika Layzellc08227a2017-12-04 16:30:17 -05002114pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2115 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002116 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002117 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002118 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002119 }
2120}
2121# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002122pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002123 use ::Pat::*;
2124 match _i {
2125 Wild(_binding_0, ) => {
2126 Wild (
2127 _visitor.fold_pat_wild(_binding_0),
2128 )
2129 }
2130 Ident(_binding_0, ) => {
2131 Ident (
2132 _visitor.fold_pat_ident(_binding_0),
2133 )
2134 }
2135 Struct(_binding_0, ) => {
2136 Struct (
2137 _visitor.fold_pat_struct(_binding_0),
2138 )
2139 }
2140 TupleStruct(_binding_0, ) => {
2141 TupleStruct (
2142 _visitor.fold_pat_tuple_struct(_binding_0),
2143 )
2144 }
2145 Path(_binding_0, ) => {
2146 Path (
2147 _visitor.fold_pat_path(_binding_0),
2148 )
2149 }
2150 Tuple(_binding_0, ) => {
2151 Tuple (
2152 _visitor.fold_pat_tuple(_binding_0),
2153 )
2154 }
2155 Box(_binding_0, ) => {
2156 Box (
2157 _visitor.fold_pat_box(_binding_0),
2158 )
2159 }
2160 Ref(_binding_0, ) => {
2161 Ref (
2162 _visitor.fold_pat_ref(_binding_0),
2163 )
2164 }
2165 Lit(_binding_0, ) => {
2166 Lit (
2167 _visitor.fold_pat_lit(_binding_0),
2168 )
2169 }
2170 Range(_binding_0, ) => {
2171 Range (
2172 _visitor.fold_pat_range(_binding_0),
2173 )
2174 }
2175 Slice(_binding_0, ) => {
2176 Slice (
2177 _visitor.fold_pat_slice(_binding_0),
2178 )
2179 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002180 Macro(_binding_0, ) => {
2181 Macro (
2182 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002183 )
2184 }
2185 }
2186}
2187# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002188pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002189 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002190 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002191 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
2193}
2194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002195pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002196 PatIdent {
2197 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002198 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002199 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002200 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002201 }
2202}
2203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PatLit {
2206 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2207 }
2208}
2209# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002210pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002211 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002212 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002213 path: _visitor.fold_path(_i . path),
2214 }
2215}
2216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002217pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002218 PatRange {
2219 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002220 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002221 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002222 }
2223}
2224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002225pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002226 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002227 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002228 mutbl: _visitor.fold_mutability(_i . mutbl),
2229 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002230 }
2231}
2232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002233pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002234 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002235 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002236 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002237 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002238 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002239 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2240 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002241 }
2242}
2243# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002244pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002245 PatStruct {
2246 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002247 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002248 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002249 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002250 }
2251}
2252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002253pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002254 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002255 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002256 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002257 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002258 dots_pos: _i . dots_pos,
2259 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002260 }
2261}
2262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002263pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002264 PatTupleStruct {
2265 path: _visitor.fold_path(_i . path),
2266 pat: _visitor.fold_pat_tuple(_i . pat),
2267 }
2268}
2269# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002270pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002271 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002272 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002273 }
2274}
2275
Nika Layzella6f46c42017-10-26 15:26:16 -04002276pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002277 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002278 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002279 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2280 }
2281}
Nika Layzellc08227a2017-12-04 16:30:17 -05002282
2283pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2284 use ::PathArguments::*;
2285 match _i {
2286 None => { None }
2287 AngleBracketed(_binding_0, ) => {
2288 AngleBracketed (
2289 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2290 )
2291 }
2292 Parenthesized(_binding_0, ) => {
2293 Parenthesized (
2294 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2295 )
2296 }
2297 }
2298}
Nika Layzell27726662017-10-24 23:16:35 -04002299
Nika Layzella6f46c42017-10-26 15:26:16 -04002300pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002301 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002302 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002303 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002304 }
2305}
Nika Layzell27726662017-10-24 23:16:35 -04002306
Nika Layzella6f46c42017-10-26 15:26:16 -04002307pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002308 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002309 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002310 trait_ref: _visitor.fold_path(_i . trait_ref),
2311 }
2312}
2313
Nika Layzella6f46c42017-10-26 15:26:16 -04002314pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002315 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002316 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002317 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002318 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002319 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2320 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002321 }
2322}
2323# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002324pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002325 use ::RangeLimits::*;
2326 match _i {
2327 HalfOpen(_binding_0, ) => {
2328 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002329 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002330 )
2331 }
2332 Closed(_binding_0, ) => {
2333 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002334 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002335 )
2336 }
2337 }
2338}
David Tolnayf93b90d2017-11-11 19:21:26 -08002339
2340pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2341 use ::ReturnType::*;
2342 match _i {
2343 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002344 Type(_binding_0, _binding_1, ) => {
2345 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002346 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2347 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002348 )
2349 }
2350 }
2351}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002352
2353pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2354 _i
2355}
Nika Layzell27726662017-10-24 23:16:35 -04002356# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002357pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002358 use ::Stmt::*;
2359 match _i {
2360 Local(_binding_0, ) => {
2361 Local (
2362 Box::new(_visitor.fold_local(* _binding_0)),
2363 )
2364 }
2365 Item(_binding_0, ) => {
2366 Item (
2367 Box::new(_visitor.fold_item(* _binding_0)),
2368 )
2369 }
2370 Expr(_binding_0, ) => {
2371 Expr (
2372 Box::new(_visitor.fold_expr(* _binding_0)),
2373 )
2374 }
2375 Semi(_binding_0, _binding_1, ) => {
2376 Semi (
2377 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002378 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002379 )
2380 }
Nika Layzell27726662017-10-24 23:16:35 -04002381 }
2382}
2383
Nika Layzella6f46c42017-10-26 15:26:16 -04002384pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002385 use ::TraitBoundModifier::*;
2386 match _i {
2387 None => { None }
2388 Maybe(_binding_0, ) => {
2389 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002390 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002391 )
2392 }
2393 }
2394}
2395# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002396pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002397 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002398 match _i {
2399 Const(_binding_0, ) => {
2400 Const (
2401 _visitor.fold_trait_item_const(_binding_0),
2402 )
2403 }
2404 Method(_binding_0, ) => {
2405 Method (
2406 _visitor.fold_trait_item_method(_binding_0),
2407 )
2408 }
2409 Type(_binding_0, ) => {
2410 Type (
2411 _visitor.fold_trait_item_type(_binding_0),
2412 )
2413 }
2414 Macro(_binding_0, ) => {
2415 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002416 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002417 )
2418 }
2419 }
2420}
2421# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002422pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2423 TraitItemConst {
2424 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002425 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002426 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002428 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002429 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002430 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002431 _visitor.fold_expr(( it ) . 1),
2432 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002433 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002434 }
2435}
2436# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002437pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2438 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002439 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002440 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002441 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002442 }
2443}
2444# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002445pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002446 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002447 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002448 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002449 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002450 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002451 }
2452}
2453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002454pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002455 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002456 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002457 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002458 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002459 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002460 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002461 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002462 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002463 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002464 _visitor.fold_type(( it ) . 1),
2465 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002466 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002467 }
2468}
2469
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2471 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002472 match _i {
2473 Slice(_binding_0, ) => {
2474 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
2478 Array(_binding_0, ) => {
2479 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
2483 Ptr(_binding_0, ) => {
2484 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002486 )
2487 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002488 Reference(_binding_0, ) => {
2489 Reference (
2490 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
2493 BareFn(_binding_0, ) => {
2494 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002495 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002496 )
2497 }
2498 Never(_binding_0, ) => {
2499 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002500 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002501 )
2502 }
David Tolnay05362582017-12-26 01:33:57 -05002503 Tuple(_binding_0, ) => {
2504 Tuple (
2505 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002506 )
2507 }
2508 Path(_binding_0, ) => {
2509 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002510 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002511 )
2512 }
2513 TraitObject(_binding_0, ) => {
2514 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002515 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002516 )
2517 }
2518 ImplTrait(_binding_0, ) => {
2519 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002520 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002521 )
2522 }
2523 Paren(_binding_0, ) => {
2524 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002525 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002526 )
2527 }
2528 Group(_binding_0, ) => {
2529 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002530 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002531 )
2532 }
2533 Infer(_binding_0, ) => {
2534 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002536 )
2537 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002538 Macro(_binding_0, ) => {
2539 Macro (
2540 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002541 )
2542 }
2543 }
2544}
2545
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002546pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2547 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002548 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002550 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002551 amt: _visitor.fold_expr(_i . amt),
2552 }
2553}
2554
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002555pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2556 TypeBareFn {
2557 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002558 }
2559}
2560
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002561pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2562 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002563 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002564 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565 ty: _visitor.fold_type(_i . ty),
2566 }
2567}
2568
2569pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2570 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002571 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002573 }
2574}
2575
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002576pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2577 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002578 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002579 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002580 }
2581}
2582
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2584 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002585 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 }
2587}
2588
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002589pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2590 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002591 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002592 }
2593}
2594
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002595pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2596 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002597 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002598 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002599 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002600 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002601 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002602 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002603 }
2604}
2605
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002606pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2607 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002608 match _i {
2609 Trait(_binding_0, _binding_1, ) => {
2610 Trait (
2611 _visitor.fold_poly_trait_ref(_binding_0),
2612 _visitor.fold_trait_bound_modifier(_binding_1),
2613 )
2614 }
2615 Region(_binding_0, ) => {
2616 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002617 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002618 )
2619 }
2620 }
2621}
2622
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002623pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2624 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002625 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002627 }
2628}
2629
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002630pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2631 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002632 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002633 path: _visitor.fold_path(_i . path),
2634 }
2635}
2636
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2638 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002639 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2640 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002641 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002642 }
2643}
2644
David Tolnay0a89b4d2017-11-13 00:55:45 -08002645pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2646 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002647 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002648 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002649 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002650 }
2651}
2652
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002653pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2654 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002655 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002656 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002657 }
2658}
2659
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002660pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2661 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002662 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002663 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002664 }
2665}
2666
David Tolnay05362582017-12-26 01:33:57 -05002667pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2668 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002669 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002670 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002671 }
2672}
2673
Nika Layzella6f46c42017-10-26 15:26:16 -04002674pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002675 use ::UnOp::*;
2676 match _i {
2677 Deref(_binding_0, ) => {
2678 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002679 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002680 )
2681 }
2682 Not(_binding_0, ) => {
2683 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002684 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002685 )
2686 }
2687 Neg(_binding_0, ) => {
2688 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002689 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002690 )
2691 }
2692 }
2693}
2694
Nika Layzella6f46c42017-10-26 15:26:16 -04002695pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002696 use ::Unsafety::*;
2697 match _i {
2698 Unsafe(_binding_0, ) => {
2699 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002700 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002701 )
2702 }
2703 Normal => { Normal }
2704 }
2705}
David Tolnay5f332a92017-12-26 00:42:45 -05002706# [ cfg ( feature = "full" ) ]
2707pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2708 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002709 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002710 }
2711}
2712# [ cfg ( feature = "full" ) ]
2713pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2714 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002715 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002716 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2717 }
2718}
2719# [ cfg ( feature = "full" ) ]
2720pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2721 UsePath {
2722 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002723 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002724 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002725 _visitor.fold_ident(( it ) . 1),
2726 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002727 }
2728}
2729# [ cfg ( feature = "full" ) ]
2730pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2731 use ::UseTree::*;
2732 match _i {
2733 Path(_binding_0, ) => {
2734 Path (
2735 _visitor.fold_use_path(_binding_0),
2736 )
2737 }
2738 Glob(_binding_0, ) => {
2739 Glob (
2740 _visitor.fold_use_glob(_binding_0),
2741 )
2742 }
2743 List(_binding_0, ) => {
2744 List (
2745 _visitor.fold_use_list(_binding_0),
2746 )
2747 }
2748 }
2749}
Nika Layzell27726662017-10-24 23:16:35 -04002750
Nika Layzella6f46c42017-10-26 15:26:16 -04002751pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002752 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002753 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002754 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002755 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002756 discriminant: (_i . discriminant).map(|it| { (
2757 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2758 _visitor.fold_expr(( it ) . 1),
2759 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002760 }
2761}
2762
Nika Layzella6f46c42017-10-26 15:26:16 -04002763pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002764 use ::VariantData::*;
2765 match _i {
2766 Struct(_binding_0, _binding_1, ) => {
2767 Struct (
2768 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002769 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002770 )
2771 }
2772 Tuple(_binding_0, _binding_1, ) => {
2773 Tuple (
2774 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002775 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002776 )
2777 }
2778 Unit => { Unit }
2779 }
2780}
Nika Layzell27726662017-10-24 23:16:35 -04002781
Nika Layzella6f46c42017-10-26 15:26:16 -04002782pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002783 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002784 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002785 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002786 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002787 }
2788}
2789
Nika Layzella6f46c42017-10-26 15:26:16 -04002790pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002791 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002792 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002793 }
2794}
2795
Nika Layzella6f46c42017-10-26 15:26:16 -04002796pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002797 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002798 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002799 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002800 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002801 path: Box::new(_visitor.fold_path(* _i . path)),
2802 }
2803}
2804
Nika Layzella6f46c42017-10-26 15:26:16 -04002805pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002806 use ::Visibility::*;
2807 match _i {
2808 Public(_binding_0, ) => {
2809 Public (
2810 _visitor.fold_vis_public(_binding_0),
2811 )
2812 }
2813 Crate(_binding_0, ) => {
2814 Crate (
2815 _visitor.fold_vis_crate(_binding_0),
2816 )
2817 }
2818 Restricted(_binding_0, ) => {
2819 Restricted (
2820 _visitor.fold_vis_restricted(_binding_0),
2821 )
2822 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002823 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002824 }
2825}
2826
Nika Layzella6f46c42017-10-26 15:26:16 -04002827pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002828 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002829 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002830 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002831 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002832 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002833 }
2834}
2835
Nika Layzella6f46c42017-10-26 15:26:16 -04002836pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002837 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002838 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002839 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2840 }
2841}
2842
Nika Layzella6f46c42017-10-26 15:26:16 -04002843pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002844 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002845 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002846 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002847 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002848 }
2849}
2850
Nika Layzella6f46c42017-10-26 15:26:16 -04002851pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002852 use ::WherePredicate::*;
2853 match _i {
2854 BoundPredicate(_binding_0, ) => {
2855 BoundPredicate (
2856 _visitor.fold_where_bound_predicate(_binding_0),
2857 )
2858 }
2859 RegionPredicate(_binding_0, ) => {
2860 RegionPredicate (
2861 _visitor.fold_where_region_predicate(_binding_0),
2862 )
2863 }
2864 EqPredicate(_binding_0, ) => {
2865 EqPredicate (
2866 _visitor.fold_where_eq_predicate(_binding_0),
2867 )
2868 }
2869 }
2870}
2871
Nika Layzella6f46c42017-10-26 15:26:16 -04002872pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002873 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002874 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002875 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002876 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002877 }
2878}
2879