blob: 566a2ceb475d120ea5a1444503fccfb4df9069bb [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) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
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) }
Nika Layzell357885a2017-12-04 15:47:07 -0500192
David Tolnayc2f1aba2017-11-12 20:29:22 -0800193fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
194
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500196
197fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800203fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -0500211fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800229fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800231fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800241fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246
David Tolnay4ba63a02017-12-28 15:53:05 -0500247fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
248
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500250
251fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254
David Tolnaydecf28d2017-11-11 11:56:45 -0800255fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay85b69a42017-12-27 20:43:10 -0500256# [ cfg ( feature = "full" ) ]
257fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800267fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzellc08227a2017-12-04 16:30:17 -0500273fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500300
301fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800310
311fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500312
313fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800323fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800329fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800331fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
338
339fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
340
341fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
342
343fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
344
345fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
346
347fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
348
349fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
350
351fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
352
353fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
354
David Tolnay0a89b4d2017-11-13 00:55:45 -0800355fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800356
357fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
358
359fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
360
David Tolnay05362582017-12-26 01:33:57 -0500361fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800362
Nika Layzella6f46c42017-10-26 15:26:16 -0400363fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400364
Nika Layzella6f46c42017-10-26 15:26:16 -0400365fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500366# [ cfg ( feature = "full" ) ]
367fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
368# [ cfg ( feature = "full" ) ]
369fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
370# [ cfg ( feature = "full" ) ]
371fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
397}
398
399
Nika Layzella6f46c42017-10-26 15:26:16 -0400400pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400401 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500402 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400403 kind: _visitor.fold_abi_kind(_i . kind),
404 }
405}
406
Nika Layzella6f46c42017-10-26 15:26:16 -0400407pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400408 use ::AbiKind::*;
409 match _i {
410 Named(_binding_0, ) => {
411 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500412 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400413 )
414 }
415 Default => { Default }
416 }
417}
418
Nika Layzellc08227a2017-12-04 16:30:17 -0500419pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
420 AngleBracketedGenericArguments {
David Tolnaycc0f0372017-12-28 19:11:04 -0500421 turbofish: (_i . turbofish).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
422 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500423 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500424 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400425 }
426}
427# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400428pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400429 ArgCaptured {
430 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500431 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800432 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgSelf {
438 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500439 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400440 }
441}
442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400443pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400444 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500446 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400447 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500448 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400449 }
450}
451# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400452pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400453 Arm {
454 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
455 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500456 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400457 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500458 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400459 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500460 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 }
462}
463
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400465 use ::AttrStyle::*;
466 match _i {
467 Outer => { Outer }
468 Inner(_binding_0, ) => {
469 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400471 )
472 }
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400477 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500478 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500479 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500480 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400481 path: _visitor.fold_path(_i . path),
482 tts: _i . tts,
483 is_sugared_doc: _i . is_sugared_doc,
484 }
485}
486
Nika Layzella6f46c42017-10-26 15:26:16 -0400487pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400488 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500489 name: (_i . name).map(|it| { (
490 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500491 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500492 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800493 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400498 use ::BareFnArgName::*;
499 match _i {
500 Named(_binding_0, ) => {
501 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500502 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400503 )
504 }
505 Wild(_binding_0, ) => {
506 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500507 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400508 )
509 }
510 }
511}
512
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800513pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
514 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400515 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400516 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500517 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500518 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500519 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400520 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800522 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400523 }
524}
525
Nika Layzella6f46c42017-10-26 15:26:16 -0400526pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400527 use ::BinOp::*;
528 match _i {
529 Add(_binding_0, ) => {
530 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400532 )
533 }
534 Sub(_binding_0, ) => {
535 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500536 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400537 )
538 }
539 Mul(_binding_0, ) => {
540 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500541 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400542 )
543 }
544 Div(_binding_0, ) => {
545 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500546 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400547 )
548 }
549 Rem(_binding_0, ) => {
550 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500551 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400552 )
553 }
554 And(_binding_0, ) => {
555 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500556 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400557 )
558 }
559 Or(_binding_0, ) => {
560 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500561 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400562 )
563 }
564 BitXor(_binding_0, ) => {
565 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500566 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400567 )
568 }
569 BitAnd(_binding_0, ) => {
570 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500571 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400572 )
573 }
574 BitOr(_binding_0, ) => {
575 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500576 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400577 )
578 }
579 Shl(_binding_0, ) => {
580 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500581 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400582 )
583 }
584 Shr(_binding_0, ) => {
585 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500586 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400587 )
588 }
589 Eq(_binding_0, ) => {
590 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500591 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400592 )
593 }
594 Lt(_binding_0, ) => {
595 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500596 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400597 )
598 }
599 Le(_binding_0, ) => {
600 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500601 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400602 )
603 }
604 Ne(_binding_0, ) => {
605 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500606 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400607 )
608 }
609 Ge(_binding_0, ) => {
610 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500611 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400612 )
613 }
614 Gt(_binding_0, ) => {
615 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500616 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400617 )
618 }
619 AddEq(_binding_0, ) => {
620 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500621 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400622 )
623 }
624 SubEq(_binding_0, ) => {
625 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500626 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400627 )
628 }
629 MulEq(_binding_0, ) => {
630 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500631 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400632 )
633 }
634 DivEq(_binding_0, ) => {
635 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500636 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400637 )
638 }
639 RemEq(_binding_0, ) => {
640 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500641 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400642 )
643 }
644 BitXorEq(_binding_0, ) => {
645 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500646 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400647 )
648 }
649 BitAndEq(_binding_0, ) => {
650 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500651 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400652 )
653 }
654 BitOrEq(_binding_0, ) => {
655 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500656 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400657 )
658 }
659 ShlEq(_binding_0, ) => {
660 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500661 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400662 )
663 }
664 ShrEq(_binding_0, ) => {
665 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500666 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400667 )
668 }
669 }
670}
671# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400672pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400673 use ::BindingMode::*;
674 match _i {
675 ByRef(_binding_0, _binding_1, ) => {
676 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500677 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400678 _visitor.fold_mutability(_binding_1),
679 )
680 }
681 ByValue(_binding_0, ) => {
682 ByValue (
683 _visitor.fold_mutability(_binding_0),
684 )
685 }
686 }
687}
688# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400689pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400690 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500691 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400692 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
693 }
694}
695
Nika Layzella6f46c42017-10-26 15:26:16 -0400696pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400697 use ::Body::*;
698 match _i {
699 Enum(_binding_0, ) => {
700 Enum (
701 _visitor.fold_body_enum(_binding_0),
702 )
703 }
704 Struct(_binding_0, ) => {
705 Struct (
706 _visitor.fold_body_struct(_binding_0),
707 )
708 }
709 }
710}
711
Nika Layzella6f46c42017-10-26 15:26:16 -0400712pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400713 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500714 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500715 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400716 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
717 }
718}
719
Nika Layzella6f46c42017-10-26 15:26:16 -0400720pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400721 BodyStruct {
722 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500723 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
724 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400725 }
726}
727
Nika Layzella6f46c42017-10-26 15:26:16 -0400728pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400729 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500730 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
731 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400732 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500733 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400734 }
735}
736# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400737pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400738 use ::CaptureBy::*;
739 match _i {
740 Value(_binding_0, ) => {
741 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500742 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400743 )
744 }
745 Ref => { Ref }
746 }
747}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500748
749pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
750 ConstParam {
751 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500752 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500753 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500754 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500755 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500757 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
758 }
759}
Nika Layzell27726662017-10-24 23:16:35 -0400760# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400761pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400762 use ::Constness::*;
763 match _i {
764 Const(_binding_0, ) => {
765 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500766 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400767 )
768 }
769 NotConst => { NotConst }
770 }
771}
772# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400773pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400774 use ::Defaultness::*;
775 match _i {
776 Default(_binding_0, ) => {
777 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500778 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400779 )
780 }
781 Final => { Final }
782 }
783}
784
Nika Layzella6f46c42017-10-26 15:26:16 -0400785pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400786 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400787 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500788 vis: _visitor.fold_visibility(_i . vis),
789 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400790 generics: _visitor.fold_generics(_i . generics),
791 body: _visitor.fold_body(_i . body),
792 }
793}
794
Nika Layzella6f46c42017-10-26 15:26:16 -0400795pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500796 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400797 match _i {
798 Box(_binding_0, ) => {
799 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400800 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400801 )
802 }
803 InPlace(_binding_0, ) => {
804 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400805 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400806 )
807 }
808 Array(_binding_0, ) => {
809 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400810 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400811 )
812 }
813 Call(_binding_0, ) => {
814 Call (
815 _visitor.fold_expr_call(_binding_0),
816 )
817 }
818 MethodCall(_binding_0, ) => {
819 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400820 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400821 )
822 }
David Tolnay05362582017-12-26 01:33:57 -0500823 Tuple(_binding_0, ) => {
824 Tuple (
825 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400826 )
827 }
828 Binary(_binding_0, ) => {
829 Binary (
830 _visitor.fold_expr_binary(_binding_0),
831 )
832 }
833 Unary(_binding_0, ) => {
834 Unary (
835 _visitor.fold_expr_unary(_binding_0),
836 )
837 }
838 Lit(_binding_0, ) => {
839 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500840 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400841 )
842 }
843 Cast(_binding_0, ) => {
844 Cast (
845 _visitor.fold_expr_cast(_binding_0),
846 )
847 }
848 Type(_binding_0, ) => {
849 Type (
850 _visitor.fold_expr_type(_binding_0),
851 )
852 }
853 If(_binding_0, ) => {
854 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400855 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400856 )
857 }
858 IfLet(_binding_0, ) => {
859 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400860 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400861 )
862 }
863 While(_binding_0, ) => {
864 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400865 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400866 )
867 }
868 WhileLet(_binding_0, ) => {
869 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400870 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400871 )
872 }
873 ForLoop(_binding_0, ) => {
874 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400875 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400876 )
877 }
878 Loop(_binding_0, ) => {
879 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400880 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400881 )
882 }
883 Match(_binding_0, ) => {
884 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400885 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 )
887 }
888 Closure(_binding_0, ) => {
889 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400890 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400891 )
892 }
Nika Layzell640832a2017-12-04 13:37:09 -0500893 Unsafe(_binding_0, ) => {
894 Unsafe (
895 full!(_visitor.fold_expr_unsafe(_binding_0)),
896 )
897 }
Nika Layzell27726662017-10-24 23:16:35 -0400898 Block(_binding_0, ) => {
899 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400900 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400901 )
902 }
903 Assign(_binding_0, ) => {
904 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400905 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400906 )
907 }
908 AssignOp(_binding_0, ) => {
909 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400910 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400911 )
912 }
913 Field(_binding_0, ) => {
914 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400915 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400916 )
917 }
Nika Layzell27726662017-10-24 23:16:35 -0400918 Index(_binding_0, ) => {
919 Index (
920 _visitor.fold_expr_index(_binding_0),
921 )
922 }
923 Range(_binding_0, ) => {
924 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400925 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400926 )
927 }
928 Path(_binding_0, ) => {
929 Path (
930 _visitor.fold_expr_path(_binding_0),
931 )
932 }
933 AddrOf(_binding_0, ) => {
934 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400935 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400936 )
937 }
938 Break(_binding_0, ) => {
939 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400940 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400941 )
942 }
943 Continue(_binding_0, ) => {
944 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400945 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400946 )
947 }
David Tolnayc246cd32017-12-28 23:14:32 -0500948 Return(_binding_0, ) => {
949 Return (
950 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400951 )
952 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800953 Macro(_binding_0, ) => {
954 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500955 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400956 )
957 }
958 Struct(_binding_0, ) => {
959 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400960 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400961 )
962 }
963 Repeat(_binding_0, ) => {
964 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400965 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400966 )
967 }
968 Paren(_binding_0, ) => {
969 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500970 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400971 )
972 }
973 Group(_binding_0, ) => {
974 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500975 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400976 )
977 }
978 Try(_binding_0, ) => {
979 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400980 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400981 )
982 }
983 Catch(_binding_0, ) => {
984 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400985 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400986 )
987 }
988 Yield(_binding_0, ) => {
989 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400990 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400991 )
992 }
993 }
994}
995# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500996pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
997 ExprAddrOf {
998 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
999 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1000 mutbl: _visitor.fold_mutability(_i . mutbl),
1001 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1002 }
1003}
1004# [ cfg ( feature = "full" ) ]
1005pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
1006 ExprArray {
1007 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1008 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001009 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001010 }
1011}
1012# [ cfg ( feature = "full" ) ]
1013pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1014 ExprAssign {
1015 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1016 left: Box::new(_visitor.fold_expr(* _i . left)),
1017 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1018 right: Box::new(_visitor.fold_expr(* _i . right)),
1019 }
1020}
1021# [ cfg ( feature = "full" ) ]
1022pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1023 ExprAssignOp {
1024 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1025 left: Box::new(_visitor.fold_expr(* _i . left)),
1026 op: _visitor.fold_bin_op(_i . op),
1027 right: Box::new(_visitor.fold_expr(* _i . right)),
1028 }
1029}
1030
1031pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1032 ExprBinary {
1033 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1034 left: Box::new(_visitor.fold_expr(* _i . left)),
1035 op: _visitor.fold_bin_op(_i . op),
1036 right: Box::new(_visitor.fold_expr(* _i . right)),
1037 }
1038}
1039# [ cfg ( feature = "full" ) ]
1040pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1041 ExprBlock {
1042 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1043 block: _visitor.fold_block(_i . block),
1044 }
1045}
1046# [ cfg ( feature = "full" ) ]
1047pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1048 ExprBox {
1049 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1050 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1051 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1052 }
1053}
1054# [ cfg ( feature = "full" ) ]
1055pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1056 ExprBreak {
1057 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1058 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1059 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1060 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1061 }
1062}
1063
1064pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1065 ExprCall {
1066 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1067 func: Box::new(_visitor.fold_expr(* _i . func)),
1068 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1069 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1070 }
1071}
1072
1073pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1074 ExprCast {
1075 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1076 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1077 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1078 ty: Box::new(_visitor.fold_type(* _i . ty)),
1079 }
1080}
1081# [ cfg ( feature = "full" ) ]
1082pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1083 ExprCatch {
1084 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1085 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1086 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1087 block: _visitor.fold_block(_i . block),
1088 }
1089}
1090# [ cfg ( feature = "full" ) ]
1091pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1092 ExprClosure {
1093 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1094 capture: _visitor.fold_capture_by(_i . capture),
1095 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1096 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1097 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1098 output: _visitor.fold_return_type(_i . output),
1099 body: Box::new(_visitor.fold_expr(* _i . body)),
1100 }
1101}
1102# [ cfg ( feature = "full" ) ]
1103pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1104 ExprContinue {
1105 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1106 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1107 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1108 }
1109}
1110# [ cfg ( feature = "full" ) ]
1111pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1112 ExprField {
1113 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1114 base: Box::new(_visitor.fold_expr(* _i . base)),
1115 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1116 member: _visitor.fold_member(_i . member),
1117 }
1118}
1119# [ cfg ( feature = "full" ) ]
1120pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1121 ExprForLoop {
1122 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1123 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1124 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1125 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1126 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1127 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1128 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1129 body: _visitor.fold_block(_i . body),
1130 }
1131}
David Tolnaye98775f2017-12-28 23:17:00 -05001132# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001133pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1134 ExprGroup {
1135 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1136 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1137 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1138 }
1139}
1140# [ cfg ( feature = "full" ) ]
1141pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1142 ExprIf {
1143 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1144 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1145 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1146 if_true: _visitor.fold_block(_i . if_true),
1147 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1148 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1149 }
1150}
1151# [ cfg ( feature = "full" ) ]
1152pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1153 ExprIfLet {
1154 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1155 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1156 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1157 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1158 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1159 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1160 if_true: _visitor.fold_block(_i . if_true),
1161 else_token: (_i . else_token).map(|it| { Token ! [ else ](tokens_helper(_visitor, &(it).0)) }),
1162 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1163 }
1164}
1165# [ cfg ( feature = "full" ) ]
1166pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1167 ExprInPlace {
1168 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1169 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001170 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001171 value: Box::new(_visitor.fold_expr(* _i . value)),
1172 }
1173}
1174
1175pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1176 ExprIndex {
1177 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1178 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1179 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1180 index: Box::new(_visitor.fold_expr(* _i . index)),
1181 }
1182}
1183
1184pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1185 ExprLit {
1186 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1187 lit: _visitor.fold_lit(_i . lit),
1188 }
1189}
1190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001191pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001192 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001193 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001194 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001195 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001196 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1197 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001198 }
1199}
1200# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001201pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1202 ExprMacro {
1203 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1204 mac: _visitor.fold_macro(_i . mac),
1205 }
1206}
1207# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001208pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001209 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001210 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001211 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001212 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001213 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001214 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1215 }
1216}
1217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001218pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001219 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001220 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001221 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001222 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001223 method: _visitor.fold_ident(_i . method),
David Tolnaycc0f0372017-12-28 19:11:04 -05001224 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001225 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
1226 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001227 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001228 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1229 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 }
1231}
David Tolnaye98775f2017-12-28 23:17:00 -05001232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001233pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001235 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001236 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001237 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001238 }
1239}
1240
Nika Layzella6f46c42017-10-26 15:26:16 -04001241pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001242 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001243 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001244 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001245 path: _visitor.fold_path(_i . path),
1246 }
1247}
1248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001251 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001252 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001253 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001254 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001255 }
1256}
1257# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001258pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001259 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001260 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001261 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001262 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001263 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001264 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1265 }
1266}
1267# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001268pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1269 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001270 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001271 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001272 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001273 }
1274}
1275# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001276pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001277 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001278 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001279 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001280 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001281 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1282 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1283 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001284 }
1285}
1286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001287pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001288 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001289 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001290 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001291 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001292 }
1293}
1294# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001295pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1296 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001297 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001298 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001299 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001300 }
1301}
Nika Layzell27726662017-10-24 23:16:35 -04001302
Nika Layzella6f46c42017-10-26 15:26:16 -04001303pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001304 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001305 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001306 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001307 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001308 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001309 }
1310}
1311
Nika Layzella6f46c42017-10-26 15:26:16 -04001312pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001313 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001314 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001315 op: _visitor.fold_un_op(_i . op),
1316 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1317 }
1318}
1319# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001320pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1321 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001322 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001323 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001324 block: _visitor.fold_block(_i . block),
1325 }
1326}
1327# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001328pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001329 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001330 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001331 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001332 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1333 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001334 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1335 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001336 }
1337}
1338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001340 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001341 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001342 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001343 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1344 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1345 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001346 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001347 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001348 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1349 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001350 }
1351}
1352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001353pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001354 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001355 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001356 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001357 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001358 }
1359}
1360
Nika Layzella6f46c42017-10-26 15:26:16 -04001361pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001362 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001363 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001364 vis: _visitor.fold_visibility(_i . vis),
1365 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001366 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001367 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001368 }
1369}
1370# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001371pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001372 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001373 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001374 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001375 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001376 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1377 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001378 }
1379}
1380# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001381pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001382 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001383 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1384 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001385 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001386 expr: _visitor.fold_expr(_i . expr),
1387 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001388 }
1389}
1390# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001391pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001392 File {
1393 shebang: _i . shebang,
1394 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1395 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1396 }
1397}
1398# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001399pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001400 use ::FnArg::*;
1401 match _i {
1402 SelfRef(_binding_0, ) => {
1403 SelfRef (
1404 _visitor.fold_arg_self_ref(_binding_0),
1405 )
1406 }
1407 SelfValue(_binding_0, ) => {
1408 SelfValue (
1409 _visitor.fold_arg_self(_binding_0),
1410 )
1411 }
1412 Captured(_binding_0, ) => {
1413 Captured (
1414 _visitor.fold_arg_captured(_binding_0),
1415 )
1416 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001417 Inferred(_binding_0, ) => {
1418 Inferred (
1419 _visitor.fold_pat(_binding_0),
1420 )
1421 }
Nika Layzell27726662017-10-24 23:16:35 -04001422 Ignored(_binding_0, ) => {
1423 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001424 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001425 )
1426 }
1427 }
1428}
1429# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001430pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001431 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001432 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001433 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001434 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001435 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001436 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001437 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001438 }
1439}
1440# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001441pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001442 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001443 match _i {
1444 Fn(_binding_0, ) => {
1445 Fn (
1446 _visitor.fold_foreign_item_fn(_binding_0),
1447 )
1448 }
1449 Static(_binding_0, ) => {
1450 Static (
1451 _visitor.fold_foreign_item_static(_binding_0),
1452 )
1453 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001454 Type(_binding_0, ) => {
1455 Type (
1456 _visitor.fold_foreign_item_type(_binding_0),
1457 )
1458 }
Nika Layzell27726662017-10-24 23:16:35 -04001459 }
1460}
1461# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001462pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1463 ForeignItemFn {
1464 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1465 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001466 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001467 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001468 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001469 }
1470}
1471# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001472pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001473 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001474 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1475 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001476 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001477 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001478 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001479 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001480 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001481 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001482 }
1483}
David Tolnay199bcbb2017-11-12 10:33:52 -08001484# [ cfg ( feature = "full" ) ]
1485pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1486 ForeignItemType {
1487 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1488 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001489 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001490 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001491 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001492 }
1493}
Nika Layzell27726662017-10-24 23:16:35 -04001494
Nika Layzellc08227a2017-12-04 16:30:17 -05001495pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1496 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001497 match _i {
1498 Lifetime(_binding_0, ) => {
1499 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001500 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001501 )
1502 }
1503 Type(_binding_0, ) => {
1504 Type (
1505 _visitor.fold_type(_binding_0),
1506 )
1507 }
1508 TypeBinding(_binding_0, ) => {
1509 TypeBinding (
1510 _visitor.fold_type_binding(_binding_0),
1511 )
1512 }
Nika Layzellc680e612017-12-04 19:07:20 -05001513 Const(_binding_0, ) => {
1514 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001515 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001516 )
1517 }
Nika Layzell357885a2017-12-04 15:47:07 -05001518 }
1519}
1520
David Tolnayc2f1aba2017-11-12 20:29:22 -08001521pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1522 use ::GenericParam::*;
1523 match _i {
1524 Lifetime(_binding_0, ) => {
1525 Lifetime (
1526 _visitor.fold_lifetime_def(_binding_0),
1527 )
1528 }
1529 Type(_binding_0, ) => {
1530 Type (
1531 _visitor.fold_type_param(_binding_0),
1532 )
1533 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001534 Const(_binding_0, ) => {
1535 Const (
1536 _visitor.fold_const_param(_binding_0),
1537 )
1538 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001539 }
1540}
1541
Nika Layzella6f46c42017-10-26 15:26:16 -04001542pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001543 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001544 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001545 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001546 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001547 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001548 }
1549}
Nika Layzellefb83ba2017-12-19 18:23:55 -05001550
1551pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: Ident) -> Ident {
David Tolnay4ba63a02017-12-28 15:53:05 -05001552 Ident {
1553 sym: _i . sym,
1554 span: _visitor.fold_span(_i . span),
1555 }
Nika Layzellefb83ba2017-12-19 18:23:55 -05001556}
Nika Layzell27726662017-10-24 23:16:35 -04001557# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001558pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001559 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001560 match _i {
1561 Const(_binding_0, ) => {
1562 Const (
1563 _visitor.fold_impl_item_const(_binding_0),
1564 )
1565 }
1566 Method(_binding_0, ) => {
1567 Method (
1568 _visitor.fold_impl_item_method(_binding_0),
1569 )
1570 }
1571 Type(_binding_0, ) => {
1572 Type (
1573 _visitor.fold_impl_item_type(_binding_0),
1574 )
1575 }
1576 Macro(_binding_0, ) => {
1577 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001578 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001579 )
1580 }
1581 }
1582}
1583# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001584pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1585 ImplItemConst {
1586 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1587 vis: _visitor.fold_visibility(_i . vis),
1588 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001589 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001590 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001591 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001592 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001593 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001594 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001595 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001596 }
1597}
1598# [ cfg ( feature = "full" ) ]
1599pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1600 ImplItemMacro {
1601 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1602 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001603 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001604 }
1605}
1606# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001607pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001608 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001609 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001610 vis: _visitor.fold_visibility(_i . vis),
1611 defaultness: _visitor.fold_defaultness(_i . defaultness),
1612 sig: _visitor.fold_method_sig(_i . sig),
1613 block: _visitor.fold_block(_i . block),
1614 }
1615}
1616# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001617pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001618 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001619 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001620 vis: _visitor.fold_visibility(_i . vis),
1621 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001622 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001623 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001624 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001625 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001626 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001627 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001628 }
1629}
1630# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001631pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001632 use ::ImplPolarity::*;
1633 match _i {
1634 Positive => { Positive }
1635 Negative(_binding_0, ) => {
1636 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001637 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001638 )
1639 }
1640 }
1641}
1642# [ cfg ( feature = "full" ) ]
David Tolnay85b69a42017-12-27 20:43:10 -05001643pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1644 Index {
1645 index: _i . index,
1646 span: _visitor.fold_span(_i . span),
1647 }
1648}
1649# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001650pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001651 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001652 match _i {
1653 ExternCrate(_binding_0, ) => {
1654 ExternCrate (
1655 _visitor.fold_item_extern_crate(_binding_0),
1656 )
1657 }
1658 Use(_binding_0, ) => {
1659 Use (
1660 _visitor.fold_item_use(_binding_0),
1661 )
1662 }
1663 Static(_binding_0, ) => {
1664 Static (
1665 _visitor.fold_item_static(_binding_0),
1666 )
1667 }
1668 Const(_binding_0, ) => {
1669 Const (
1670 _visitor.fold_item_const(_binding_0),
1671 )
1672 }
1673 Fn(_binding_0, ) => {
1674 Fn (
1675 _visitor.fold_item_fn(_binding_0),
1676 )
1677 }
1678 Mod(_binding_0, ) => {
1679 Mod (
1680 _visitor.fold_item_mod(_binding_0),
1681 )
1682 }
1683 ForeignMod(_binding_0, ) => {
1684 ForeignMod (
1685 _visitor.fold_item_foreign_mod(_binding_0),
1686 )
1687 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001688 Type(_binding_0, ) => {
1689 Type (
1690 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001691 )
1692 }
1693 Enum(_binding_0, ) => {
1694 Enum (
1695 _visitor.fold_item_enum(_binding_0),
1696 )
1697 }
1698 Struct(_binding_0, ) => {
1699 Struct (
1700 _visitor.fold_item_struct(_binding_0),
1701 )
1702 }
1703 Union(_binding_0, ) => {
1704 Union (
1705 _visitor.fold_item_union(_binding_0),
1706 )
1707 }
1708 Trait(_binding_0, ) => {
1709 Trait (
1710 _visitor.fold_item_trait(_binding_0),
1711 )
1712 }
1713 DefaultImpl(_binding_0, ) => {
1714 DefaultImpl (
1715 _visitor.fold_item_default_impl(_binding_0),
1716 )
1717 }
1718 Impl(_binding_0, ) => {
1719 Impl (
1720 _visitor.fold_item_impl(_binding_0),
1721 )
1722 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001723 Macro(_binding_0, ) => {
1724 Macro (
1725 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001726 )
1727 }
David Tolnay500d8322017-12-18 00:32:51 -08001728 Macro2(_binding_0, ) => {
1729 Macro2 (
1730 _visitor.fold_item_macro2(_binding_0),
1731 )
1732 }
Nika Layzell27726662017-10-24 23:16:35 -04001733 }
1734}
1735# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001736pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1737 ItemConst {
1738 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1739 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001740 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001741 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001742 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001743 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001744 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001745 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001746 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001747 }
1748}
1749# [ cfg ( feature = "full" ) ]
1750pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1751 ItemDefaultImpl {
1752 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1753 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001754 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001755 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001756 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1757 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001758 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001759 }
1760}
1761# [ cfg ( feature = "full" ) ]
1762pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1763 ItemEnum {
1764 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1765 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001766 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001767 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001768 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001769 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001770 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1771 }
1772}
1773# [ cfg ( feature = "full" ) ]
1774pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1775 ItemExternCrate {
1776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1777 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1779 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001780 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001781 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001782 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001783 _visitor.fold_ident(( it ) . 1),
1784 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001785 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 }
1787}
1788# [ cfg ( feature = "full" ) ]
1789pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1790 ItemFn {
1791 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1792 vis: _visitor.fold_visibility(_i . vis),
1793 constness: _visitor.fold_constness(_i . constness),
1794 unsafety: _visitor.fold_unsafety(_i . unsafety),
1795 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001796 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001797 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001798 block: Box::new(_visitor.fold_block(* _i . block)),
1799 }
1800}
1801# [ cfg ( feature = "full" ) ]
1802pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1803 ItemForeignMod {
1804 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1805 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001806 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001807 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1808 }
1809}
1810# [ cfg ( feature = "full" ) ]
1811pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1812 ItemImpl {
1813 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1814 defaultness: _visitor.fold_defaultness(_i . defaultness),
1815 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001816 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001817 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001818 trait_: (_i . trait_).map(|it| { (
1819 _visitor.fold_impl_polarity(( it ) . 0),
1820 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001821 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001822 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001823 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001824 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001825 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1826 }
1827}
1828# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001829pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1830 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001831 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001832 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001833 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001834 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001835 }
1836}
1837# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001838pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1839 ItemMacro2 {
1840 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1841 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001842 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001843 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001844 args: _i . args,
1845 body: _i . body,
1846 }
1847}
1848# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001849pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001850 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001851 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001852 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001853 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001854 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001855 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001856 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001857 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1858 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001859 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001860 }
1861}
1862# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001863pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001864 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001865 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001866 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001867 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001868 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001869 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001870 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001871 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001872 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001873 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001874 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001875 }
1876}
1877# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001878pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001879 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001880 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001881 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001882 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001883 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001884 generics: _visitor.fold_generics(_i . generics),
1885 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001886 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001887 }
1888}
1889# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001890pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001891 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001892 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001893 vis: _visitor.fold_visibility(_i . vis),
1894 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001895 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1896 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001897 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001898 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001899 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001900 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001901 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001902 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1903 }
1904}
1905# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001906pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1907 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001908 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001909 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001911 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001912 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001913 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001914 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001915 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001916 }
1917}
1918# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001919pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001920 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001921 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001922 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001923 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001924 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001925 generics: _visitor.fold_generics(_i . generics),
1926 data: _visitor.fold_variant_data(_i . data),
1927 }
1928}
1929# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001930pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001931 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001932 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001933 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001934 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1935 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001936 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1937 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001938 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001939 }
1940}
1941
David Tolnay4ba63a02017-12-28 15:53:05 -05001942pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, _i: Lifetime) -> Lifetime {
1943 Lifetime {
1944 sym: _i . sym,
1945 span: _visitor.fold_span(_i . span),
1946 }
1947}
1948
Nika Layzella6f46c42017-10-26 15:26:16 -04001949pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001950 LifetimeDef {
1951 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001952 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001953 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001954 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1955 }
1956}
1957
1958pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1959 Lit {
1960 value: _i . value,
1961 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001962 }
1963}
1964# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001965pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001966 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001967 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001968 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1969 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1970 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1971 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1972 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1973 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1974 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001975 }
1976}
Nika Layzell27726662017-10-24 23:16:35 -04001977
David Tolnaydecf28d2017-11-11 11:56:45 -08001978pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1979 Macro {
1980 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001981 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001982 tokens: _i . tokens,
1983 }
1984}
David Tolnay85b69a42017-12-27 20:43:10 -05001985# [ cfg ( feature = "full" ) ]
1986pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
1987 use ::Member::*;
1988 match _i {
1989 Named(_binding_0, ) => {
1990 Named (
1991 _visitor.fold_ident(_binding_0),
1992 )
1993 }
1994 Unnamed(_binding_0, ) => {
1995 Unnamed (
1996 _visitor.fold_index(_binding_0),
1997 )
1998 }
1999 }
2000}
David Tolnaydecf28d2017-11-11 11:56:45 -08002001
Nika Layzella6f46c42017-10-26 15:26:16 -04002002pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002003 use ::MetaItem::*;
2004 match _i {
2005 Term(_binding_0, ) => {
2006 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002007 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002008 )
2009 }
2010 List(_binding_0, ) => {
2011 List (
2012 _visitor.fold_meta_item_list(_binding_0),
2013 )
2014 }
2015 NameValue(_binding_0, ) => {
2016 NameValue (
2017 _visitor.fold_meta_name_value(_binding_0),
2018 )
2019 }
2020 }
2021}
2022
Nika Layzella6f46c42017-10-26 15:26:16 -04002023pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002024 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002025 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002026 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002027 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2028 }
2029}
2030
Nika Layzella6f46c42017-10-26 15:26:16 -04002031pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002032 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002033 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002034 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002035 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002036 }
2037}
2038# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002039pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002040 MethodSig {
2041 constness: _visitor.fold_constness(_i . constness),
2042 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002043 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002044 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002045 decl: _visitor.fold_fn_decl(_i . decl),
2046 }
2047}
2048
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002049pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2050 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002051 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002052 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002053 }
2054}
2055
Nika Layzella6f46c42017-10-26 15:26:16 -04002056pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002057 use ::Mutability::*;
2058 match _i {
2059 Mutable(_binding_0, ) => {
2060 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002061 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002062 )
2063 }
2064 Immutable => { Immutable }
2065 }
2066}
2067
Nika Layzella6f46c42017-10-26 15:26:16 -04002068pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002069 use ::NestedMetaItem::*;
2070 match _i {
2071 MetaItem(_binding_0, ) => {
2072 MetaItem (
2073 _visitor.fold_meta_item(_binding_0),
2074 )
2075 }
2076 Literal(_binding_0, ) => {
2077 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002078 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002079 )
2080 }
2081 }
2082}
2083
Nika Layzellc08227a2017-12-04 16:30:17 -05002084pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2085 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002086 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002087 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002088 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002089 }
2090}
2091# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002092pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002093 use ::Pat::*;
2094 match _i {
2095 Wild(_binding_0, ) => {
2096 Wild (
2097 _visitor.fold_pat_wild(_binding_0),
2098 )
2099 }
2100 Ident(_binding_0, ) => {
2101 Ident (
2102 _visitor.fold_pat_ident(_binding_0),
2103 )
2104 }
2105 Struct(_binding_0, ) => {
2106 Struct (
2107 _visitor.fold_pat_struct(_binding_0),
2108 )
2109 }
2110 TupleStruct(_binding_0, ) => {
2111 TupleStruct (
2112 _visitor.fold_pat_tuple_struct(_binding_0),
2113 )
2114 }
2115 Path(_binding_0, ) => {
2116 Path (
2117 _visitor.fold_pat_path(_binding_0),
2118 )
2119 }
2120 Tuple(_binding_0, ) => {
2121 Tuple (
2122 _visitor.fold_pat_tuple(_binding_0),
2123 )
2124 }
2125 Box(_binding_0, ) => {
2126 Box (
2127 _visitor.fold_pat_box(_binding_0),
2128 )
2129 }
2130 Ref(_binding_0, ) => {
2131 Ref (
2132 _visitor.fold_pat_ref(_binding_0),
2133 )
2134 }
2135 Lit(_binding_0, ) => {
2136 Lit (
2137 _visitor.fold_pat_lit(_binding_0),
2138 )
2139 }
2140 Range(_binding_0, ) => {
2141 Range (
2142 _visitor.fold_pat_range(_binding_0),
2143 )
2144 }
2145 Slice(_binding_0, ) => {
2146 Slice (
2147 _visitor.fold_pat_slice(_binding_0),
2148 )
2149 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002150 Macro(_binding_0, ) => {
2151 Macro (
2152 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002153 )
2154 }
2155 }
2156}
2157# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002158pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002159 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002160 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002161 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002162 }
2163}
2164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002165pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002166 PatIdent {
2167 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002168 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002169 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002170 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002171 }
2172}
2173# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002174pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002175 PatLit {
2176 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2177 }
2178}
2179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002181 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002182 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002183 path: _visitor.fold_path(_i . path),
2184 }
2185}
2186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002188 PatRange {
2189 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002190 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002191 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002192 }
2193}
2194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002195pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002196 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002197 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002198 mutbl: _visitor.fold_mutability(_i . mutbl),
2199 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002200 }
2201}
2202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002203pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002204 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002205 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002206 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002207 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002208 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002209 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2210 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002211 }
2212}
2213# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002214pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002215 PatStruct {
2216 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002217 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002218 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002219 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002220 }
2221}
2222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002223pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002224 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002225 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002226 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002227 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002228 dots_pos: _i . dots_pos,
2229 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002230 }
2231}
2232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002233pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002234 PatTupleStruct {
2235 path: _visitor.fold_path(_i . path),
2236 pat: _visitor.fold_pat_tuple(_i . pat),
2237 }
2238}
2239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002240pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002241 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002242 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002243 }
2244}
2245
Nika Layzella6f46c42017-10-26 15:26:16 -04002246pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002247 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002248 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002249 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2250 }
2251}
Nika Layzellc08227a2017-12-04 16:30:17 -05002252
2253pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2254 use ::PathArguments::*;
2255 match _i {
2256 None => { None }
2257 AngleBracketed(_binding_0, ) => {
2258 AngleBracketed (
2259 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2260 )
2261 }
2262 Parenthesized(_binding_0, ) => {
2263 Parenthesized (
2264 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2265 )
2266 }
2267 }
2268}
Nika Layzell27726662017-10-24 23:16:35 -04002269
Nika Layzella6f46c42017-10-26 15:26:16 -04002270pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002271 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002272 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002273 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002274 }
2275}
Nika Layzell27726662017-10-24 23:16:35 -04002276
Nika Layzella6f46c42017-10-26 15:26:16 -04002277pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002278 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002279 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002280 trait_ref: _visitor.fold_path(_i . trait_ref),
2281 }
2282}
2283
Nika Layzella6f46c42017-10-26 15:26:16 -04002284pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002285 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002286 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002287 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002288 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002289 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2290 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002291 }
2292}
2293# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002294pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002295 use ::RangeLimits::*;
2296 match _i {
2297 HalfOpen(_binding_0, ) => {
2298 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002299 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002300 )
2301 }
2302 Closed(_binding_0, ) => {
2303 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002304 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002305 )
2306 }
2307 }
2308}
David Tolnayf93b90d2017-11-11 19:21:26 -08002309
2310pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2311 use ::ReturnType::*;
2312 match _i {
2313 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002314 Type(_binding_0, _binding_1, ) => {
2315 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002316 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2317 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002318 )
2319 }
2320 }
2321}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002322
2323pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2324 _i
2325}
Nika Layzell27726662017-10-24 23:16:35 -04002326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002327pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002328 use ::Stmt::*;
2329 match _i {
2330 Local(_binding_0, ) => {
2331 Local (
2332 Box::new(_visitor.fold_local(* _binding_0)),
2333 )
2334 }
2335 Item(_binding_0, ) => {
2336 Item (
2337 Box::new(_visitor.fold_item(* _binding_0)),
2338 )
2339 }
2340 Expr(_binding_0, ) => {
2341 Expr (
2342 Box::new(_visitor.fold_expr(* _binding_0)),
2343 )
2344 }
2345 Semi(_binding_0, _binding_1, ) => {
2346 Semi (
2347 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002348 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002349 )
2350 }
Nika Layzell27726662017-10-24 23:16:35 -04002351 }
2352}
2353
Nika Layzella6f46c42017-10-26 15:26:16 -04002354pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002355 use ::TraitBoundModifier::*;
2356 match _i {
2357 None => { None }
2358 Maybe(_binding_0, ) => {
2359 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002360 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002361 )
2362 }
2363 }
2364}
2365# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002366pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002367 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002368 match _i {
2369 Const(_binding_0, ) => {
2370 Const (
2371 _visitor.fold_trait_item_const(_binding_0),
2372 )
2373 }
2374 Method(_binding_0, ) => {
2375 Method (
2376 _visitor.fold_trait_item_method(_binding_0),
2377 )
2378 }
2379 Type(_binding_0, ) => {
2380 Type (
2381 _visitor.fold_trait_item_type(_binding_0),
2382 )
2383 }
2384 Macro(_binding_0, ) => {
2385 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002386 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 }
2390}
2391# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002392pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2393 TraitItemConst {
2394 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002395 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002396 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002397 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002398 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002399 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002400 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002401 _visitor.fold_expr(( it ) . 1),
2402 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002403 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002404 }
2405}
2406# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002407pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2408 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002409 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002410 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002411 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002412 }
2413}
2414# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002415pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002416 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002417 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002418 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002419 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002420 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002421 }
2422}
2423# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002424pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002425 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002426 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002428 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002429 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002430 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002431 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002432 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002433 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002434 _visitor.fold_type(( it ) . 1),
2435 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002436 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002437 }
2438}
2439
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002440pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2441 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002442 match _i {
2443 Slice(_binding_0, ) => {
2444 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002445 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
2448 Array(_binding_0, ) => {
2449 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002450 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002451 )
2452 }
2453 Ptr(_binding_0, ) => {
2454 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002456 )
2457 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002458 Reference(_binding_0, ) => {
2459 Reference (
2460 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002461 )
2462 }
2463 BareFn(_binding_0, ) => {
2464 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002465 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002466 )
2467 }
2468 Never(_binding_0, ) => {
2469 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002471 )
2472 }
David Tolnay05362582017-12-26 01:33:57 -05002473 Tuple(_binding_0, ) => {
2474 Tuple (
2475 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002476 )
2477 }
2478 Path(_binding_0, ) => {
2479 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002480 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002481 )
2482 }
2483 TraitObject(_binding_0, ) => {
2484 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002486 )
2487 }
2488 ImplTrait(_binding_0, ) => {
2489 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002491 )
2492 }
2493 Paren(_binding_0, ) => {
2494 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002495 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002496 )
2497 }
2498 Group(_binding_0, ) => {
2499 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002500 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002501 )
2502 }
2503 Infer(_binding_0, ) => {
2504 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002505 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002506 )
2507 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002508 Macro(_binding_0, ) => {
2509 Macro (
2510 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002511 )
2512 }
2513 }
2514}
2515
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2517 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002518 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002520 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002521 amt: _visitor.fold_expr(_i . amt),
2522 }
2523}
2524
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002525pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2526 TypeBareFn {
2527 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002528 }
2529}
2530
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2532 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002533 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002534 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535 ty: _visitor.fold_type(_i . ty),
2536 }
2537}
2538
2539pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2540 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002541 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002543 }
2544}
2545
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002546pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2547 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002548 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002550 }
2551}
2552
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002553pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2554 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002555 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002556 }
2557}
2558
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002559pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2560 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002561 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002562 }
2563}
2564
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2566 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002567 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002568 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002569 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002571 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002573 }
2574}
2575
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002576pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2577 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002578 match _i {
2579 Trait(_binding_0, _binding_1, ) => {
2580 Trait (
2581 _visitor.fold_poly_trait_ref(_binding_0),
2582 _visitor.fold_trait_bound_modifier(_binding_1),
2583 )
2584 }
2585 Region(_binding_0, ) => {
2586 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002587 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002588 )
2589 }
2590 }
2591}
2592
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002593pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2594 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002595 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002597 }
2598}
2599
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002600pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2601 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002602 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002603 path: _visitor.fold_path(_i . path),
2604 }
2605}
2606
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002607pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2608 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002609 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2610 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002611 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002612 }
2613}
2614
David Tolnay0a89b4d2017-11-13 00:55:45 -08002615pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2616 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002617 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002618 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002619 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002620 }
2621}
2622
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002623pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2624 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002625 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002626 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_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2631 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002632 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002633 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002634 }
2635}
2636
David Tolnay05362582017-12-26 01:33:57 -05002637pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2638 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002639 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002640 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002641 }
2642}
2643
Nika Layzella6f46c42017-10-26 15:26:16 -04002644pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002645 use ::UnOp::*;
2646 match _i {
2647 Deref(_binding_0, ) => {
2648 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002649 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002650 )
2651 }
2652 Not(_binding_0, ) => {
2653 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002654 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002655 )
2656 }
2657 Neg(_binding_0, ) => {
2658 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002659 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002660 )
2661 }
2662 }
2663}
2664
Nika Layzella6f46c42017-10-26 15:26:16 -04002665pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002666 use ::Unsafety::*;
2667 match _i {
2668 Unsafe(_binding_0, ) => {
2669 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002670 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002671 )
2672 }
2673 Normal => { Normal }
2674 }
2675}
David Tolnay5f332a92017-12-26 00:42:45 -05002676# [ cfg ( feature = "full" ) ]
2677pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2678 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002679 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002680 }
2681}
2682# [ cfg ( feature = "full" ) ]
2683pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2684 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002685 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002686 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2687 }
2688}
2689# [ cfg ( feature = "full" ) ]
2690pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2691 UsePath {
2692 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002693 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002694 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002695 _visitor.fold_ident(( it ) . 1),
2696 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002697 }
2698}
2699# [ cfg ( feature = "full" ) ]
2700pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2701 use ::UseTree::*;
2702 match _i {
2703 Path(_binding_0, ) => {
2704 Path (
2705 _visitor.fold_use_path(_binding_0),
2706 )
2707 }
2708 Glob(_binding_0, ) => {
2709 Glob (
2710 _visitor.fold_use_glob(_binding_0),
2711 )
2712 }
2713 List(_binding_0, ) => {
2714 List (
2715 _visitor.fold_use_list(_binding_0),
2716 )
2717 }
2718 }
2719}
Nika Layzell27726662017-10-24 23:16:35 -04002720
Nika Layzella6f46c42017-10-26 15:26:16 -04002721pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002722 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002723 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002724 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002725 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002726 discriminant: (_i . discriminant).map(|it| { (
2727 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2728 _visitor.fold_expr(( it ) . 1),
2729 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002730 }
2731}
2732
Nika Layzella6f46c42017-10-26 15:26:16 -04002733pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002734 use ::VariantData::*;
2735 match _i {
2736 Struct(_binding_0, _binding_1, ) => {
2737 Struct (
2738 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002739 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002740 )
2741 }
2742 Tuple(_binding_0, _binding_1, ) => {
2743 Tuple (
2744 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002745 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002746 )
2747 }
2748 Unit => { Unit }
2749 }
2750}
Nika Layzell27726662017-10-24 23:16:35 -04002751
Nika Layzella6f46c42017-10-26 15:26:16 -04002752pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002753 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002754 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002755 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002756 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002757 }
2758}
2759
Nika Layzella6f46c42017-10-26 15:26:16 -04002760pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002761 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002762 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002763 }
2764}
2765
Nika Layzella6f46c42017-10-26 15:26:16 -04002766pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002767 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002768 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002769 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002770 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002771 path: Box::new(_visitor.fold_path(* _i . path)),
2772 }
2773}
2774
Nika Layzella6f46c42017-10-26 15:26:16 -04002775pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002776 use ::Visibility::*;
2777 match _i {
2778 Public(_binding_0, ) => {
2779 Public (
2780 _visitor.fold_vis_public(_binding_0),
2781 )
2782 }
2783 Crate(_binding_0, ) => {
2784 Crate (
2785 _visitor.fold_vis_crate(_binding_0),
2786 )
2787 }
2788 Restricted(_binding_0, ) => {
2789 Restricted (
2790 _visitor.fold_vis_restricted(_binding_0),
2791 )
2792 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002793 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002794 }
2795}
2796
Nika Layzella6f46c42017-10-26 15:26:16 -04002797pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002798 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002799 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002800 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002801 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002802 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002803 }
2804}
2805
Nika Layzella6f46c42017-10-26 15:26:16 -04002806pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002807 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002808 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002809 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2810 }
2811}
2812
Nika Layzella6f46c42017-10-26 15:26:16 -04002813pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002814 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002815 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002816 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002817 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002818 }
2819}
2820
Nika Layzella6f46c42017-10-26 15:26:16 -04002821pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002822 use ::WherePredicate::*;
2823 match _i {
2824 BoundPredicate(_binding_0, ) => {
2825 BoundPredicate (
2826 _visitor.fold_where_bound_predicate(_binding_0),
2827 )
2828 }
2829 RegionPredicate(_binding_0, ) => {
2830 RegionPredicate (
2831 _visitor.fold_where_region_predicate(_binding_0),
2832 )
2833 }
2834 EqPredicate(_binding_0, ) => {
2835 EqPredicate (
2836 _visitor.fold_where_eq_predicate(_binding_0),
2837 )
2838 }
2839 }
2840}
2841
Nika Layzella6f46c42017-10-26 15:26:16 -04002842pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002843 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002844 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002845 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002846 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002847 }
2848}
2849