blob: 192cc6df15c185c64d71106c45e75b0cda17516e [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3//! A Folder represents an AST->AST fold; it accepts an AST piece,
4//! and returns a piece of the same type.
5
David Tolnay0afc9b32017-12-27 13:38:24 -05006#![cfg_attr(rustfmt, rustfmt_skip)]
7
Nika Layzell27726662017-10-24 23:16:35 -04008// Unreachable code is generated sometimes without the full feature.
9#![allow(unreachable_code)]
David Tolnayf0d63bf2017-12-26 12:29:47 -050010#![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
Nika Layzell27726662017-10-24 23:16:35 -040011
Nika Layzella6f46c42017-10-26 15:26:16 -040012use *;
David Tolnay1e01f9c2017-12-28 20:16:19 -050013use token::{Brace, Bracket, Paren, Group};
David Tolnay98942562017-12-26 21:24:35 -050014use proc_macro2::Span;
David Tolnayf60f4262017-12-28 19:17:58 -050015use gen::helper::fold::*;
Nika Layzell27726662017-10-24 23:16:35 -040016
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040017
18#[cfg(feature = "full")]
19macro_rules! full {
20 ($e:expr) => { $e }
21}
22
23#[cfg(not(feature = "full"))]
24macro_rules! full {
25 ($e:expr) => { unreachable!() }
26}
27
28
Nika Layzell27726662017-10-24 23:16:35 -040029/// AST->AST fold.
30///
31/// Each method of the Folder trait is a hook to be potentially overridden. Each
32/// method's default implementation recursively visits the substructure of the
33/// input via the `walk` functions, which perform an "identity fold", that
34/// is, they return the same structure that they are given (for example the
35/// `fold_file` method by default calls `fold::walk_file`).
36///
37/// If you want to ensure that your code handles every variant
38/// explicitly, you need to override each method. (And you also need
39/// to monitor future changes to `Folder` in case a new method with a
40/// new default implementation gets introduced.)
41pub trait Folder {
42
Nika Layzella6f46c42017-10-26 15:26:16 -040043fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040044
Nika Layzella6f46c42017-10-26 15:26:16 -040045fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040046
Nika Layzellc08227a2017-12-04 16:30:17 -050047fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040048# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040049fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040050# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040051fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040052# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040053fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040054# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040055fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040056
Nika Layzella6f46c42017-10-26 15:26:16 -040057fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040058
Nika Layzella6f46c42017-10-26 15:26:16 -040059fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040060
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
David Tolnayfd6bf5c2017-11-12 09:41:14 -080065fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -050082
83fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132
David Tolnay8c91b882017-12-28 23:04:32 -0500133fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -0500137fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
David Tolnaye98775f2017-12-28 23:17:00 -0500142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -0500151fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -0500157fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
David Tolnay0cf94f22017-12-28 23:46:26 -0500158# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500163fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800188# [ cfg ( feature = "full" ) ]
189fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190
Nika Layzellc08227a2017-12-04 16:30:17 -0500191fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500192# [ cfg ( feature = "full" ) ]
193fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500194
David Tolnayc2f1aba2017-11-12 20:29:22 -0800195fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
196
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500198
199fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800205fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500212
David Tolnay85b69a42017-12-27 20:43:10 -0500213fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800231fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800233fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800243fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248
David Tolnay4ba63a02017-12-28 15:53:05 -0500249fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
250
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
David Tolnay4ba63a02017-12-28 15:53:05 -0500252
253fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256
David Tolnaydecf28d2017-11-11 11:56:45 -0800257fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
David Tolnay14982012017-12-29 00:49:51 -0500258
David Tolnay85b69a42017-12-27 20:43:10 -0500259fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
David Tolnaydecf28d2017-11-11 11:56:45 -0800260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
David Tolnayd60cfec2017-12-29 00:21:38 -0500268# [ cfg ( feature = "full" ) ]
269fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800271fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
Nika Layzellc08227a2017-12-04 16:30:17 -0500277fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500304
305fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800314
315fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzellefb83ba2017-12-19 18:23:55 -0500316
317fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800327fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800333fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800335fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
Nika Layzella6f46c42017-10-26 15:26:16 -0400339fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800341fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
342
343fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
344
345fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
346
347fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
348
349fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
350
351fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
352
353fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
354
355fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
356
357fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
358
David Tolnay0a89b4d2017-11-13 00:55:45 -0800359fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800360
361fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
362
363fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
364
David Tolnay05362582017-12-26 01:33:57 -0500365fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800366
Nika Layzella6f46c42017-10-26 15:26:16 -0400367fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400368
Nika Layzella6f46c42017-10-26 15:26:16 -0400369fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
David Tolnay5f332a92017-12-26 00:42:45 -0500370# [ cfg ( feature = "full" ) ]
371fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
372# [ cfg ( feature = "full" ) ]
373fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
374# [ cfg ( feature = "full" ) ]
375fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
376# [ cfg ( feature = "full" ) ]
377fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
401}
402
David Tolnayd0adf522017-12-29 01:30:07 -0500403pub fn fold_ident<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Ident) -> Ident {
404 _i.span = _visitor.fold_span(_i.span);
405 _i
406}
407
408pub fn fold_lifetime<V: Folder + ?Sized>(_visitor: &mut V, mut _i: Lifetime) -> Lifetime {
409 _i.span = _visitor.fold_span(_i.span);
410 _i
411}
412
Nika Layzell27726662017-10-24 23:16:35 -0400413
Nika Layzella6f46c42017-10-26 15:26:16 -0400414pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400415 Abi {
David Tolnaycc0f0372017-12-28 19:11:04 -0500416 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400417 kind: _visitor.fold_abi_kind(_i . kind),
418 }
419}
420
Nika Layzella6f46c42017-10-26 15:26:16 -0400421pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400422 use ::AbiKind::*;
423 match _i {
424 Named(_binding_0, ) => {
425 Named (
David Tolnay4ba63a02017-12-28 15:53:05 -0500426 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400427 )
428 }
429 Default => { Default }
430 }
431}
432
Nika Layzellc08227a2017-12-04 16:30:17 -0500433pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
434 AngleBracketedGenericArguments {
David Tolnay2d4e08a2017-12-28 23:54:07 -0500435 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500436 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzellc08227a2017-12-04 16:30:17 -0500437 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500438 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400439 }
440}
441# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400442pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400443 ArgCaptured {
444 pat: _visitor.fold_pat(_i . pat),
David Tolnaycc0f0372017-12-28 19:11:04 -0500445 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800446 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400447 }
448}
449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400450pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400451 ArgSelf {
452 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnaycc0f0372017-12-28 19:11:04 -0500453 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400454 }
455}
456# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400457pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400458 ArgSelfRef {
David Tolnaycc0f0372017-12-28 19:11:04 -0500459 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -0500460 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400461 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500462 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400463 }
464}
465# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400466pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400467 Arm {
468 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
469 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500470 if_token: (_i . if_token).map(|it| { Token ! [ if ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400471 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500472 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400473 body: Box::new(_visitor.fold_expr(* _i . body)),
David Tolnaycc0f0372017-12-28 19:11:04 -0500474 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400475 }
476}
477
Nika Layzella6f46c42017-10-26 15:26:16 -0400478pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400479 use ::AttrStyle::*;
480 match _i {
481 Outer => { Outer }
482 Inner(_binding_0, ) => {
483 Inner (
David Tolnaycc0f0372017-12-28 19:11:04 -0500484 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400485 )
486 }
487 }
488}
489
Nika Layzella6f46c42017-10-26 15:26:16 -0400490pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400491 Attribute {
David Tolnaycc0f0372017-12-28 19:11:04 -0500492 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500493 style: _visitor.fold_attr_style(_i . style),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500494 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400495 path: _visitor.fold_path(_i . path),
496 tts: _i . tts,
497 is_sugared_doc: _i . is_sugared_doc,
498 }
499}
500
Nika Layzella6f46c42017-10-26 15:26:16 -0400501pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400502 BareFnArg {
David Tolnay5c4c0b52017-12-28 17:58:54 -0500503 name: (_i . name).map(|it| { (
504 _visitor.fold_bare_fn_arg_name(( it ) . 0),
David Tolnaycc0f0372017-12-28 19:11:04 -0500505 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -0500506 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800507 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400508 }
509}
510
Nika Layzella6f46c42017-10-26 15:26:16 -0400511pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400512 use ::BareFnArgName::*;
513 match _i {
514 Named(_binding_0, ) => {
515 Named (
Nika Layzellefb83ba2017-12-19 18:23:55 -0500516 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400517 )
518 }
519 Wild(_binding_0, ) => {
520 Wild (
David Tolnaycc0f0372017-12-28 19:11:04 -0500521 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400522 )
523 }
524 }
525}
526
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800527pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
528 BareFnType {
Nika Layzell27726662017-10-24 23:16:35 -0400529 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400530 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500531 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500532 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500533 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400534 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500535 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayf93b90d2017-11-11 19:21:26 -0800536 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400537 }
538}
539
Nika Layzella6f46c42017-10-26 15:26:16 -0400540pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400541 use ::BinOp::*;
542 match _i {
543 Add(_binding_0, ) => {
544 Add (
David Tolnaycc0f0372017-12-28 19:11:04 -0500545 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400546 )
547 }
548 Sub(_binding_0, ) => {
549 Sub (
David Tolnaycc0f0372017-12-28 19:11:04 -0500550 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400551 )
552 }
553 Mul(_binding_0, ) => {
554 Mul (
David Tolnaycc0f0372017-12-28 19:11:04 -0500555 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400556 )
557 }
558 Div(_binding_0, ) => {
559 Div (
David Tolnaycc0f0372017-12-28 19:11:04 -0500560 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400561 )
562 }
563 Rem(_binding_0, ) => {
564 Rem (
David Tolnaycc0f0372017-12-28 19:11:04 -0500565 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400566 )
567 }
568 And(_binding_0, ) => {
569 And (
David Tolnaycc0f0372017-12-28 19:11:04 -0500570 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400571 )
572 }
573 Or(_binding_0, ) => {
574 Or (
David Tolnaycc0f0372017-12-28 19:11:04 -0500575 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400576 )
577 }
578 BitXor(_binding_0, ) => {
579 BitXor (
David Tolnaycc0f0372017-12-28 19:11:04 -0500580 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400581 )
582 }
583 BitAnd(_binding_0, ) => {
584 BitAnd (
David Tolnaycc0f0372017-12-28 19:11:04 -0500585 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400586 )
587 }
588 BitOr(_binding_0, ) => {
589 BitOr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500590 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400591 )
592 }
593 Shl(_binding_0, ) => {
594 Shl (
David Tolnaycc0f0372017-12-28 19:11:04 -0500595 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400596 )
597 }
598 Shr(_binding_0, ) => {
599 Shr (
David Tolnaycc0f0372017-12-28 19:11:04 -0500600 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400601 )
602 }
603 Eq(_binding_0, ) => {
604 Eq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500605 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400606 )
607 }
608 Lt(_binding_0, ) => {
609 Lt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500610 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400611 )
612 }
613 Le(_binding_0, ) => {
614 Le (
David Tolnaycc0f0372017-12-28 19:11:04 -0500615 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400616 )
617 }
618 Ne(_binding_0, ) => {
619 Ne (
David Tolnaycc0f0372017-12-28 19:11:04 -0500620 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400621 )
622 }
623 Ge(_binding_0, ) => {
624 Ge (
David Tolnaycc0f0372017-12-28 19:11:04 -0500625 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400626 )
627 }
628 Gt(_binding_0, ) => {
629 Gt (
David Tolnaycc0f0372017-12-28 19:11:04 -0500630 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400631 )
632 }
633 AddEq(_binding_0, ) => {
634 AddEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500635 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400636 )
637 }
638 SubEq(_binding_0, ) => {
639 SubEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500640 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400641 )
642 }
643 MulEq(_binding_0, ) => {
644 MulEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500645 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400646 )
647 }
648 DivEq(_binding_0, ) => {
649 DivEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500650 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400651 )
652 }
653 RemEq(_binding_0, ) => {
654 RemEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500655 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400656 )
657 }
658 BitXorEq(_binding_0, ) => {
659 BitXorEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500660 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400661 )
662 }
663 BitAndEq(_binding_0, ) => {
664 BitAndEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500665 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400666 )
667 }
668 BitOrEq(_binding_0, ) => {
669 BitOrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500670 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400671 )
672 }
673 ShlEq(_binding_0, ) => {
674 ShlEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500675 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400676 )
677 }
678 ShrEq(_binding_0, ) => {
679 ShrEq (
David Tolnaycc0f0372017-12-28 19:11:04 -0500680 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400681 )
682 }
683 }
684}
685# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400686pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400687 use ::BindingMode::*;
688 match _i {
689 ByRef(_binding_0, _binding_1, ) => {
690 ByRef (
David Tolnaycc0f0372017-12-28 19:11:04 -0500691 Token ! [ ref ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400692 _visitor.fold_mutability(_binding_1),
693 )
694 }
695 ByValue(_binding_0, ) => {
696 ByValue (
697 _visitor.fold_mutability(_binding_0),
698 )
699 }
700 }
701}
702# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400703pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400704 Block {
David Tolnay1e01f9c2017-12-28 20:16:19 -0500705 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400706 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
707 }
708}
709
Nika Layzella6f46c42017-10-26 15:26:16 -0400710pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400711 use ::Body::*;
712 match _i {
713 Enum(_binding_0, ) => {
714 Enum (
715 _visitor.fold_body_enum(_binding_0),
716 )
717 }
718 Struct(_binding_0, ) => {
719 Struct (
720 _visitor.fold_body_struct(_binding_0),
721 )
722 }
723 }
724}
725
Nika Layzella6f46c42017-10-26 15:26:16 -0400726pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400727 BodyEnum {
David Tolnaycc0f0372017-12-28 19:11:04 -0500728 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -0500729 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400730 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
731 }
732}
733
Nika Layzella6f46c42017-10-26 15:26:16 -0400734pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400735 BodyStruct {
736 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -0500737 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
738 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400739 }
740}
741
Nika Layzella6f46c42017-10-26 15:26:16 -0400742pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400743 BoundLifetimes {
David Tolnaycc0f0372017-12-28 19:11:04 -0500744 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
745 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400746 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500747 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400748 }
749}
750# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400751pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400752 use ::CaptureBy::*;
753 match _i {
754 Value(_binding_0, ) => {
755 Value (
David Tolnaycc0f0372017-12-28 19:11:04 -0500756 Token ! [ move ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400757 )
758 }
759 Ref => { Ref }
760 }
761}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500762
763pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
764 ConstParam {
765 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -0500766 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -0500767 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -0500768 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500769 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -0500770 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500771 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
772 }
773}
Nika Layzell27726662017-10-24 23:16:35 -0400774# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400775pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400776 use ::Constness::*;
777 match _i {
778 Const(_binding_0, ) => {
779 Const (
David Tolnaycc0f0372017-12-28 19:11:04 -0500780 Token ! [ const ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400781 )
782 }
783 NotConst => { NotConst }
784 }
785}
786# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400787pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400788 use ::Defaultness::*;
789 match _i {
790 Default(_binding_0, ) => {
791 Default (
David Tolnaycc0f0372017-12-28 19:11:04 -0500792 Token ! [ default ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -0400793 )
794 }
795 Final => { Final }
796 }
797}
798
Nika Layzella6f46c42017-10-26 15:26:16 -0400799pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400800 DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400801 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -0500802 vis: _visitor.fold_visibility(_i . vis),
803 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -0400804 generics: _visitor.fold_generics(_i . generics),
805 body: _visitor.fold_body(_i . body),
806 }
807}
808
Nika Layzella6f46c42017-10-26 15:26:16 -0400809pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
David Tolnay8c91b882017-12-28 23:04:32 -0500810 use ::Expr::*;
Nika Layzell27726662017-10-24 23:16:35 -0400811 match _i {
812 Box(_binding_0, ) => {
813 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400814 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400815 )
816 }
817 InPlace(_binding_0, ) => {
818 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400819 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400820 )
821 }
822 Array(_binding_0, ) => {
823 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400824 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400825 )
826 }
827 Call(_binding_0, ) => {
828 Call (
829 _visitor.fold_expr_call(_binding_0),
830 )
831 }
832 MethodCall(_binding_0, ) => {
833 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400834 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400835 )
836 }
David Tolnay05362582017-12-26 01:33:57 -0500837 Tuple(_binding_0, ) => {
838 Tuple (
839 full!(_visitor.fold_expr_tuple(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400840 )
841 }
842 Binary(_binding_0, ) => {
843 Binary (
844 _visitor.fold_expr_binary(_binding_0),
845 )
846 }
847 Unary(_binding_0, ) => {
848 Unary (
849 _visitor.fold_expr_unary(_binding_0),
850 )
851 }
852 Lit(_binding_0, ) => {
853 Lit (
David Tolnay8c91b882017-12-28 23:04:32 -0500854 _visitor.fold_expr_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -0400855 )
856 }
857 Cast(_binding_0, ) => {
858 Cast (
859 _visitor.fold_expr_cast(_binding_0),
860 )
861 }
862 Type(_binding_0, ) => {
863 Type (
David Tolnay0cf94f22017-12-28 23:46:26 -0500864 full!(_visitor.fold_expr_type(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400865 )
866 }
867 If(_binding_0, ) => {
868 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400869 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 )
871 }
872 IfLet(_binding_0, ) => {
873 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400874 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400875 )
876 }
877 While(_binding_0, ) => {
878 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400879 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400880 )
881 }
882 WhileLet(_binding_0, ) => {
883 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400884 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400885 )
886 }
887 ForLoop(_binding_0, ) => {
888 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400889 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400890 )
891 }
892 Loop(_binding_0, ) => {
893 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400894 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400895 )
896 }
897 Match(_binding_0, ) => {
898 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400899 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400900 )
901 }
902 Closure(_binding_0, ) => {
903 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400904 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400905 )
906 }
Nika Layzell640832a2017-12-04 13:37:09 -0500907 Unsafe(_binding_0, ) => {
908 Unsafe (
909 full!(_visitor.fold_expr_unsafe(_binding_0)),
910 )
911 }
Nika Layzell27726662017-10-24 23:16:35 -0400912 Block(_binding_0, ) => {
913 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400914 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400915 )
916 }
917 Assign(_binding_0, ) => {
918 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400919 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400920 )
921 }
922 AssignOp(_binding_0, ) => {
923 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400924 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400925 )
926 }
927 Field(_binding_0, ) => {
928 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400930 )
931 }
Nika Layzell27726662017-10-24 23:16:35 -0400932 Index(_binding_0, ) => {
933 Index (
934 _visitor.fold_expr_index(_binding_0),
935 )
936 }
937 Range(_binding_0, ) => {
938 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400940 )
941 }
942 Path(_binding_0, ) => {
943 Path (
944 _visitor.fold_expr_path(_binding_0),
945 )
946 }
947 AddrOf(_binding_0, ) => {
948 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400949 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400950 )
951 }
952 Break(_binding_0, ) => {
953 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400954 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400955 )
956 }
957 Continue(_binding_0, ) => {
958 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400959 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400960 )
961 }
David Tolnayc246cd32017-12-28 23:14:32 -0500962 Return(_binding_0, ) => {
963 Return (
964 full!(_visitor.fold_expr_return(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400965 )
966 }
David Tolnaydecf28d2017-11-11 11:56:45 -0800967 Macro(_binding_0, ) => {
968 Macro (
David Tolnay8c91b882017-12-28 23:04:32 -0500969 full!(_visitor.fold_expr_macro(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
972 Struct(_binding_0, ) => {
973 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400974 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400975 )
976 }
977 Repeat(_binding_0, ) => {
978 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400979 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400980 )
981 }
982 Paren(_binding_0, ) => {
983 Paren (
David Tolnaye98775f2017-12-28 23:17:00 -0500984 full!(_visitor.fold_expr_paren(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400985 )
986 }
987 Group(_binding_0, ) => {
988 Group (
David Tolnaye98775f2017-12-28 23:17:00 -0500989 full!(_visitor.fold_expr_group(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400990 )
991 }
992 Try(_binding_0, ) => {
993 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400994 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400995 )
996 }
997 Catch(_binding_0, ) => {
998 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400999 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001000 )
1001 }
1002 Yield(_binding_0, ) => {
1003 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001004 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001005 )
1006 }
1007 }
1008}
1009# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001010pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
1011 ExprAddrOf {
1012 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1013 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
1014 mutbl: _visitor.fold_mutability(_i . mutbl),
1015 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1016 }
1017}
1018# [ cfg ( feature = "full" ) ]
1019pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
1020 ExprArray {
1021 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1022 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001023 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001024 }
1025}
1026# [ cfg ( feature = "full" ) ]
1027pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1028 ExprAssign {
1029 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1030 left: Box::new(_visitor.fold_expr(* _i . left)),
1031 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1032 right: Box::new(_visitor.fold_expr(* _i . right)),
1033 }
1034}
1035# [ cfg ( feature = "full" ) ]
1036pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1037 ExprAssignOp {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1039 left: Box::new(_visitor.fold_expr(* _i . left)),
1040 op: _visitor.fold_bin_op(_i . op),
1041 right: Box::new(_visitor.fold_expr(* _i . right)),
1042 }
1043}
1044
1045pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1046 ExprBinary {
1047 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1048 left: Box::new(_visitor.fold_expr(* _i . left)),
1049 op: _visitor.fold_bin_op(_i . op),
1050 right: Box::new(_visitor.fold_expr(* _i . right)),
1051 }
1052}
1053# [ cfg ( feature = "full" ) ]
1054pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1055 ExprBlock {
1056 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1057 block: _visitor.fold_block(_i . block),
1058 }
1059}
1060# [ cfg ( feature = "full" ) ]
1061pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1062 ExprBox {
1063 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1064 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1065 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1066 }
1067}
1068# [ cfg ( feature = "full" ) ]
1069pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1070 ExprBreak {
1071 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1072 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1073 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1074 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1075 }
1076}
1077
1078pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1079 ExprCall {
1080 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1081 func: Box::new(_visitor.fold_expr(* _i . func)),
1082 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1083 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1084 }
1085}
1086
1087pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1088 ExprCast {
1089 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1090 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1091 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1092 ty: Box::new(_visitor.fold_type(* _i . ty)),
1093 }
1094}
1095# [ cfg ( feature = "full" ) ]
1096pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1097 ExprCatch {
1098 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1099 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1100 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1101 block: _visitor.fold_block(_i . block),
1102 }
1103}
1104# [ cfg ( feature = "full" ) ]
1105pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1106 ExprClosure {
1107 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1108 capture: _visitor.fold_capture_by(_i . capture),
1109 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1110 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1111 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1112 output: _visitor.fold_return_type(_i . output),
1113 body: Box::new(_visitor.fold_expr(* _i . body)),
1114 }
1115}
1116# [ cfg ( feature = "full" ) ]
1117pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1118 ExprContinue {
1119 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1120 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1121 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1122 }
1123}
1124# [ cfg ( feature = "full" ) ]
1125pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1126 ExprField {
1127 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1128 base: Box::new(_visitor.fold_expr(* _i . base)),
1129 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1130 member: _visitor.fold_member(_i . member),
1131 }
1132}
1133# [ cfg ( feature = "full" ) ]
1134pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1135 ExprForLoop {
1136 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1137 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1138 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1139 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1140 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1141 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1142 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1143 body: _visitor.fold_block(_i . body),
1144 }
1145}
David Tolnaye98775f2017-12-28 23:17:00 -05001146# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001147pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1148 ExprGroup {
1149 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1150 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1151 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1152 }
1153}
1154# [ cfg ( feature = "full" ) ]
1155pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1156 ExprIf {
1157 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1158 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1159 cond: Box::new(_visitor.fold_expr(* _i . cond)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001160 then_branch: _visitor.fold_block(_i . then_branch),
1161 else_branch: (_i . else_branch).map(|it| { (
1162 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1163 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1164 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001165 }
1166}
1167# [ cfg ( feature = "full" ) ]
1168pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1169 ExprIfLet {
1170 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1171 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1172 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1173 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1174 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1175 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay2ccf32a2017-12-29 00:34:26 -05001176 then_branch: _visitor.fold_block(_i . then_branch),
1177 else_branch: (_i . else_branch).map(|it| { (
1178 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1179 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1180 ) }),
David Tolnay8c91b882017-12-28 23:04:32 -05001181 }
1182}
1183# [ cfg ( feature = "full" ) ]
1184pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1185 ExprInPlace {
1186 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1187 place: Box::new(_visitor.fold_expr(* _i . place)),
David Tolnay8701a5c2017-12-28 23:31:10 -05001188 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
David Tolnay8c91b882017-12-28 23:04:32 -05001189 value: Box::new(_visitor.fold_expr(* _i . value)),
1190 }
1191}
1192
1193pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1194 ExprIndex {
1195 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1196 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1197 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1198 index: Box::new(_visitor.fold_expr(* _i . index)),
1199 }
1200}
1201
1202pub fn fold_expr_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1203 ExprLit {
1204 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1205 lit: _visitor.fold_lit(_i . lit),
1206 }
1207}
1208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001209pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001210 ExprLoop {
David Tolnay8c91b882017-12-28 23:04:32 -05001211 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001212 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001213 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001214 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1215 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001216 }
1217}
1218# [ cfg ( feature = "full" ) ]
David Tolnay8c91b882017-12-28 23:04:32 -05001219pub fn fold_expr_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1220 ExprMacro {
1221 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1222 mac: _visitor.fold_macro(_i . mac),
1223 }
1224}
1225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001226pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001227 ExprMatch {
David Tolnay8c91b882017-12-28 23:04:32 -05001228 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001229 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001230 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001231 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001232 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1233 }
1234}
1235# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001236pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001237 ExprMethodCall {
David Tolnay8c91b882017-12-28 23:04:32 -05001238 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay76418512017-12-28 23:47:47 -05001239 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001240 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001241 method: _visitor.fold_ident(_i . method),
David Tolnayd60cfec2017-12-29 00:21:38 -05001242 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001243 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1244 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001245 }
1246}
David Tolnaye98775f2017-12-28 23:17:00 -05001247# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001248pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001249 ExprParen {
David Tolnay8c91b882017-12-28 23:04:32 -05001250 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001251 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
Nika Layzell27726662017-10-24 23:16:35 -04001253 }
1254}
1255
Nika Layzella6f46c42017-10-26 15:26:16 -04001256pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001257 ExprPath {
David Tolnay8c91b882017-12-28 23:04:32 -05001258 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001259 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001260 path: _visitor.fold_path(_i . path),
1261 }
1262}
1263# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001264pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001265 ExprRange {
David Tolnay8c91b882017-12-28 23:04:32 -05001266 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001267 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001268 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001269 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
1271}
1272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001273pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprRepeat {
David Tolnay8c91b882017-12-28 23:04:32 -05001275 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001276 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001277 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001278 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001279 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1280 }
1281}
1282# [ cfg ( feature = "full" ) ]
David Tolnayc246cd32017-12-28 23:14:32 -05001283pub fn fold_expr_return<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1284 ExprReturn {
David Tolnay8c91b882017-12-28 23:04:32 -05001285 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001286 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001287 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001288 }
1289}
1290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001291pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001292 ExprStruct {
David Tolnay8c91b882017-12-28 23:04:32 -05001293 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001294 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001295 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001296 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1297 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1298 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001299 }
1300}
1301# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001302pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001303 ExprTry {
David Tolnay8c91b882017-12-28 23:04:32 -05001304 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001305 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001306 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001307 }
1308}
1309# [ cfg ( feature = "full" ) ]
David Tolnay05362582017-12-26 01:33:57 -05001310pub fn fold_expr_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1311 ExprTuple {
David Tolnay8c91b882017-12-28 23:04:32 -05001312 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001313 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay2a86fdd2017-12-28 23:34:28 -05001314 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
David Tolnay05362582017-12-26 01:33:57 -05001315 }
1316}
David Tolnay0cf94f22017-12-28 23:46:26 -05001317# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001318pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001319 ExprType {
David Tolnay8c91b882017-12-28 23:04:32 -05001320 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001321 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001322 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001323 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001324 }
1325}
1326
Nika Layzella6f46c42017-10-26 15:26:16 -04001327pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001328 ExprUnary {
David Tolnay8c91b882017-12-28 23:04:32 -05001329 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001330 op: _visitor.fold_un_op(_i . op),
1331 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1332 }
1333}
1334# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001335pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1336 ExprUnsafe {
David Tolnay8c91b882017-12-28 23:04:32 -05001337 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001338 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
Nika Layzell640832a2017-12-04 13:37:09 -05001339 block: _visitor.fold_block(_i . block),
1340 }
1341}
1342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001343pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001344 ExprWhile {
David Tolnay8c91b882017-12-28 23:04:32 -05001345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001346 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001347 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1348 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001349 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1350 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001351 }
1352}
1353# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001354pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001355 ExprWhileLet {
David Tolnay8c91b882017-12-28 23:04:32 -05001356 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001357 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001358 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1359 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1360 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001361 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001362 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001363 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1364 body: _visitor.fold_block(_i . body),
Nika Layzell27726662017-10-24 23:16:35 -04001365 }
1366}
1367# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001368pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001369 ExprYield {
David Tolnay8c91b882017-12-28 23:04:32 -05001370 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001371 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001372 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001373 }
1374}
1375
Nika Layzella6f46c42017-10-26 15:26:16 -04001376pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001377 Field {
Nika Layzell27726662017-10-24 23:16:35 -04001378 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001379 vis: _visitor.fold_visibility(_i . vis),
1380 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001381 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001382 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001383 }
1384}
1385# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001386pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001387 FieldPat {
David Tolnay4a3f59a2017-12-28 21:21:12 -05001388 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay85b69a42017-12-27 20:43:10 -05001389 member: _visitor.fold_member(_i . member),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001390 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001391 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04001392 }
1393}
1394# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001395pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001396 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001397 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1398 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001399 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001400 expr: _visitor.fold_expr(_i . expr),
Nika Layzell27726662017-10-24 23:16:35 -04001401 }
1402}
1403# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001404pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001405 File {
1406 shebang: _i . shebang,
1407 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1408 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1409 }
1410}
1411# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001412pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001413 use ::FnArg::*;
1414 match _i {
1415 SelfRef(_binding_0, ) => {
1416 SelfRef (
1417 _visitor.fold_arg_self_ref(_binding_0),
1418 )
1419 }
1420 SelfValue(_binding_0, ) => {
1421 SelfValue (
1422 _visitor.fold_arg_self(_binding_0),
1423 )
1424 }
1425 Captured(_binding_0, ) => {
1426 Captured (
1427 _visitor.fold_arg_captured(_binding_0),
1428 )
1429 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001430 Inferred(_binding_0, ) => {
1431 Inferred (
1432 _visitor.fold_pat(_binding_0),
1433 )
1434 }
Nika Layzell27726662017-10-24 23:16:35 -04001435 Ignored(_binding_0, ) => {
1436 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001437 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001438 )
1439 }
1440 }
1441}
1442# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001443pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001444 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001445 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001446 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001447 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001448 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001449 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001450 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001451 }
1452}
1453# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001454pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001455 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001456 match _i {
1457 Fn(_binding_0, ) => {
1458 Fn (
1459 _visitor.fold_foreign_item_fn(_binding_0),
1460 )
1461 }
1462 Static(_binding_0, ) => {
1463 Static (
1464 _visitor.fold_foreign_item_static(_binding_0),
1465 )
1466 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001467 Type(_binding_0, ) => {
1468 Type (
1469 _visitor.fold_foreign_item_type(_binding_0),
1470 )
1471 }
Nika Layzell27726662017-10-24 23:16:35 -04001472 }
1473}
1474# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001475pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1476 ForeignItemFn {
1477 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1478 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001479 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001480 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001481 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001482 }
1483}
1484# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001485pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001486 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001487 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 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001490 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001491 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001492 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001493 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001494 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001495 }
1496}
David Tolnay199bcbb2017-11-12 10:33:52 -08001497# [ cfg ( feature = "full" ) ]
1498pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1499 ForeignItemType {
1500 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1501 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001502 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001503 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001505 }
1506}
Nika Layzell27726662017-10-24 23:16:35 -04001507
Nika Layzellc08227a2017-12-04 16:30:17 -05001508pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1509 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001510 match _i {
1511 Lifetime(_binding_0, ) => {
1512 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001513 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001514 )
1515 }
1516 Type(_binding_0, ) => {
1517 Type (
1518 _visitor.fold_type(_binding_0),
1519 )
1520 }
1521 TypeBinding(_binding_0, ) => {
1522 TypeBinding (
1523 _visitor.fold_type_binding(_binding_0),
1524 )
1525 }
Nika Layzellc680e612017-12-04 19:07:20 -05001526 Const(_binding_0, ) => {
1527 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001528 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001529 )
1530 }
Nika Layzell357885a2017-12-04 15:47:07 -05001531 }
1532}
David Tolnayd60cfec2017-12-29 00:21:38 -05001533# [ cfg ( feature = "full" ) ]
1534pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1535 use ::GenericMethodArgument::*;
1536 match _i {
1537 Type(_binding_0, ) => {
1538 Type (
1539 _visitor.fold_type(_binding_0),
1540 )
1541 }
1542 Const(_binding_0, ) => {
1543 Const (
1544 _visitor.fold_expr(_binding_0),
1545 )
1546 }
1547 }
1548}
Nika Layzell357885a2017-12-04 15:47:07 -05001549
David Tolnayc2f1aba2017-11-12 20:29:22 -08001550pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1551 use ::GenericParam::*;
1552 match _i {
1553 Lifetime(_binding_0, ) => {
1554 Lifetime (
1555 _visitor.fold_lifetime_def(_binding_0),
1556 )
1557 }
1558 Type(_binding_0, ) => {
1559 Type (
1560 _visitor.fold_type_param(_binding_0),
1561 )
1562 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001563 Const(_binding_0, ) => {
1564 Const (
1565 _visitor.fold_const_param(_binding_0),
1566 )
1567 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001568 }
1569}
1570
Nika Layzella6f46c42017-10-26 15:26:16 -04001571pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001572 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001573 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001574 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001575 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001576 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001577 }
1578}
1579# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001580pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001581 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001582 match _i {
1583 Const(_binding_0, ) => {
1584 Const (
1585 _visitor.fold_impl_item_const(_binding_0),
1586 )
1587 }
1588 Method(_binding_0, ) => {
1589 Method (
1590 _visitor.fold_impl_item_method(_binding_0),
1591 )
1592 }
1593 Type(_binding_0, ) => {
1594 Type (
1595 _visitor.fold_impl_item_type(_binding_0),
1596 )
1597 }
1598 Macro(_binding_0, ) => {
1599 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001600 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001601 )
1602 }
1603 }
1604}
1605# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001606pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1607 ImplItemConst {
1608 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1609 vis: _visitor.fold_visibility(_i . vis),
1610 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001611 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001612 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001613 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001614 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001615 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001616 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001617 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001618 }
1619}
1620# [ cfg ( feature = "full" ) ]
1621pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1622 ImplItemMacro {
1623 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1624 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001625 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001626 }
1627}
1628# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001629pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001630 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001631 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001632 vis: _visitor.fold_visibility(_i . vis),
1633 defaultness: _visitor.fold_defaultness(_i . defaultness),
1634 sig: _visitor.fold_method_sig(_i . sig),
1635 block: _visitor.fold_block(_i . block),
1636 }
1637}
1638# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001639pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001640 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001641 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001642 vis: _visitor.fold_visibility(_i . vis),
1643 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001644 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001645 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001646 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001647 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001648 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001649 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001650 }
1651}
1652# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001653pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001654 use ::ImplPolarity::*;
1655 match _i {
1656 Positive => { Positive }
1657 Negative(_binding_0, ) => {
1658 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001659 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001660 )
1661 }
1662 }
1663}
David Tolnay14982012017-12-29 00:49:51 -05001664
David Tolnay85b69a42017-12-27 20:43:10 -05001665pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1666 Index {
1667 index: _i . index,
1668 span: _visitor.fold_span(_i . span),
1669 }
1670}
1671# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001672pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001673 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001674 match _i {
1675 ExternCrate(_binding_0, ) => {
1676 ExternCrate (
1677 _visitor.fold_item_extern_crate(_binding_0),
1678 )
1679 }
1680 Use(_binding_0, ) => {
1681 Use (
1682 _visitor.fold_item_use(_binding_0),
1683 )
1684 }
1685 Static(_binding_0, ) => {
1686 Static (
1687 _visitor.fold_item_static(_binding_0),
1688 )
1689 }
1690 Const(_binding_0, ) => {
1691 Const (
1692 _visitor.fold_item_const(_binding_0),
1693 )
1694 }
1695 Fn(_binding_0, ) => {
1696 Fn (
1697 _visitor.fold_item_fn(_binding_0),
1698 )
1699 }
1700 Mod(_binding_0, ) => {
1701 Mod (
1702 _visitor.fold_item_mod(_binding_0),
1703 )
1704 }
1705 ForeignMod(_binding_0, ) => {
1706 ForeignMod (
1707 _visitor.fold_item_foreign_mod(_binding_0),
1708 )
1709 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001710 Type(_binding_0, ) => {
1711 Type (
1712 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001713 )
1714 }
1715 Enum(_binding_0, ) => {
1716 Enum (
1717 _visitor.fold_item_enum(_binding_0),
1718 )
1719 }
1720 Struct(_binding_0, ) => {
1721 Struct (
1722 _visitor.fold_item_struct(_binding_0),
1723 )
1724 }
1725 Union(_binding_0, ) => {
1726 Union (
1727 _visitor.fold_item_union(_binding_0),
1728 )
1729 }
1730 Trait(_binding_0, ) => {
1731 Trait (
1732 _visitor.fold_item_trait(_binding_0),
1733 )
1734 }
1735 DefaultImpl(_binding_0, ) => {
1736 DefaultImpl (
1737 _visitor.fold_item_default_impl(_binding_0),
1738 )
1739 }
1740 Impl(_binding_0, ) => {
1741 Impl (
1742 _visitor.fold_item_impl(_binding_0),
1743 )
1744 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001745 Macro(_binding_0, ) => {
1746 Macro (
1747 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001748 )
1749 }
David Tolnay500d8322017-12-18 00:32:51 -08001750 Macro2(_binding_0, ) => {
1751 Macro2 (
1752 _visitor.fold_item_macro2(_binding_0),
1753 )
1754 }
Nika Layzell27726662017-10-24 23:16:35 -04001755 }
1756}
1757# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001758pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1759 ItemConst {
1760 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1761 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001762 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001763 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001764 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001765 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001766 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001767 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001768 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001769 }
1770}
1771# [ cfg ( feature = "full" ) ]
1772pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1773 ItemDefaultImpl {
1774 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1775 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001776 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1779 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001780 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 }
1782}
1783# [ cfg ( feature = "full" ) ]
1784pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1785 ItemEnum {
1786 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1787 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001788 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001789 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001790 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001791 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1793 }
1794}
1795# [ cfg ( feature = "full" ) ]
1796pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1797 ItemExternCrate {
1798 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1799 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001800 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1801 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001802 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001803 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001804 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001805 _visitor.fold_ident(( it ) . 1),
1806 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001807 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 }
1809}
1810# [ cfg ( feature = "full" ) ]
1811pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1812 ItemFn {
1813 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1814 vis: _visitor.fold_visibility(_i . vis),
1815 constness: _visitor.fold_constness(_i . constness),
1816 unsafety: _visitor.fold_unsafety(_i . unsafety),
1817 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001818 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001819 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 block: Box::new(_visitor.fold_block(* _i . block)),
1821 }
1822}
1823# [ cfg ( feature = "full" ) ]
1824pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1825 ItemForeignMod {
1826 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1827 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001828 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001829 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1830 }
1831}
1832# [ cfg ( feature = "full" ) ]
1833pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1834 ItemImpl {
1835 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1836 defaultness: _visitor.fold_defaultness(_i . defaultness),
1837 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001838 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001839 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001840 trait_: (_i . trait_).map(|it| { (
1841 _visitor.fold_impl_polarity(( it ) . 0),
1842 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001843 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001844 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001845 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001846 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001847 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1848 }
1849}
1850# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001851pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1852 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001853 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001854 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001855 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001856 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001857 }
1858}
1859# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001860pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1861 ItemMacro2 {
1862 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1863 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001864 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001865 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001866 args: _i . args,
1867 body: _i . body,
1868 }
1869}
1870# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001871pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001872 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001873 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001874 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001875 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001876 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001877 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001878 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001879 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1880 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001881 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001882 }
1883}
1884# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001885pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001886 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001887 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001888 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001889 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001890 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001891 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001892 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001893 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001894 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001895 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001896 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001897 }
1898}
1899# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001900pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001901 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001902 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001903 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001904 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001905 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001906 generics: _visitor.fold_generics(_i . generics),
1907 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001908 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001909 }
1910}
1911# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001912pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001913 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001915 vis: _visitor.fold_visibility(_i . vis),
1916 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001917 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1918 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001919 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001920 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001921 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001922 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001923 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001924 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1925 }
1926}
1927# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001928pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1929 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001930 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001931 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001932 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001933 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001934 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001935 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001936 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001937 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001938 }
1939}
1940# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001941pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001942 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001943 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001944 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001945 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001946 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001947 generics: _visitor.fold_generics(_i . generics),
1948 data: _visitor.fold_variant_data(_i . data),
1949 }
1950}
1951# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001952pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001953 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001955 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001956 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1957 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001958 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1959 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001960 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001961 }
1962}
1963
Nika Layzella6f46c42017-10-26 15:26:16 -04001964pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001965 LifetimeDef {
1966 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001967 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001968 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001969 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1970 }
1971}
1972
1973pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1974 Lit {
1975 value: _i . value,
1976 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001977 }
1978}
1979# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001980pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001981 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001982 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001983 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1984 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1985 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1986 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1987 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1988 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1989 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001990 }
1991}
Nika Layzell27726662017-10-24 23:16:35 -04001992
David Tolnaydecf28d2017-11-11 11:56:45 -08001993pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1994 Macro {
1995 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001996 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001997 tokens: _i . tokens,
1998 }
1999}
David Tolnay14982012017-12-29 00:49:51 -05002000
David Tolnay85b69a42017-12-27 20:43:10 -05002001pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2002 use ::Member::*;
2003 match _i {
2004 Named(_binding_0, ) => {
2005 Named (
2006 _visitor.fold_ident(_binding_0),
2007 )
2008 }
2009 Unnamed(_binding_0, ) => {
2010 Unnamed (
2011 _visitor.fold_index(_binding_0),
2012 )
2013 }
2014 }
2015}
David Tolnaydecf28d2017-11-11 11:56:45 -08002016
Nika Layzella6f46c42017-10-26 15:26:16 -04002017pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002018 use ::MetaItem::*;
2019 match _i {
2020 Term(_binding_0, ) => {
2021 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002022 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002023 )
2024 }
2025 List(_binding_0, ) => {
2026 List (
2027 _visitor.fold_meta_item_list(_binding_0),
2028 )
2029 }
2030 NameValue(_binding_0, ) => {
2031 NameValue (
2032 _visitor.fold_meta_name_value(_binding_0),
2033 )
2034 }
2035 }
2036}
2037
Nika Layzella6f46c42017-10-26 15:26:16 -04002038pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002039 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002040 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002041 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002042 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2043 }
2044}
2045
Nika Layzella6f46c42017-10-26 15:26:16 -04002046pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002047 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002048 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002049 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002050 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002051 }
2052}
2053# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002054pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002055 MethodSig {
2056 constness: _visitor.fold_constness(_i . constness),
2057 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002058 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002059 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002060 decl: _visitor.fold_fn_decl(_i . decl),
2061 }
2062}
David Tolnayd60cfec2017-12-29 00:21:38 -05002063# [ cfg ( feature = "full" ) ]
2064pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2065 MethodTurbofish {
2066 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2067 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2068 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2069 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2070 }
2071}
Nika Layzell27726662017-10-24 23:16:35 -04002072
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002073pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2074 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002075 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002076 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002077 }
2078}
2079
Nika Layzella6f46c42017-10-26 15:26:16 -04002080pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002081 use ::Mutability::*;
2082 match _i {
2083 Mutable(_binding_0, ) => {
2084 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002085 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002086 )
2087 }
2088 Immutable => { Immutable }
2089 }
2090}
2091
Nika Layzella6f46c42017-10-26 15:26:16 -04002092pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002093 use ::NestedMetaItem::*;
2094 match _i {
2095 MetaItem(_binding_0, ) => {
2096 MetaItem (
2097 _visitor.fold_meta_item(_binding_0),
2098 )
2099 }
2100 Literal(_binding_0, ) => {
2101 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002102 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002103 )
2104 }
2105 }
2106}
2107
Nika Layzellc08227a2017-12-04 16:30:17 -05002108pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2109 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002110 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002111 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002112 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002113 }
2114}
2115# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002116pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002117 use ::Pat::*;
2118 match _i {
2119 Wild(_binding_0, ) => {
2120 Wild (
2121 _visitor.fold_pat_wild(_binding_0),
2122 )
2123 }
2124 Ident(_binding_0, ) => {
2125 Ident (
2126 _visitor.fold_pat_ident(_binding_0),
2127 )
2128 }
2129 Struct(_binding_0, ) => {
2130 Struct (
2131 _visitor.fold_pat_struct(_binding_0),
2132 )
2133 }
2134 TupleStruct(_binding_0, ) => {
2135 TupleStruct (
2136 _visitor.fold_pat_tuple_struct(_binding_0),
2137 )
2138 }
2139 Path(_binding_0, ) => {
2140 Path (
2141 _visitor.fold_pat_path(_binding_0),
2142 )
2143 }
2144 Tuple(_binding_0, ) => {
2145 Tuple (
2146 _visitor.fold_pat_tuple(_binding_0),
2147 )
2148 }
2149 Box(_binding_0, ) => {
2150 Box (
2151 _visitor.fold_pat_box(_binding_0),
2152 )
2153 }
2154 Ref(_binding_0, ) => {
2155 Ref (
2156 _visitor.fold_pat_ref(_binding_0),
2157 )
2158 }
2159 Lit(_binding_0, ) => {
2160 Lit (
2161 _visitor.fold_pat_lit(_binding_0),
2162 )
2163 }
2164 Range(_binding_0, ) => {
2165 Range (
2166 _visitor.fold_pat_range(_binding_0),
2167 )
2168 }
2169 Slice(_binding_0, ) => {
2170 Slice (
2171 _visitor.fold_pat_slice(_binding_0),
2172 )
2173 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002174 Macro(_binding_0, ) => {
2175 Macro (
2176 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002177 )
2178 }
2179 }
2180}
2181# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002182pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002183 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002184 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002185 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002186 }
2187}
2188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002189pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002190 PatIdent {
2191 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002192 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002193 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002194 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002195 }
2196}
2197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002198pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002199 PatLit {
2200 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2201 }
2202}
2203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002206 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002207 path: _visitor.fold_path(_i . path),
2208 }
2209}
2210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002212 PatRange {
2213 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002214 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002215 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002216 }
2217}
2218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002219pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002220 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002221 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002222 mutbl: _visitor.fold_mutability(_i . mutbl),
2223 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002224 }
2225}
2226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002227pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002228 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002229 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002230 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002231 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002232 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002233 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002234 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002235 }
2236}
2237# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002238pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002239 PatStruct {
2240 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002241 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002242 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002243 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002244 }
2245}
2246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002247pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002248 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002249 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay41871922017-12-29 01:53:45 -05002250 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002251 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay41871922017-12-29 01:53:45 -05002252 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2253 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002254 }
2255}
2256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002257pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002258 PatTupleStruct {
2259 path: _visitor.fold_path(_i . path),
2260 pat: _visitor.fold_pat_tuple(_i . pat),
2261 }
2262}
2263# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002264pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002265 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002266 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002267 }
2268}
2269
Nika Layzella6f46c42017-10-26 15:26:16 -04002270pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002271 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002272 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002273 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2274 }
2275}
Nika Layzellc08227a2017-12-04 16:30:17 -05002276
2277pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2278 use ::PathArguments::*;
2279 match _i {
2280 None => { None }
2281 AngleBracketed(_binding_0, ) => {
2282 AngleBracketed (
2283 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2284 )
2285 }
2286 Parenthesized(_binding_0, ) => {
2287 Parenthesized (
2288 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2289 )
2290 }
2291 }
2292}
Nika Layzell27726662017-10-24 23:16:35 -04002293
Nika Layzella6f46c42017-10-26 15:26:16 -04002294pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002295 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002296 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002297 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002298 }
2299}
Nika Layzell27726662017-10-24 23:16:35 -04002300
Nika Layzella6f46c42017-10-26 15:26:16 -04002301pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002302 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002303 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002304 trait_ref: _visitor.fold_path(_i . trait_ref),
2305 }
2306}
2307
Nika Layzella6f46c42017-10-26 15:26:16 -04002308pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002309 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002310 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002311 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002312 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002313 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2314 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002315 }
2316}
2317# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002318pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002319 use ::RangeLimits::*;
2320 match _i {
2321 HalfOpen(_binding_0, ) => {
2322 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002323 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002324 )
2325 }
2326 Closed(_binding_0, ) => {
2327 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002328 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002329 )
2330 }
2331 }
2332}
David Tolnayf93b90d2017-11-11 19:21:26 -08002333
2334pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2335 use ::ReturnType::*;
2336 match _i {
2337 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002338 Type(_binding_0, _binding_1, ) => {
2339 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002340 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2341 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002342 )
2343 }
2344 }
2345}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002346
2347pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2348 _i
2349}
Nika Layzell27726662017-10-24 23:16:35 -04002350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002351pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002352 use ::Stmt::*;
2353 match _i {
2354 Local(_binding_0, ) => {
2355 Local (
2356 Box::new(_visitor.fold_local(* _binding_0)),
2357 )
2358 }
2359 Item(_binding_0, ) => {
2360 Item (
2361 Box::new(_visitor.fold_item(* _binding_0)),
2362 )
2363 }
2364 Expr(_binding_0, ) => {
2365 Expr (
2366 Box::new(_visitor.fold_expr(* _binding_0)),
2367 )
2368 }
2369 Semi(_binding_0, _binding_1, ) => {
2370 Semi (
2371 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002372 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002373 )
2374 }
Nika Layzell27726662017-10-24 23:16:35 -04002375 }
2376}
2377
Nika Layzella6f46c42017-10-26 15:26:16 -04002378pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002379 use ::TraitBoundModifier::*;
2380 match _i {
2381 None => { None }
2382 Maybe(_binding_0, ) => {
2383 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002384 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002385 )
2386 }
2387 }
2388}
2389# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002390pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002391 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002392 match _i {
2393 Const(_binding_0, ) => {
2394 Const (
2395 _visitor.fold_trait_item_const(_binding_0),
2396 )
2397 }
2398 Method(_binding_0, ) => {
2399 Method (
2400 _visitor.fold_trait_item_method(_binding_0),
2401 )
2402 }
2403 Type(_binding_0, ) => {
2404 Type (
2405 _visitor.fold_trait_item_type(_binding_0),
2406 )
2407 }
2408 Macro(_binding_0, ) => {
2409 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002410 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002411 )
2412 }
2413 }
2414}
2415# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002416pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2417 TraitItemConst {
2418 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002419 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002420 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002422 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002423 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002424 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002425 _visitor.fold_expr(( it ) . 1),
2426 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002427 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002428 }
2429}
2430# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002431pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2432 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002433 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002434 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002435 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002436 }
2437}
2438# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002439pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002440 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002441 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002442 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002443 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002444 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002445 }
2446}
2447# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002448pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002449 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002450 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002451 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002452 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002453 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002454 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002456 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002457 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002458 _visitor.fold_type(( it ) . 1),
2459 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002460 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002461 }
2462}
2463
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002464pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2465 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002466 match _i {
2467 Slice(_binding_0, ) => {
2468 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002469 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002470 )
2471 }
2472 Array(_binding_0, ) => {
2473 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002474 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002475 )
2476 }
2477 Ptr(_binding_0, ) => {
2478 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002480 )
2481 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002482 Reference(_binding_0, ) => {
2483 Reference (
2484 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002485 )
2486 }
2487 BareFn(_binding_0, ) => {
2488 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002489 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002490 )
2491 }
2492 Never(_binding_0, ) => {
2493 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002494 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002495 )
2496 }
David Tolnay05362582017-12-26 01:33:57 -05002497 Tuple(_binding_0, ) => {
2498 Tuple (
2499 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002500 )
2501 }
2502 Path(_binding_0, ) => {
2503 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002504 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002505 )
2506 }
2507 TraitObject(_binding_0, ) => {
2508 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002510 )
2511 }
2512 ImplTrait(_binding_0, ) => {
2513 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002514 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002515 )
2516 }
2517 Paren(_binding_0, ) => {
2518 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002520 )
2521 }
2522 Group(_binding_0, ) => {
2523 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002524 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002525 )
2526 }
2527 Infer(_binding_0, ) => {
2528 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002529 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002530 )
2531 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002532 Macro(_binding_0, ) => {
2533 Macro (
2534 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002535 )
2536 }
2537 }
2538}
2539
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002540pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2541 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002542 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002543 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002544 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002545 amt: _visitor.fold_expr(_i . amt),
2546 }
2547}
2548
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002549pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2550 TypeBareFn {
2551 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002552 }
2553}
2554
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002555pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2556 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002557 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002558 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002559 ty: _visitor.fold_type(_i . ty),
2560 }
2561}
2562
2563pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2564 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002565 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002566 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002567 }
2568}
2569
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2571 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002572 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002573 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002574 }
2575}
2576
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002577pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2578 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002579 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002580 }
2581}
2582
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002583pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2584 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002585 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 }
2587}
2588
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002589pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2590 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002591 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002592 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002593 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002594 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002597 }
2598}
2599
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002600pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2601 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002602 match _i {
2603 Trait(_binding_0, _binding_1, ) => {
2604 Trait (
2605 _visitor.fold_poly_trait_ref(_binding_0),
2606 _visitor.fold_trait_bound_modifier(_binding_1),
2607 )
2608 }
2609 Region(_binding_0, ) => {
2610 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002611 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002612 )
2613 }
2614 }
2615}
2616
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002617pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2618 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002619 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002620 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002621 }
2622}
2623
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002624pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2625 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002626 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002627 path: _visitor.fold_path(_i . path),
2628 }
2629}
2630
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002631pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2632 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002633 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2634 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002635 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002636 }
2637}
2638
David Tolnay0a89b4d2017-11-13 00:55:45 -08002639pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2640 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002641 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002642 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002643 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002644 }
2645}
2646
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002647pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2648 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002649 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002650 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002651 }
2652}
2653
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002654pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2655 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002656 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002657 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002658 }
2659}
2660
David Tolnay05362582017-12-26 01:33:57 -05002661pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2662 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002663 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002664 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002665 }
2666}
2667
Nika Layzella6f46c42017-10-26 15:26:16 -04002668pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002669 use ::UnOp::*;
2670 match _i {
2671 Deref(_binding_0, ) => {
2672 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002673 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002674 )
2675 }
2676 Not(_binding_0, ) => {
2677 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002678 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002679 )
2680 }
2681 Neg(_binding_0, ) => {
2682 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002683 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002684 )
2685 }
2686 }
2687}
2688
Nika Layzella6f46c42017-10-26 15:26:16 -04002689pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002690 use ::Unsafety::*;
2691 match _i {
2692 Unsafe(_binding_0, ) => {
2693 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002694 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002695 )
2696 }
2697 Normal => { Normal }
2698 }
2699}
David Tolnay5f332a92017-12-26 00:42:45 -05002700# [ cfg ( feature = "full" ) ]
2701pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2702 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002703 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002704 }
2705}
2706# [ cfg ( feature = "full" ) ]
2707pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2708 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002709 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002710 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2711 }
2712}
2713# [ cfg ( feature = "full" ) ]
2714pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2715 UsePath {
2716 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002717 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002718 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002719 _visitor.fold_ident(( it ) . 1),
2720 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002721 }
2722}
2723# [ cfg ( feature = "full" ) ]
2724pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2725 use ::UseTree::*;
2726 match _i {
2727 Path(_binding_0, ) => {
2728 Path (
2729 _visitor.fold_use_path(_binding_0),
2730 )
2731 }
2732 Glob(_binding_0, ) => {
2733 Glob (
2734 _visitor.fold_use_glob(_binding_0),
2735 )
2736 }
2737 List(_binding_0, ) => {
2738 List (
2739 _visitor.fold_use_list(_binding_0),
2740 )
2741 }
2742 }
2743}
Nika Layzell27726662017-10-24 23:16:35 -04002744
Nika Layzella6f46c42017-10-26 15:26:16 -04002745pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002746 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002747 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002748 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002749 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002750 discriminant: (_i . discriminant).map(|it| { (
2751 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2752 _visitor.fold_expr(( it ) . 1),
2753 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002754 }
2755}
2756
Nika Layzella6f46c42017-10-26 15:26:16 -04002757pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002758 use ::VariantData::*;
2759 match _i {
2760 Struct(_binding_0, _binding_1, ) => {
2761 Struct (
2762 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002763 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002764 )
2765 }
2766 Tuple(_binding_0, _binding_1, ) => {
2767 Tuple (
2768 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002769 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002770 )
2771 }
2772 Unit => { Unit }
2773 }
2774}
Nika Layzell27726662017-10-24 23:16:35 -04002775
Nika Layzella6f46c42017-10-26 15:26:16 -04002776pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002777 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002778 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002779 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002780 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002781 }
2782}
2783
Nika Layzella6f46c42017-10-26 15:26:16 -04002784pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002785 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002786 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002787 }
2788}
2789
Nika Layzella6f46c42017-10-26 15:26:16 -04002790pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002791 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002792 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002793 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002795 path: Box::new(_visitor.fold_path(* _i . path)),
2796 }
2797}
2798
Nika Layzella6f46c42017-10-26 15:26:16 -04002799pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002800 use ::Visibility::*;
2801 match _i {
2802 Public(_binding_0, ) => {
2803 Public (
2804 _visitor.fold_vis_public(_binding_0),
2805 )
2806 }
2807 Crate(_binding_0, ) => {
2808 Crate (
2809 _visitor.fold_vis_crate(_binding_0),
2810 )
2811 }
2812 Restricted(_binding_0, ) => {
2813 Restricted (
2814 _visitor.fold_vis_restricted(_binding_0),
2815 )
2816 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002817 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002818 }
2819}
2820
Nika Layzella6f46c42017-10-26 15:26:16 -04002821pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002822 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002823 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002824 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002825 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002826 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002827 }
2828}
2829
Nika Layzella6f46c42017-10-26 15:26:16 -04002830pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002831 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002832 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002833 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2834 }
2835}
2836
Nika Layzella6f46c42017-10-26 15:26:16 -04002837pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002838 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002839 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002840 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002841 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002842 }
2843}
2844
Nika Layzella6f46c42017-10-26 15:26:16 -04002845pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002846 use ::WherePredicate::*;
2847 match _i {
2848 BoundPredicate(_binding_0, ) => {
2849 BoundPredicate (
2850 _visitor.fold_where_bound_predicate(_binding_0),
2851 )
2852 }
2853 RegionPredicate(_binding_0, ) => {
2854 RegionPredicate (
2855 _visitor.fold_where_region_predicate(_binding_0),
2856 )
2857 }
2858 EqPredicate(_binding_0, ) => {
2859 EqPredicate (
2860 _visitor.fold_where_eq_predicate(_binding_0),
2861 )
2862 }
2863 }
2864}
2865
Nika Layzella6f46c42017-10-26 15:26:16 -04002866pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002867 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002868 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002869 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002870 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002871 }
2872}
2873