blob: 4ca3dde089bc49ff8a141cd5cdf4fb52a5b5f7ed [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)),
1392 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001393 }
1394}
1395# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001396pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001397 FieldValue {
David Tolnay85b69a42017-12-27 20:43:10 -05001398 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1399 member: _visitor.fold_member(_i . member),
David Tolnaycc0f0372017-12-28 19:11:04 -05001400 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001401 expr: _visitor.fold_expr(_i . expr),
1402 is_shorthand: _i . is_shorthand,
Nika Layzell27726662017-10-24 23:16:35 -04001403 }
1404}
1405# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001406pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001407 File {
1408 shebang: _i . shebang,
1409 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1410 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1411 }
1412}
1413# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001414pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001415 use ::FnArg::*;
1416 match _i {
1417 SelfRef(_binding_0, ) => {
1418 SelfRef (
1419 _visitor.fold_arg_self_ref(_binding_0),
1420 )
1421 }
1422 SelfValue(_binding_0, ) => {
1423 SelfValue (
1424 _visitor.fold_arg_self(_binding_0),
1425 )
1426 }
1427 Captured(_binding_0, ) => {
1428 Captured (
1429 _visitor.fold_arg_captured(_binding_0),
1430 )
1431 }
David Tolnay80ed55f2017-12-27 22:54:40 -05001432 Inferred(_binding_0, ) => {
1433 Inferred (
1434 _visitor.fold_pat(_binding_0),
1435 )
1436 }
Nika Layzell27726662017-10-24 23:16:35 -04001437 Ignored(_binding_0, ) => {
1438 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001439 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001440 )
1441 }
1442 }
1443}
1444# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001445pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001446 FnDecl {
David Tolnaycc0f0372017-12-28 19:11:04 -05001447 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001448 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001449 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001450 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001451 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001452 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001453 }
1454}
1455# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001456pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001457 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001458 match _i {
1459 Fn(_binding_0, ) => {
1460 Fn (
1461 _visitor.fold_foreign_item_fn(_binding_0),
1462 )
1463 }
1464 Static(_binding_0, ) => {
1465 Static (
1466 _visitor.fold_foreign_item_static(_binding_0),
1467 )
1468 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001469 Type(_binding_0, ) => {
1470 Type (
1471 _visitor.fold_foreign_item_type(_binding_0),
1472 )
1473 }
Nika Layzell27726662017-10-24 23:16:35 -04001474 }
1475}
1476# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001477pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1478 ForeignItemFn {
1479 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1480 vis: _visitor.fold_visibility(_i . vis),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001481 ident: _visitor.fold_ident(_i . ident),
David Tolnay8894f602017-11-11 12:11:04 -08001482 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001483 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay8894f602017-11-11 12:11:04 -08001484 }
1485}
1486# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001487pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001488 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001489 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1490 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001491 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001492 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001493 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001494 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001495 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001496 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001497 }
1498}
David Tolnay199bcbb2017-11-12 10:33:52 -08001499# [ cfg ( feature = "full" ) ]
1500pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1501 ForeignItemType {
1502 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1503 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001504 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001505 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001506 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay199bcbb2017-11-12 10:33:52 -08001507 }
1508}
Nika Layzell27726662017-10-24 23:16:35 -04001509
Nika Layzellc08227a2017-12-04 16:30:17 -05001510pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1511 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001512 match _i {
1513 Lifetime(_binding_0, ) => {
1514 Lifetime (
David Tolnay4ba63a02017-12-28 15:53:05 -05001515 _visitor.fold_lifetime(_binding_0),
Nika Layzell357885a2017-12-04 15:47:07 -05001516 )
1517 }
1518 Type(_binding_0, ) => {
1519 Type (
1520 _visitor.fold_type(_binding_0),
1521 )
1522 }
1523 TypeBinding(_binding_0, ) => {
1524 TypeBinding (
1525 _visitor.fold_type_binding(_binding_0),
1526 )
1527 }
Nika Layzellc680e612017-12-04 19:07:20 -05001528 Const(_binding_0, ) => {
1529 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001530 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001531 )
1532 }
Nika Layzell357885a2017-12-04 15:47:07 -05001533 }
1534}
David Tolnayd60cfec2017-12-29 00:21:38 -05001535# [ cfg ( feature = "full" ) ]
1536pub fn fold_generic_method_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1537 use ::GenericMethodArgument::*;
1538 match _i {
1539 Type(_binding_0, ) => {
1540 Type (
1541 _visitor.fold_type(_binding_0),
1542 )
1543 }
1544 Const(_binding_0, ) => {
1545 Const (
1546 _visitor.fold_expr(_binding_0),
1547 )
1548 }
1549 }
1550}
Nika Layzell357885a2017-12-04 15:47:07 -05001551
David Tolnayc2f1aba2017-11-12 20:29:22 -08001552pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1553 use ::GenericParam::*;
1554 match _i {
1555 Lifetime(_binding_0, ) => {
1556 Lifetime (
1557 _visitor.fold_lifetime_def(_binding_0),
1558 )
1559 }
1560 Type(_binding_0, ) => {
1561 Type (
1562 _visitor.fold_type_param(_binding_0),
1563 )
1564 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001565 Const(_binding_0, ) => {
1566 Const (
1567 _visitor.fold_const_param(_binding_0),
1568 )
1569 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001570 }
1571}
1572
Nika Layzella6f46c42017-10-26 15:26:16 -04001573pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001574 Generics {
David Tolnaycc0f0372017-12-28 19:11:04 -05001575 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc2f1aba2017-11-12 20:29:22 -08001576 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001577 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayac997dd2017-12-27 23:18:22 -05001578 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001579 }
1580}
1581# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001582pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001583 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001584 match _i {
1585 Const(_binding_0, ) => {
1586 Const (
1587 _visitor.fold_impl_item_const(_binding_0),
1588 )
1589 }
1590 Method(_binding_0, ) => {
1591 Method (
1592 _visitor.fold_impl_item_method(_binding_0),
1593 )
1594 }
1595 Type(_binding_0, ) => {
1596 Type (
1597 _visitor.fold_impl_item_type(_binding_0),
1598 )
1599 }
1600 Macro(_binding_0, ) => {
1601 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001602 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001603 )
1604 }
1605 }
1606}
1607# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001608pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1609 ImplItemConst {
1610 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1611 vis: _visitor.fold_visibility(_i . vis),
1612 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001613 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001614 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001615 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001616 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001617 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001618 expr: _visitor.fold_expr(_i . expr),
David Tolnaycc0f0372017-12-28 19:11:04 -05001619 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnay857628c2017-11-11 12:25:31 -08001620 }
1621}
1622# [ cfg ( feature = "full" ) ]
1623pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1624 ImplItemMacro {
1625 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1626 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001627 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay857628c2017-11-11 12:25:31 -08001628 }
1629}
1630# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001631pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001632 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001633 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001634 vis: _visitor.fold_visibility(_i . vis),
1635 defaultness: _visitor.fold_defaultness(_i . defaultness),
1636 sig: _visitor.fold_method_sig(_i . sig),
1637 block: _visitor.fold_block(_i . block),
1638 }
1639}
1640# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001641pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001642 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001643 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001644 vis: _visitor.fold_visibility(_i . vis),
1645 defaultness: _visitor.fold_defaultness(_i . defaultness),
David Tolnaycc0f0372017-12-28 19:11:04 -05001646 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001647 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05001648 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001649 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001650 ty: _visitor.fold_type(_i . ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05001651 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001652 }
1653}
1654# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001655pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001656 use ::ImplPolarity::*;
1657 match _i {
1658 Positive => { Positive }
1659 Negative(_binding_0, ) => {
1660 Negative (
David Tolnaycc0f0372017-12-28 19:11:04 -05001661 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001662 )
1663 }
1664 }
1665}
David Tolnay14982012017-12-29 00:49:51 -05001666
David Tolnay85b69a42017-12-27 20:43:10 -05001667pub fn fold_index<V: Folder + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1668 Index {
1669 index: _i . index,
1670 span: _visitor.fold_span(_i . span),
1671 }
1672}
1673# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001674pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001675 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001676 match _i {
1677 ExternCrate(_binding_0, ) => {
1678 ExternCrate (
1679 _visitor.fold_item_extern_crate(_binding_0),
1680 )
1681 }
1682 Use(_binding_0, ) => {
1683 Use (
1684 _visitor.fold_item_use(_binding_0),
1685 )
1686 }
1687 Static(_binding_0, ) => {
1688 Static (
1689 _visitor.fold_item_static(_binding_0),
1690 )
1691 }
1692 Const(_binding_0, ) => {
1693 Const (
1694 _visitor.fold_item_const(_binding_0),
1695 )
1696 }
1697 Fn(_binding_0, ) => {
1698 Fn (
1699 _visitor.fold_item_fn(_binding_0),
1700 )
1701 }
1702 Mod(_binding_0, ) => {
1703 Mod (
1704 _visitor.fold_item_mod(_binding_0),
1705 )
1706 }
1707 ForeignMod(_binding_0, ) => {
1708 ForeignMod (
1709 _visitor.fold_item_foreign_mod(_binding_0),
1710 )
1711 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001712 Type(_binding_0, ) => {
1713 Type (
1714 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001715 )
1716 }
1717 Enum(_binding_0, ) => {
1718 Enum (
1719 _visitor.fold_item_enum(_binding_0),
1720 )
1721 }
1722 Struct(_binding_0, ) => {
1723 Struct (
1724 _visitor.fold_item_struct(_binding_0),
1725 )
1726 }
1727 Union(_binding_0, ) => {
1728 Union (
1729 _visitor.fold_item_union(_binding_0),
1730 )
1731 }
1732 Trait(_binding_0, ) => {
1733 Trait (
1734 _visitor.fold_item_trait(_binding_0),
1735 )
1736 }
1737 DefaultImpl(_binding_0, ) => {
1738 DefaultImpl (
1739 _visitor.fold_item_default_impl(_binding_0),
1740 )
1741 }
1742 Impl(_binding_0, ) => {
1743 Impl (
1744 _visitor.fold_item_impl(_binding_0),
1745 )
1746 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001747 Macro(_binding_0, ) => {
1748 Macro (
1749 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001750 )
1751 }
David Tolnay500d8322017-12-18 00:32:51 -08001752 Macro2(_binding_0, ) => {
1753 Macro2 (
1754 _visitor.fold_item_macro2(_binding_0),
1755 )
1756 }
Nika Layzell27726662017-10-24 23:16:35 -04001757 }
1758}
1759# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001760pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1761 ItemConst {
1762 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1763 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001764 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001765 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001766 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001767 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001768 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001769 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001770 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001771 }
1772}
1773# [ cfg ( feature = "full" ) ]
1774pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1775 ItemDefaultImpl {
1776 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1777 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001778 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001779 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001780 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1781 dot2_token: Token ! [ .. ](tokens_helper(_visitor, &(_i . dot2_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001782 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001783 }
1784}
1785# [ cfg ( feature = "full" ) ]
1786pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1787 ItemEnum {
1788 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1789 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001790 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001791 ident: _visitor.fold_ident(_i . ident),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001792 generics: _visitor.fold_generics(_i . generics),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001793 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1795 }
1796}
1797# [ cfg ( feature = "full" ) ]
1798pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1799 ItemExternCrate {
1800 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1801 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001802 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1803 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001804 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001805 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05001806 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001807 _visitor.fold_ident(( it ) . 1),
1808 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001809 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001810 }
1811}
1812# [ cfg ( feature = "full" ) ]
1813pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1814 ItemFn {
1815 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1816 vis: _visitor.fold_visibility(_i . vis),
1817 constness: _visitor.fold_constness(_i . constness),
1818 unsafety: _visitor.fold_unsafety(_i . unsafety),
1819 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001820 ident: _visitor.fold_ident(_i . ident),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001821 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001822 block: Box::new(_visitor.fold_block(* _i . block)),
1823 }
1824}
1825# [ cfg ( feature = "full" ) ]
1826pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1827 ItemForeignMod {
1828 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1829 abi: _visitor.fold_abi(_i . abi),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001830 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001831 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1832 }
1833}
1834# [ cfg ( feature = "full" ) ]
1835pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1836 ItemImpl {
1837 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1838 defaultness: _visitor.fold_defaultness(_i . defaultness),
1839 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001840 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001841 generics: _visitor.fold_generics(_i . generics),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001842 trait_: (_i . trait_).map(|it| { (
1843 _visitor.fold_impl_polarity(( it ) . 0),
1844 _visitor.fold_path(( it ) . 1),
David Tolnaycc0f0372017-12-28 19:11:04 -05001845 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001846 ) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001847 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001848 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1850 }
1851}
1852# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001853pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1854 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001855 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001856 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08001857 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05001858 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001859 }
1860}
1861# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001862pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1863 ItemMacro2 {
1864 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1865 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001866 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001867 ident: _visitor.fold_ident(_i . ident),
David Tolnay500d8322017-12-18 00:32:51 -08001868 args: _i . args,
1869 body: _i . body,
1870 }
1871}
1872# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001873pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001874 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001875 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001876 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001877 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001878 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001879 content: (_i . content).map(|it| { (
David Tolnay1e01f9c2017-12-28 20:16:19 -05001880 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05001881 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1882 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05001883 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001884 }
1885}
1886# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001888 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001890 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001891 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001892 mutbl: _visitor.fold_mutability(_i . mutbl),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001893 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05001894 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001895 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001896 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001897 expr: Box::new(_visitor.fold_expr(* _i . expr)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001898 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001899 }
1900}
1901# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001902pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001903 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001904 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001905 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001906 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001907 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001908 generics: _visitor.fold_generics(_i . generics),
1909 data: _visitor.fold_variant_data(_i . data),
David Tolnaycc0f0372017-12-28 19:11:04 -05001910 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001911 }
1912}
1913# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001914pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001915 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001916 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001917 vis: _visitor.fold_visibility(_i . vis),
1918 unsafety: _visitor.fold_unsafety(_i . unsafety),
David Tolnaycc0f0372017-12-28 19:11:04 -05001919 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1920 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001921 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001922 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001923 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001924 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05001925 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001926 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1927 }
1928}
1929# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001930pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1931 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001932 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001933 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001934 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001935 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001936 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05001937 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001938 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05001939 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001940 }
1941}
1942# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001943pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001944 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001945 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001946 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001947 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05001948 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04001949 generics: _visitor.fold_generics(_i . generics),
1950 data: _visitor.fold_variant_data(_i . data),
1951 }
1952}
1953# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001954pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001955 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001956 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001957 vis: _visitor.fold_visibility(_i . vis),
David Tolnaycc0f0372017-12-28 19:11:04 -05001958 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1959 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay5f332a92017-12-26 00:42:45 -05001960 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1961 tree: _visitor.fold_use_tree(_i . tree),
David Tolnaycc0f0372017-12-28 19:11:04 -05001962 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001963 }
1964}
1965
Nika Layzella6f46c42017-10-26 15:26:16 -04001966pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001967 LifetimeDef {
1968 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001969 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05001970 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05001971 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1972 }
1973}
1974
1975pub fn fold_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1976 Lit {
1977 value: _i . value,
1978 span: _visitor.fold_span(_i . span),
Nika Layzell27726662017-10-24 23:16:35 -04001979 }
1980}
1981# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001982pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001983 Local {
Nika Layzell27726662017-10-24 23:16:35 -04001984 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05001985 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1986 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1987 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1988 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
1989 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
1990 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1991 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04001992 }
1993}
Nika Layzell27726662017-10-24 23:16:35 -04001994
David Tolnaydecf28d2017-11-11 11:56:45 -08001995pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1996 Macro {
1997 path: _visitor.fold_path(_i . path),
David Tolnaycc0f0372017-12-28 19:11:04 -05001998 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
David Tolnaydecf28d2017-11-11 11:56:45 -08001999 tokens: _i . tokens,
2000 }
2001}
David Tolnay14982012017-12-29 00:49:51 -05002002
David Tolnay85b69a42017-12-27 20:43:10 -05002003pub fn fold_member<V: Folder + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2004 use ::Member::*;
2005 match _i {
2006 Named(_binding_0, ) => {
2007 Named (
2008 _visitor.fold_ident(_binding_0),
2009 )
2010 }
2011 Unnamed(_binding_0, ) => {
2012 Unnamed (
2013 _visitor.fold_index(_binding_0),
2014 )
2015 }
2016 }
2017}
David Tolnaydecf28d2017-11-11 11:56:45 -08002018
Nika Layzella6f46c42017-10-26 15:26:16 -04002019pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002020 use ::MetaItem::*;
2021 match _i {
2022 Term(_binding_0, ) => {
2023 Term (
Nika Layzellefb83ba2017-12-19 18:23:55 -05002024 _visitor.fold_ident(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002025 )
2026 }
2027 List(_binding_0, ) => {
2028 List (
2029 _visitor.fold_meta_item_list(_binding_0),
2030 )
2031 }
2032 NameValue(_binding_0, ) => {
2033 NameValue (
2034 _visitor.fold_meta_name_value(_binding_0),
2035 )
2036 }
2037 }
2038}
2039
Nika Layzella6f46c42017-10-26 15:26:16 -04002040pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04002041 MetaItemList {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002042 ident: _visitor.fold_ident(_i . ident),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002043 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002044 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
2045 }
2046}
2047
Nika Layzella6f46c42017-10-26 15:26:16 -04002048pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04002049 MetaNameValue {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002050 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002051 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002052 lit: _visitor.fold_lit(_i . lit),
Nika Layzell27726662017-10-24 23:16:35 -04002053 }
2054}
2055# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002056pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04002057 MethodSig {
2058 constness: _visitor.fold_constness(_i . constness),
2059 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002060 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002061 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002062 decl: _visitor.fold_fn_decl(_i . decl),
2063 }
2064}
David Tolnayd60cfec2017-12-29 00:21:38 -05002065# [ cfg ( feature = "full" ) ]
2066pub fn fold_method_turbofish<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2067 MethodTurbofish {
2068 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2069 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2070 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2071 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2072 }
2073}
Nika Layzell27726662017-10-24 23:16:35 -04002074
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002075pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
2076 MutType {
Nika Layzell27726662017-10-24 23:16:35 -04002077 mutability: _visitor.fold_mutability(_i . mutability),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002078 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04002079 }
2080}
2081
Nika Layzella6f46c42017-10-26 15:26:16 -04002082pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002083 use ::Mutability::*;
2084 match _i {
2085 Mutable(_binding_0, ) => {
2086 Mutable (
David Tolnaycc0f0372017-12-28 19:11:04 -05002087 Token ! [ mut ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002088 )
2089 }
2090 Immutable => { Immutable }
2091 }
2092}
2093
Nika Layzella6f46c42017-10-26 15:26:16 -04002094pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002095 use ::NestedMetaItem::*;
2096 match _i {
2097 MetaItem(_binding_0, ) => {
2098 MetaItem (
2099 _visitor.fold_meta_item(_binding_0),
2100 )
2101 }
2102 Literal(_binding_0, ) => {
2103 Literal (
David Tolnay4ba63a02017-12-28 15:53:05 -05002104 _visitor.fold_lit(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002105 )
2106 }
2107 }
2108}
2109
Nika Layzellc08227a2017-12-04 16:30:17 -05002110pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2111 ParenthesizedGenericArguments {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002112 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002113 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002114 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002115 }
2116}
2117# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002118pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002119 use ::Pat::*;
2120 match _i {
2121 Wild(_binding_0, ) => {
2122 Wild (
2123 _visitor.fold_pat_wild(_binding_0),
2124 )
2125 }
2126 Ident(_binding_0, ) => {
2127 Ident (
2128 _visitor.fold_pat_ident(_binding_0),
2129 )
2130 }
2131 Struct(_binding_0, ) => {
2132 Struct (
2133 _visitor.fold_pat_struct(_binding_0),
2134 )
2135 }
2136 TupleStruct(_binding_0, ) => {
2137 TupleStruct (
2138 _visitor.fold_pat_tuple_struct(_binding_0),
2139 )
2140 }
2141 Path(_binding_0, ) => {
2142 Path (
2143 _visitor.fold_pat_path(_binding_0),
2144 )
2145 }
2146 Tuple(_binding_0, ) => {
2147 Tuple (
2148 _visitor.fold_pat_tuple(_binding_0),
2149 )
2150 }
2151 Box(_binding_0, ) => {
2152 Box (
2153 _visitor.fold_pat_box(_binding_0),
2154 )
2155 }
2156 Ref(_binding_0, ) => {
2157 Ref (
2158 _visitor.fold_pat_ref(_binding_0),
2159 )
2160 }
2161 Lit(_binding_0, ) => {
2162 Lit (
2163 _visitor.fold_pat_lit(_binding_0),
2164 )
2165 }
2166 Range(_binding_0, ) => {
2167 Range (
2168 _visitor.fold_pat_range(_binding_0),
2169 )
2170 }
2171 Slice(_binding_0, ) => {
2172 Slice (
2173 _visitor.fold_pat_slice(_binding_0),
2174 )
2175 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002176 Macro(_binding_0, ) => {
2177 Macro (
2178 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002179 )
2180 }
2181 }
2182}
2183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002184pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002185 PatBox {
David Tolnaycc0f0372017-12-28 19:11:04 -05002186 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002187 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002188 }
2189}
2190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002191pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002192 PatIdent {
2193 mode: _visitor.fold_binding_mode(_i . mode),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002194 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002195 at_token: (_i . at_token).map(|it| { Token ! [ @ ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002196 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002197 }
2198}
2199# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002200pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002201 PatLit {
2202 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2203 }
2204}
2205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002206pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002207 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002208 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002209 path: _visitor.fold_path(_i . path),
2210 }
2211}
2212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002213pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002214 PatRange {
2215 lo: Box::new(_visitor.fold_expr(* _i . lo)),
Nika Layzell27726662017-10-24 23:16:35 -04002216 limits: _visitor.fold_range_limits(_i . limits),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002217 hi: Box::new(_visitor.fold_expr(* _i . hi)),
Nika Layzell27726662017-10-24 23:16:35 -04002218 }
2219}
2220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002221pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002222 PatRef {
David Tolnaycc0f0372017-12-28 19:11:04 -05002223 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002224 mutbl: _visitor.fold_mutability(_i . mutbl),
2225 pat: Box::new(_visitor.fold_pat(* _i . pat)),
Nika Layzell27726662017-10-24 23:16:35 -04002226 }
2227}
2228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002229pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002230 PatSlice {
David Tolnay4a3f59a2017-12-28 21:21:12 -05002231 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002232 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002233 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002234 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002235 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2236 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002237 }
2238}
2239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002240pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002241 PatStruct {
2242 path: _visitor.fold_path(_i . path),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002243 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002244 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002245 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002246 }
2247}
2248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002250 PatTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002251 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002252 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002253 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002254 dots_pos: _i . dots_pos,
2255 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002256 }
2257}
2258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002259pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002260 PatTupleStruct {
2261 path: _visitor.fold_path(_i . path),
2262 pat: _visitor.fold_pat_tuple(_i . pat),
2263 }
2264}
2265# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002266pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002267 PatWild {
David Tolnaycc0f0372017-12-28 19:11:04 -05002268 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002269 }
2270}
2271
Nika Layzella6f46c42017-10-26 15:26:16 -04002272pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002273 Path {
David Tolnaycc0f0372017-12-28 19:11:04 -05002274 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002275 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2276 }
2277}
Nika Layzellc08227a2017-12-04 16:30:17 -05002278
2279pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2280 use ::PathArguments::*;
2281 match _i {
2282 None => { None }
2283 AngleBracketed(_binding_0, ) => {
2284 AngleBracketed (
2285 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2286 )
2287 }
2288 Parenthesized(_binding_0, ) => {
2289 Parenthesized (
2290 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2291 )
2292 }
2293 }
2294}
Nika Layzell27726662017-10-24 23:16:35 -04002295
Nika Layzella6f46c42017-10-26 15:26:16 -04002296pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002297 PathSegment {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002298 ident: _visitor.fold_ident(_i . ident),
Nika Layzellc08227a2017-12-04 16:30:17 -05002299 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002300 }
2301}
Nika Layzell27726662017-10-24 23:16:35 -04002302
Nika Layzella6f46c42017-10-26 15:26:16 -04002303pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002304 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002305 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002306 trait_ref: _visitor.fold_path(_i . trait_ref),
2307 }
2308}
2309
Nika Layzella6f46c42017-10-26 15:26:16 -04002310pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002311 QSelf {
David Tolnaycc0f0372017-12-28 19:11:04 -05002312 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002313 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002314 position: _i . position,
David Tolnaycc0f0372017-12-28 19:11:04 -05002315 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2316 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002317 }
2318}
2319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002320pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002321 use ::RangeLimits::*;
2322 match _i {
2323 HalfOpen(_binding_0, ) => {
2324 HalfOpen (
David Tolnaycc0f0372017-12-28 19:11:04 -05002325 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002326 )
2327 }
2328 Closed(_binding_0, ) => {
2329 Closed (
David Tolnaycc0f0372017-12-28 19:11:04 -05002330 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002331 )
2332 }
2333 }
2334}
David Tolnayf93b90d2017-11-11 19:21:26 -08002335
2336pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2337 use ::ReturnType::*;
2338 match _i {
2339 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002340 Type(_binding_0, _binding_1, ) => {
2341 Type (
David Tolnay4a3f59a2017-12-28 21:21:12 -05002342 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2343 Box::new(_visitor.fold_type(* _binding_1)),
David Tolnayf93b90d2017-11-11 19:21:26 -08002344 )
2345 }
2346 }
2347}
Nika Layzellefb83ba2017-12-19 18:23:55 -05002348
2349pub fn fold_span<V: Folder + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2350 _i
2351}
Nika Layzell27726662017-10-24 23:16:35 -04002352# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002353pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002354 use ::Stmt::*;
2355 match _i {
2356 Local(_binding_0, ) => {
2357 Local (
2358 Box::new(_visitor.fold_local(* _binding_0)),
2359 )
2360 }
2361 Item(_binding_0, ) => {
2362 Item (
2363 Box::new(_visitor.fold_item(* _binding_0)),
2364 )
2365 }
2366 Expr(_binding_0, ) => {
2367 Expr (
2368 Box::new(_visitor.fold_expr(* _binding_0)),
2369 )
2370 }
2371 Semi(_binding_0, _binding_1, ) => {
2372 Semi (
2373 Box::new(_visitor.fold_expr(* _binding_0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002374 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002375 )
2376 }
Nika Layzell27726662017-10-24 23:16:35 -04002377 }
2378}
2379
Nika Layzella6f46c42017-10-26 15:26:16 -04002380pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002381 use ::TraitBoundModifier::*;
2382 match _i {
2383 None => { None }
2384 Maybe(_binding_0, ) => {
2385 Maybe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002386 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 }
2390}
2391# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002392pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002393 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002394 match _i {
2395 Const(_binding_0, ) => {
2396 Const (
2397 _visitor.fold_trait_item_const(_binding_0),
2398 )
2399 }
2400 Method(_binding_0, ) => {
2401 Method (
2402 _visitor.fold_trait_item_method(_binding_0),
2403 )
2404 }
2405 Type(_binding_0, ) => {
2406 Type (
2407 _visitor.fold_trait_item_type(_binding_0),
2408 )
2409 }
2410 Macro(_binding_0, ) => {
2411 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002412 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002413 )
2414 }
2415 }
2416}
2417# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002418pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2419 TraitItemConst {
2420 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002421 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002422 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002423 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 ty: _visitor.fold_type(_i . ty),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002425 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002426 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002427 _visitor.fold_expr(( it ) . 1),
2428 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002429 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
David Tolnayda705bd2017-11-10 21:58:05 -08002430 }
2431}
2432# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002433pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2434 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002435 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002436 mac: _visitor.fold_macro(_i . mac),
David Tolnaycc0f0372017-12-28 19:11:04 -05002437 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayda705bd2017-11-10 21:58:05 -08002438 }
2439}
2440# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002441pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002442 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002443 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002444 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002445 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002446 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002447 }
2448}
2449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002450pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002451 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002452 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002453 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002454 ident: _visitor.fold_ident(_i . ident),
Nika Layzell591528a2017-12-05 12:47:37 -05002455 generics: _visitor.fold_generics(_i . generics),
David Tolnaycc0f0372017-12-28 19:11:04 -05002456 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002457 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002458 default: (_i . default).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002459 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002460 _visitor.fold_type(( it ) . 1),
2461 ) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002462 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002463 }
2464}
2465
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2467 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002468 match _i {
2469 Slice(_binding_0, ) => {
2470 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002471 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002472 )
2473 }
2474 Array(_binding_0, ) => {
2475 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002476 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002477 )
2478 }
2479 Ptr(_binding_0, ) => {
2480 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002481 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002482 )
2483 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002484 Reference(_binding_0, ) => {
2485 Reference (
2486 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002487 )
2488 }
2489 BareFn(_binding_0, ) => {
2490 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002491 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002492 )
2493 }
2494 Never(_binding_0, ) => {
2495 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002497 )
2498 }
David Tolnay05362582017-12-26 01:33:57 -05002499 Tuple(_binding_0, ) => {
2500 Tuple (
2501 _visitor.fold_type_tuple(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002502 )
2503 }
2504 Path(_binding_0, ) => {
2505 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002506 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002507 )
2508 }
2509 TraitObject(_binding_0, ) => {
2510 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002511 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002512 )
2513 }
2514 ImplTrait(_binding_0, ) => {
2515 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002517 )
2518 }
2519 Paren(_binding_0, ) => {
2520 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002521 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002522 )
2523 }
2524 Group(_binding_0, ) => {
2525 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002526 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002527 )
2528 }
2529 Infer(_binding_0, ) => {
2530 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002532 )
2533 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002534 Macro(_binding_0, ) => {
2535 Macro (
2536 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002537 )
2538 }
2539 }
2540}
2541
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2543 TypeArray {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002544 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002545 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002546 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002547 amt: _visitor.fold_expr(_i . amt),
2548 }
2549}
2550
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002551pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2552 TypeBareFn {
2553 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002554 }
2555}
2556
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002557pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2558 TypeBinding {
Nika Layzellefb83ba2017-12-19 18:23:55 -05002559 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002560 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002561 ty: _visitor.fold_type(_i . ty),
2562 }
2563}
2564
2565pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2566 TypeGroup {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002567 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002568 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002569 }
2570}
2571
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002572pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2573 TypeImplTrait {
David Tolnaycc0f0372017-12-28 19:11:04 -05002574 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002575 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002576 }
2577}
2578
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002579pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2580 TypeInfer {
David Tolnaycc0f0372017-12-28 19:11:04 -05002581 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002582 }
2583}
2584
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2586 TypeNever {
David Tolnaycc0f0372017-12-28 19:11:04 -05002587 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002588 }
2589}
2590
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002591pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2592 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002593 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzellefb83ba2017-12-19 18:23:55 -05002594 ident: _visitor.fold_ident(_i . ident),
David Tolnaycc0f0372017-12-28 19:11:04 -05002595 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002596 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
David Tolnaycc0f0372017-12-28 19:11:04 -05002597 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002598 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002599 }
2600}
2601
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002602pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2603 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002604 match _i {
2605 Trait(_binding_0, _binding_1, ) => {
2606 Trait (
2607 _visitor.fold_poly_trait_ref(_binding_0),
2608 _visitor.fold_trait_bound_modifier(_binding_1),
2609 )
2610 }
2611 Region(_binding_0, ) => {
2612 Region (
David Tolnay4ba63a02017-12-28 15:53:05 -05002613 _visitor.fold_lifetime(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002614 )
2615 }
2616 }
2617}
2618
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002619pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2620 TypeParen {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002621 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002622 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002623 }
2624}
2625
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002626pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2627 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002628 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002629 path: _visitor.fold_path(_i . path),
2630 }
2631}
2632
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002633pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2634 TypePtr {
David Tolnaycc0f0372017-12-28 19:11:04 -05002635 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2636 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002637 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002638 }
2639}
2640
David Tolnay0a89b4d2017-11-13 00:55:45 -08002641pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2642 TypeReference {
David Tolnaycc0f0372017-12-28 19:11:04 -05002643 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
David Tolnay4ba63a02017-12-28 15:53:05 -05002644 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002645 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002646 }
2647}
2648
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002649pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2650 TypeSlice {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002651 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002652 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002653 }
2654}
2655
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002656pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2657 TypeTraitObject {
David Tolnaycc0f0372017-12-28 19:11:04 -05002658 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002659 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002660 }
2661}
2662
David Tolnay05362582017-12-26 01:33:57 -05002663pub fn fold_type_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2664 TypeTuple {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002665 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002666 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002667 }
2668}
2669
Nika Layzella6f46c42017-10-26 15:26:16 -04002670pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002671 use ::UnOp::*;
2672 match _i {
2673 Deref(_binding_0, ) => {
2674 Deref (
David Tolnaycc0f0372017-12-28 19:11:04 -05002675 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002676 )
2677 }
2678 Not(_binding_0, ) => {
2679 Not (
David Tolnaycc0f0372017-12-28 19:11:04 -05002680 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002681 )
2682 }
2683 Neg(_binding_0, ) => {
2684 Neg (
David Tolnaycc0f0372017-12-28 19:11:04 -05002685 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002686 )
2687 }
2688 }
2689}
2690
Nika Layzella6f46c42017-10-26 15:26:16 -04002691pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002692 use ::Unsafety::*;
2693 match _i {
2694 Unsafe(_binding_0, ) => {
2695 Unsafe (
David Tolnaycc0f0372017-12-28 19:11:04 -05002696 Token ! [ unsafe ](tokens_helper(_visitor, &(_binding_0).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002697 )
2698 }
2699 Normal => { Normal }
2700 }
2701}
David Tolnay5f332a92017-12-26 00:42:45 -05002702# [ cfg ( feature = "full" ) ]
2703pub fn fold_use_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2704 UseGlob {
David Tolnaycc0f0372017-12-28 19:11:04 -05002705 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002706 }
2707}
2708# [ cfg ( feature = "full" ) ]
2709pub fn fold_use_list<V: Folder + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2710 UseList {
David Tolnay1e01f9c2017-12-28 20:16:19 -05002711 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
David Tolnay5f332a92017-12-26 00:42:45 -05002712 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2713 }
2714}
2715# [ cfg ( feature = "full" ) ]
2716pub fn fold_use_path<V: Folder + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2717 UsePath {
2718 ident: _visitor.fold_ident(_i . ident),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002719 rename: (_i . rename).map(|it| { (
David Tolnaycc0f0372017-12-28 19:11:04 -05002720 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
David Tolnay5c4c0b52017-12-28 17:58:54 -05002721 _visitor.fold_ident(( it ) . 1),
2722 ) }),
David Tolnay5f332a92017-12-26 00:42:45 -05002723 }
2724}
2725# [ cfg ( feature = "full" ) ]
2726pub fn fold_use_tree<V: Folder + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2727 use ::UseTree::*;
2728 match _i {
2729 Path(_binding_0, ) => {
2730 Path (
2731 _visitor.fold_use_path(_binding_0),
2732 )
2733 }
2734 Glob(_binding_0, ) => {
2735 Glob (
2736 _visitor.fold_use_glob(_binding_0),
2737 )
2738 }
2739 List(_binding_0, ) => {
2740 List (
2741 _visitor.fold_use_list(_binding_0),
2742 )
2743 }
2744 }
2745}
Nika Layzell27726662017-10-24 23:16:35 -04002746
Nika Layzella6f46c42017-10-26 15:26:16 -04002747pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002748 Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002749 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay4a3f59a2017-12-28 21:21:12 -05002750 ident: _visitor.fold_ident(_i . ident),
Nika Layzell27726662017-10-24 23:16:35 -04002751 data: _visitor.fold_variant_data(_i . data),
David Tolnaye67902a2017-12-28 22:12:00 -05002752 discriminant: (_i . discriminant).map(|it| { (
2753 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2754 _visitor.fold_expr(( it ) . 1),
2755 ) }),
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
2757}
2758
Nika Layzella6f46c42017-10-26 15:26:16 -04002759pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002760 use ::VariantData::*;
2761 match _i {
2762 Struct(_binding_0, _binding_1, ) => {
2763 Struct (
2764 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002765 Brace(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002766 )
2767 }
2768 Tuple(_binding_0, _binding_1, ) => {
2769 Tuple (
2770 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002771 Paren(tokens_helper(_visitor, &(_binding_1).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002772 )
2773 }
2774 Unit => { Unit }
2775 }
2776}
Nika Layzell27726662017-10-24 23:16:35 -04002777
Nika Layzella6f46c42017-10-26 15:26:16 -04002778pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002779 VisCrate {
David Tolnaycc0f0372017-12-28 19:11:04 -05002780 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002781 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002782 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002783 }
2784}
2785
Nika Layzella6f46c42017-10-26 15:26:16 -04002786pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002787 VisPublic {
David Tolnaycc0f0372017-12-28 19:11:04 -05002788 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002789 }
2790}
2791
Nika Layzella6f46c42017-10-26 15:26:16 -04002792pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002793 VisRestricted {
David Tolnaycc0f0372017-12-28 19:11:04 -05002794 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
David Tolnay1e01f9c2017-12-28 20:16:19 -05002795 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
David Tolnaycc0f0372017-12-28 19:11:04 -05002796 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002797 path: Box::new(_visitor.fold_path(* _i . path)),
2798 }
2799}
2800
Nika Layzella6f46c42017-10-26 15:26:16 -04002801pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002802 use ::Visibility::*;
2803 match _i {
2804 Public(_binding_0, ) => {
2805 Public (
2806 _visitor.fold_vis_public(_binding_0),
2807 )
2808 }
2809 Crate(_binding_0, ) => {
2810 Crate (
2811 _visitor.fold_vis_crate(_binding_0),
2812 )
2813 }
2814 Restricted(_binding_0, ) => {
2815 Restricted (
2816 _visitor.fold_vis_restricted(_binding_0),
2817 )
2818 }
David Tolnayfcfb9002017-12-28 22:04:29 -05002819 Inherited => { Inherited }
Nika Layzell27726662017-10-24 23:16:35 -04002820 }
2821}
2822
Nika Layzella6f46c42017-10-26 15:26:16 -04002823pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002824 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002825 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002826 bounded_ty: _visitor.fold_type(_i . bounded_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002827 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002828 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002829 }
2830}
2831
Nika Layzella6f46c42017-10-26 15:26:16 -04002832pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002833 WhereClause {
David Tolnaycc0f0372017-12-28 19:11:04 -05002834 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
Nika Layzell27726662017-10-24 23:16:35 -04002835 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2836 }
2837}
2838
Nika Layzella6f46c42017-10-26 15:26:16 -04002839pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002840 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002841 lhs_ty: _visitor.fold_type(_i . lhs_ty),
David Tolnaycc0f0372017-12-28 19:11:04 -05002842 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002843 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002844 }
2845}
2846
Nika Layzella6f46c42017-10-26 15:26:16 -04002847pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002848 use ::WherePredicate::*;
2849 match _i {
2850 BoundPredicate(_binding_0, ) => {
2851 BoundPredicate (
2852 _visitor.fold_where_bound_predicate(_binding_0),
2853 )
2854 }
2855 RegionPredicate(_binding_0, ) => {
2856 RegionPredicate (
2857 _visitor.fold_where_region_predicate(_binding_0),
2858 )
2859 }
2860 EqPredicate(_binding_0, ) => {
2861 EqPredicate (
2862 _visitor.fold_where_eq_predicate(_binding_0),
2863 )
2864 }
2865 }
2866}
2867
Nika Layzella6f46c42017-10-26 15:26:16 -04002868pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002869 WhereRegionPredicate {
David Tolnay4ba63a02017-12-28 15:53:05 -05002870 lifetime: _visitor.fold_lifetime(_i . lifetime),
David Tolnaycc0f0372017-12-28 19:11:04 -05002871 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
David Tolnay4ba63a02017-12-28 15:53:05 -05002872 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002873 }
2874}
2875