blob: 722c1a13f579b6a4b55ac4c1df6e320030b5d540 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001
2// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
3
4//! A Folder represents an AST->AST fold; it accepts an AST piece,
5//! and returns a piece of the same type.
6
7// Unreachable code is generated sometimes without the full feature.
8#![allow(unreachable_code)]
9
Nika Layzella6f46c42017-10-26 15:26:16 -040010use *;
Nika Layzell27726662017-10-24 23:16:35 -040011use synom::delimited::Delimited;
12
13trait FoldHelper {
14 type Item;
15 fn lift<F>(self, f: F) -> Self where F: FnMut(Self::Item) -> Self::Item;
16}
17
18impl<T> FoldHelper for Vec<T> {
19 type Item = T;
20 fn lift<F>(self, f: F) -> Self where F: FnMut(Self::Item) -> Self::Item {
21 self.into_iter().map(f).collect()
22 }
23}
24
25impl<T, U> FoldHelper for Delimited<T, U> {
26 type Item = T;
27 fn lift<F>(self, mut f: F) -> Self where F: FnMut(Self::Item) -> Self::Item {
28 self.into_iter().map(|elem| {
29 let (t, u) = elem.into_tuple();
30 (f(t), u)
31 }).collect::<Vec<(T, Option<U>)>>().into()
32 }
33}
34
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040035
36#[cfg(feature = "full")]
37macro_rules! full {
38 ($e:expr) => { $e }
39}
40
41#[cfg(not(feature = "full"))]
42macro_rules! full {
43 ($e:expr) => { unreachable!() }
44}
45
46
Nika Layzell27726662017-10-24 23:16:35 -040047/// AST->AST fold.
48///
49/// Each method of the Folder trait is a hook to be potentially overridden. Each
50/// method's default implementation recursively visits the substructure of the
51/// input via the `walk` functions, which perform an "identity fold", that
52/// is, they return the same structure that they are given (for example the
53/// `fold_file` method by default calls `fold::walk_file`).
54///
55/// If you want to ensure that your code handles every variant
56/// explicitly, you need to override each method. (And you also need
57/// to monitor future changes to `Folder` in case a new method with a
58/// new default implementation gets introduced.)
59pub trait Folder {
60
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
Nika Layzellc08227a2017-12-04 16:30:17 -050065fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
David Tolnayfd6bf5c2017-11-12 09:41:14 -080083fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500100
101fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_kind(&mut self, i: ExprKind) -> ExprKind { fold_expr_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_expr_tup(&mut self, i: ExprTup) -> ExprTup { fold_expr_tup(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_expr_tup_field(&mut self, i: ExprTupField) -> ExprTupField { fold_expr_tup_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500181fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800206# [ cfg ( feature = "full" ) ]
207fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208
Nika Layzellc08227a2017-12-04 16:30:17 -0500209fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500210
David Tolnayc2f1aba2017-11-12 20:29:22 -0800211fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
212
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800219fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800245fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -0800247fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800257fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
David Tolnaydecf28d2017-11-11 11:56:45 -0800269fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800279fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284
Nika Layzellc08227a2017-12-04 16:30:17 -0500285fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500312
313fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_path_glob(&mut self, i: PathGlob) -> PathGlob { fold_path_glob(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_path_list(&mut self, i: PathList) -> PathList { fold_path_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_path_list_item(&mut self, i: PathListItem) -> PathListItem { fold_path_list_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_path_simple(&mut self, i: PathSimple) -> PathSimple { fold_path_simple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800330
331fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400339fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800341fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400345fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800349fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800351fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400352
Nika Layzella6f46c42017-10-26 15:26:16 -0400353fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400354
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800355fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
356
357fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
358
359fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
360
361fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
362
363fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
364
365fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
366
367fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
368
369fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
370
371fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
372
David Tolnay0a89b4d2017-11-13 00:55:45 -0800373fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800374
375fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
376
377fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
378
379fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_view_path(&mut self, i: ViewPath) -> ViewPath { fold_view_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_vis_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400402
Nika Layzella6f46c42017-10-26 15:26:16 -0400403fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400404
Nika Layzella6f46c42017-10-26 15:26:16 -0400405fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400406
Nika Layzella6f46c42017-10-26 15:26:16 -0400407fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400408
Nika Layzella6f46c42017-10-26 15:26:16 -0400409fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400410
411}
412
413
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 {
416 extern_token: _i . extern_token,
417 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 (
426 _binding_0,
427 )
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 {
Nika Layzell27726662017-10-24 23:16:35 -0400435 turbofish: _i . turbofish,
436 lt_token: _i . lt_token,
Nika Layzellc08227a2017-12-04 16:30:17 -0500437 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400438 gt_token: _i . gt_token,
439 }
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),
445 colon_token: _i . colon_token,
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),
453 self_token: _i . self_token,
454 }
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 {
459 and_token: _i . and_token,
460 self_token: _i . self_token,
461 lifetime: _i . lifetime,
462 mutbl: _visitor.fold_mutability(_i . mutbl),
463 }
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) }),
470 if_token: _i . if_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400471 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400472 rocket_token: _i . rocket_token,
473 body: Box::new(_visitor.fold_expr(* _i . body)),
474 comma: _i . comma,
475 }
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 (
484 _binding_0,
485 )
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 {
492 style: _visitor.fold_attr_style(_i . style),
493 pound_token: _i . pound_token,
494 bracket_token: _i . bracket_token,
495 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 {
503 name: _i . name,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800504 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400505 }
506}
507
Nika Layzella6f46c42017-10-26 15:26:16 -0400508pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400509 use ::BareFnArgName::*;
510 match _i {
511 Named(_binding_0, ) => {
512 Named (
513 _binding_0,
514 )
515 }
516 Wild(_binding_0, ) => {
517 Wild (
518 _binding_0,
519 )
520 }
521 }
522}
523
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800524pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
525 BareFnType {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400526 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400527 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400528 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400529 fn_token: _i . fn_token,
530 paren_token: _i . paren_token,
531 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
532 variadic: _i . variadic,
David Tolnayf93b90d2017-11-11 19:21:26 -0800533 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400534 }
535}
536
Nika Layzella6f46c42017-10-26 15:26:16 -0400537pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400538 use ::BinOp::*;
539 match _i {
540 Add(_binding_0, ) => {
541 Add (
542 _binding_0,
543 )
544 }
545 Sub(_binding_0, ) => {
546 Sub (
547 _binding_0,
548 )
549 }
550 Mul(_binding_0, ) => {
551 Mul (
552 _binding_0,
553 )
554 }
555 Div(_binding_0, ) => {
556 Div (
557 _binding_0,
558 )
559 }
560 Rem(_binding_0, ) => {
561 Rem (
562 _binding_0,
563 )
564 }
565 And(_binding_0, ) => {
566 And (
567 _binding_0,
568 )
569 }
570 Or(_binding_0, ) => {
571 Or (
572 _binding_0,
573 )
574 }
575 BitXor(_binding_0, ) => {
576 BitXor (
577 _binding_0,
578 )
579 }
580 BitAnd(_binding_0, ) => {
581 BitAnd (
582 _binding_0,
583 )
584 }
585 BitOr(_binding_0, ) => {
586 BitOr (
587 _binding_0,
588 )
589 }
590 Shl(_binding_0, ) => {
591 Shl (
592 _binding_0,
593 )
594 }
595 Shr(_binding_0, ) => {
596 Shr (
597 _binding_0,
598 )
599 }
600 Eq(_binding_0, ) => {
601 Eq (
602 _binding_0,
603 )
604 }
605 Lt(_binding_0, ) => {
606 Lt (
607 _binding_0,
608 )
609 }
610 Le(_binding_0, ) => {
611 Le (
612 _binding_0,
613 )
614 }
615 Ne(_binding_0, ) => {
616 Ne (
617 _binding_0,
618 )
619 }
620 Ge(_binding_0, ) => {
621 Ge (
622 _binding_0,
623 )
624 }
625 Gt(_binding_0, ) => {
626 Gt (
627 _binding_0,
628 )
629 }
630 AddEq(_binding_0, ) => {
631 AddEq (
632 _binding_0,
633 )
634 }
635 SubEq(_binding_0, ) => {
636 SubEq (
637 _binding_0,
638 )
639 }
640 MulEq(_binding_0, ) => {
641 MulEq (
642 _binding_0,
643 )
644 }
645 DivEq(_binding_0, ) => {
646 DivEq (
647 _binding_0,
648 )
649 }
650 RemEq(_binding_0, ) => {
651 RemEq (
652 _binding_0,
653 )
654 }
655 BitXorEq(_binding_0, ) => {
656 BitXorEq (
657 _binding_0,
658 )
659 }
660 BitAndEq(_binding_0, ) => {
661 BitAndEq (
662 _binding_0,
663 )
664 }
665 BitOrEq(_binding_0, ) => {
666 BitOrEq (
667 _binding_0,
668 )
669 }
670 ShlEq(_binding_0, ) => {
671 ShlEq (
672 _binding_0,
673 )
674 }
675 ShrEq(_binding_0, ) => {
676 ShrEq (
677 _binding_0,
678 )
679 }
680 }
681}
682# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400683pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400684 use ::BindingMode::*;
685 match _i {
686 ByRef(_binding_0, _binding_1, ) => {
687 ByRef (
688 _binding_0,
689 _visitor.fold_mutability(_binding_1),
690 )
691 }
692 ByValue(_binding_0, ) => {
693 ByValue (
694 _visitor.fold_mutability(_binding_0),
695 )
696 }
697 }
698}
699# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400700pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400701 Block {
702 brace_token: _i . brace_token,
703 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
704 }
705}
706
Nika Layzella6f46c42017-10-26 15:26:16 -0400707pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400708 use ::Body::*;
709 match _i {
710 Enum(_binding_0, ) => {
711 Enum (
712 _visitor.fold_body_enum(_binding_0),
713 )
714 }
715 Struct(_binding_0, ) => {
716 Struct (
717 _visitor.fold_body_struct(_binding_0),
718 )
719 }
720 }
721}
722
Nika Layzella6f46c42017-10-26 15:26:16 -0400723pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400724 BodyEnum {
725 enum_token: _i . enum_token,
726 brace_token: _i . brace_token,
727 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
728 }
729}
730
Nika Layzella6f46c42017-10-26 15:26:16 -0400731pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400732 BodyStruct {
733 data: _visitor.fold_variant_data(_i . data),
734 struct_token: _i . struct_token,
735 semi_token: _i . semi_token,
736 }
737}
738
Nika Layzella6f46c42017-10-26 15:26:16 -0400739pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400740 BoundLifetimes {
741 for_token: _i . for_token,
742 lt_token: _i . lt_token,
743 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
744 gt_token: _i . gt_token,
745 }
746}
747# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400748pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400749 use ::CaptureBy::*;
750 match _i {
751 Value(_binding_0, ) => {
752 Value (
753 _binding_0,
754 )
755 }
756 Ref => { Ref }
757 }
758}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500759
760pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
761 ConstParam {
762 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
763 const_token: _i . const_token,
764 ident: _i . ident,
765 colon_token: _i . colon_token,
766 ty: _visitor.fold_type(_i . ty),
767 eq_token: _i . eq_token,
768 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
769 }
770}
Nika Layzell27726662017-10-24 23:16:35 -0400771# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400772pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400773 use ::Constness::*;
774 match _i {
775 Const(_binding_0, ) => {
776 Const (
777 _binding_0,
778 )
779 }
780 NotConst => { NotConst }
781 }
782}
783# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400784pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400785 use ::Defaultness::*;
786 match _i {
787 Default(_binding_0, ) => {
788 Default (
789 _binding_0,
790 )
791 }
792 Final => { Final }
793 }
794}
795
Nika Layzella6f46c42017-10-26 15:26:16 -0400796pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400797 DeriveInput {
798 ident: _i . ident,
799 vis: _visitor.fold_visibility(_i . vis),
800 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
801 generics: _visitor.fold_generics(_i . generics),
802 body: _visitor.fold_body(_i . body),
803 }
804}
805
Nika Layzella6f46c42017-10-26 15:26:16 -0400806pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400807 Expr {
808 node: _visitor.fold_expr_kind(_i . node),
809 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
810 }
811}
812# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400813pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400814 ExprAddrOf {
815 and_token: _i . and_token,
816 mutbl: _visitor.fold_mutability(_i . mutbl),
817 expr: Box::new(_visitor.fold_expr(* _i . expr)),
818 }
819}
820# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400821pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400822 ExprArray {
823 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
824 bracket_token: _i . bracket_token,
825 }
826}
827# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400828pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400829 ExprAssign {
830 left: Box::new(_visitor.fold_expr(* _i . left)),
831 right: Box::new(_visitor.fold_expr(* _i . right)),
832 eq_token: _i . eq_token,
833 }
834}
835# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400836pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400837 ExprAssignOp {
838 op: _visitor.fold_bin_op(_i . op),
839 left: Box::new(_visitor.fold_expr(* _i . left)),
840 right: Box::new(_visitor.fold_expr(* _i . right)),
841 }
842}
843
Nika Layzella6f46c42017-10-26 15:26:16 -0400844pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400845 ExprBinary {
846 op: _visitor.fold_bin_op(_i . op),
847 left: Box::new(_visitor.fold_expr(* _i . left)),
848 right: Box::new(_visitor.fold_expr(* _i . right)),
849 }
850}
851# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400852pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400853 ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400854 block: _visitor.fold_block(_i . block),
855 }
856}
857# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400858pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400859 ExprBox {
860 expr: Box::new(_visitor.fold_expr(* _i . expr)),
861 box_token: _i . box_token,
862 }
863}
864# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400865pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400866 ExprBreak {
867 label: _i . label,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400868 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400869 break_token: _i . break_token,
870 }
871}
872
Nika Layzella6f46c42017-10-26 15:26:16 -0400873pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400874 ExprCall {
875 func: Box::new(_visitor.fold_expr(* _i . func)),
876 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
877 paren_token: _i . paren_token,
878 }
879}
880
Nika Layzella6f46c42017-10-26 15:26:16 -0400881pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400882 ExprCast {
883 expr: Box::new(_visitor.fold_expr(* _i . expr)),
884 as_token: _i . as_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800885 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400886 }
887}
888# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400889pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400890 ExprCatch {
891 do_token: _i . do_token,
892 catch_token: _i . catch_token,
893 block: _visitor.fold_block(_i . block),
894 }
895}
896# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400897pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400898 ExprClosure {
899 capture: _visitor.fold_capture_by(_i . capture),
900 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
901 body: Box::new(_visitor.fold_expr(* _i . body)),
902 or1_token: _i . or1_token,
903 or2_token: _i . or2_token,
904 }
905}
906# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400907pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400908 ExprContinue {
909 label: _i . label,
910 continue_token: _i . continue_token,
911 }
912}
913# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400914pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400915 ExprField {
916 expr: Box::new(_visitor.fold_expr(* _i . expr)),
917 field: _i . field,
918 dot_token: _i . dot_token,
919 }
920}
921# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400922pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400923 ExprForLoop {
924 pat: Box::new(_visitor.fold_pat(* _i . pat)),
925 expr: Box::new(_visitor.fold_expr(* _i . expr)),
926 body: _visitor.fold_block(_i . body),
927 label: _i . label,
928 for_token: _i . for_token,
929 colon_token: _i . colon_token,
930 in_token: _i . in_token,
931 }
932}
933
Nika Layzella6f46c42017-10-26 15:26:16 -0400934pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400935 ExprGroup {
936 expr: Box::new(_visitor.fold_expr(* _i . expr)),
937 group_token: _i . group_token,
938 }
939}
940# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400941pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400942 ExprIf {
943 cond: Box::new(_visitor.fold_expr(* _i . cond)),
944 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400945 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400946 if_token: _i . if_token,
947 else_token: _i . else_token,
948 }
949}
950# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400951pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400952 ExprIfLet {
953 pat: Box::new(_visitor.fold_pat(* _i . pat)),
954 expr: Box::new(_visitor.fold_expr(* _i . expr)),
955 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400956 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400957 if_token: _i . if_token,
958 let_token: _i . let_token,
959 eq_token: _i . eq_token,
960 else_token: _i . else_token,
961 }
962}
963# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400964pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400965 ExprInPlace {
966 place: Box::new(_visitor.fold_expr(* _i . place)),
967 kind: _visitor.fold_in_place_kind(_i . kind),
968 value: Box::new(_visitor.fold_expr(* _i . value)),
969 }
970}
971
Nika Layzella6f46c42017-10-26 15:26:16 -0400972pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400973 ExprIndex {
974 expr: Box::new(_visitor.fold_expr(* _i . expr)),
975 index: Box::new(_visitor.fold_expr(* _i . index)),
976 bracket_token: _i . bracket_token,
977 }
978}
979
Nika Layzella6f46c42017-10-26 15:26:16 -0400980pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400981 use ::ExprKind::*;
982 match _i {
983 Box(_binding_0, ) => {
984 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400985 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400986 )
987 }
988 InPlace(_binding_0, ) => {
989 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400990 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400991 )
992 }
993 Array(_binding_0, ) => {
994 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400995 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400996 )
997 }
998 Call(_binding_0, ) => {
999 Call (
1000 _visitor.fold_expr_call(_binding_0),
1001 )
1002 }
1003 MethodCall(_binding_0, ) => {
1004 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001005 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001006 )
1007 }
1008 Tup(_binding_0, ) => {
1009 Tup (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001010 full!(_visitor.fold_expr_tup(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001011 )
1012 }
1013 Binary(_binding_0, ) => {
1014 Binary (
1015 _visitor.fold_expr_binary(_binding_0),
1016 )
1017 }
1018 Unary(_binding_0, ) => {
1019 Unary (
1020 _visitor.fold_expr_unary(_binding_0),
1021 )
1022 }
1023 Lit(_binding_0, ) => {
1024 Lit (
1025 _binding_0,
1026 )
1027 }
1028 Cast(_binding_0, ) => {
1029 Cast (
1030 _visitor.fold_expr_cast(_binding_0),
1031 )
1032 }
1033 Type(_binding_0, ) => {
1034 Type (
1035 _visitor.fold_expr_type(_binding_0),
1036 )
1037 }
1038 If(_binding_0, ) => {
1039 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001040 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001041 )
1042 }
1043 IfLet(_binding_0, ) => {
1044 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001045 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001046 )
1047 }
1048 While(_binding_0, ) => {
1049 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001050 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001051 )
1052 }
1053 WhileLet(_binding_0, ) => {
1054 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001055 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001056 )
1057 }
1058 ForLoop(_binding_0, ) => {
1059 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001060 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001061 )
1062 }
1063 Loop(_binding_0, ) => {
1064 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001065 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001066 )
1067 }
1068 Match(_binding_0, ) => {
1069 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001070 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001071 )
1072 }
1073 Closure(_binding_0, ) => {
1074 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001075 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001076 )
1077 }
Nika Layzell640832a2017-12-04 13:37:09 -05001078 Unsafe(_binding_0, ) => {
1079 Unsafe (
1080 full!(_visitor.fold_expr_unsafe(_binding_0)),
1081 )
1082 }
Nika Layzell27726662017-10-24 23:16:35 -04001083 Block(_binding_0, ) => {
1084 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001085 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001086 )
1087 }
1088 Assign(_binding_0, ) => {
1089 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001090 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001091 )
1092 }
1093 AssignOp(_binding_0, ) => {
1094 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001095 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001096 )
1097 }
1098 Field(_binding_0, ) => {
1099 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001100 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001101 )
1102 }
1103 TupField(_binding_0, ) => {
1104 TupField (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001105 full!(_visitor.fold_expr_tup_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001106 )
1107 }
1108 Index(_binding_0, ) => {
1109 Index (
1110 _visitor.fold_expr_index(_binding_0),
1111 )
1112 }
1113 Range(_binding_0, ) => {
1114 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001115 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001116 )
1117 }
1118 Path(_binding_0, ) => {
1119 Path (
1120 _visitor.fold_expr_path(_binding_0),
1121 )
1122 }
1123 AddrOf(_binding_0, ) => {
1124 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001125 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001126 )
1127 }
1128 Break(_binding_0, ) => {
1129 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001130 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001131 )
1132 }
1133 Continue(_binding_0, ) => {
1134 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001135 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001136 )
1137 }
1138 Ret(_binding_0, ) => {
1139 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001140 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001141 )
1142 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001143 Macro(_binding_0, ) => {
1144 Macro (
1145 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001146 )
1147 }
1148 Struct(_binding_0, ) => {
1149 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001150 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001151 )
1152 }
1153 Repeat(_binding_0, ) => {
1154 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001155 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001156 )
1157 }
1158 Paren(_binding_0, ) => {
1159 Paren (
1160 _visitor.fold_expr_paren(_binding_0),
1161 )
1162 }
1163 Group(_binding_0, ) => {
1164 Group (
1165 _visitor.fold_expr_group(_binding_0),
1166 )
1167 }
1168 Try(_binding_0, ) => {
1169 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001170 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001171 )
1172 }
1173 Catch(_binding_0, ) => {
1174 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001175 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001176 )
1177 }
1178 Yield(_binding_0, ) => {
1179 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001180 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001181 )
1182 }
1183 }
1184}
1185# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001186pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001187 ExprLoop {
1188 body: _visitor.fold_block(_i . body),
1189 label: _i . label,
1190 loop_token: _i . loop_token,
1191 colon_token: _i . colon_token,
1192 }
1193}
1194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001195pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001196 ExprMatch {
1197 match_token: _i . match_token,
1198 brace_token: _i . brace_token,
1199 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1200 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1201 }
1202}
1203# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001204pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001205 ExprMethodCall {
1206 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1207 method: _i . method,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001208 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001209 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1210 paren_token: _i . paren_token,
1211 dot_token: _i . dot_token,
1212 lt_token: _i . lt_token,
1213 colon2_token: _i . colon2_token,
1214 gt_token: _i . gt_token,
1215 }
1216}
1217
Nika Layzella6f46c42017-10-26 15:26:16 -04001218pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001219 ExprParen {
1220 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1221 paren_token: _i . paren_token,
1222 }
1223}
1224
Nika Layzella6f46c42017-10-26 15:26:16 -04001225pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001226 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001227 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001228 path: _visitor.fold_path(_i . path),
1229 }
1230}
1231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001232pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001233 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001234 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1235 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 limits: _visitor.fold_range_limits(_i . limits),
1237 }
1238}
1239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001240pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001241 ExprRepeat {
1242 bracket_token: _i . bracket_token,
1243 semi_token: _i . semi_token,
1244 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1245 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1246 }
1247}
1248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprRet {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001251 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001252 return_token: _i . return_token,
1253 }
1254}
1255# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001256pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001257 ExprStruct {
1258 path: _visitor.fold_path(_i . path),
1259 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001260 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001261 dot2_token: _i . dot2_token,
1262 brace_token: _i . brace_token,
1263 }
1264}
1265# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001266pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001267 ExprTry {
1268 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1269 question_token: _i . question_token,
1270 }
1271}
1272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001273pub fn fold_expr_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTup) -> ExprTup {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprTup {
1275 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1276 paren_token: _i . paren_token,
1277 lone_comma: _i . lone_comma,
1278 }
1279}
1280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001281pub fn fold_expr_tup_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTupField) -> ExprTupField {
Nika Layzell27726662017-10-24 23:16:35 -04001282 ExprTupField {
1283 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1284 field: _i . field,
1285 dot_token: _i . dot_token,
1286 }
1287}
1288
Nika Layzella6f46c42017-10-26 15:26:16 -04001289pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001290 ExprType {
1291 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1292 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001293 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001294 }
1295}
1296
Nika Layzella6f46c42017-10-26 15:26:16 -04001297pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001298 ExprUnary {
1299 op: _visitor.fold_un_op(_i . op),
1300 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1301 }
1302}
1303# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001304pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1305 ExprUnsafe {
1306 unsafe_token: _i . unsafe_token,
1307 block: _visitor.fold_block(_i . block),
1308 }
1309}
1310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001311pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001312 ExprWhile {
1313 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1314 body: _visitor.fold_block(_i . body),
1315 label: _i . label,
1316 colon_token: _i . colon_token,
1317 while_token: _i . while_token,
1318 }
1319}
1320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001321pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001322 ExprWhileLet {
1323 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1324 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1325 body: _visitor.fold_block(_i . body),
1326 label: _i . label,
1327 colon_token: _i . colon_token,
1328 while_token: _i . while_token,
1329 let_token: _i . let_token,
1330 eq_token: _i . eq_token,
1331 }
1332}
1333# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001334pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001335 ExprYield {
1336 yield_token: _i . yield_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001337 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001338 }
1339}
1340
Nika Layzella6f46c42017-10-26 15:26:16 -04001341pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001342 Field {
1343 ident: _i . ident,
1344 vis: _visitor.fold_visibility(_i . vis),
1345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001346 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001347 colon_token: _i . colon_token,
1348 }
1349}
1350# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001351pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001352 FieldPat {
1353 ident: _i . ident,
1354 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1355 is_shorthand: _i . is_shorthand,
1356 colon_token: _i . colon_token,
1357 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1358 }
1359}
1360# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001361pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001362 FieldValue {
1363 ident: _i . ident,
1364 expr: _visitor.fold_expr(_i . expr),
1365 is_shorthand: _i . is_shorthand,
1366 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1367 colon_token: _i . colon_token,
1368 }
1369}
1370# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001371pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001372 File {
1373 shebang: _i . shebang,
1374 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1375 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1376 }
1377}
1378# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001379pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001380 use ::FnArg::*;
1381 match _i {
1382 SelfRef(_binding_0, ) => {
1383 SelfRef (
1384 _visitor.fold_arg_self_ref(_binding_0),
1385 )
1386 }
1387 SelfValue(_binding_0, ) => {
1388 SelfValue (
1389 _visitor.fold_arg_self(_binding_0),
1390 )
1391 }
1392 Captured(_binding_0, ) => {
1393 Captured (
1394 _visitor.fold_arg_captured(_binding_0),
1395 )
1396 }
1397 Ignored(_binding_0, ) => {
1398 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001399 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001400 )
1401 }
1402 }
1403}
1404# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001405pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001406 FnDecl {
1407 fn_token: _i . fn_token,
1408 paren_token: _i . paren_token,
1409 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001410 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001411 generics: _visitor.fold_generics(_i . generics),
1412 variadic: _i . variadic,
1413 dot_tokens: _i . dot_tokens,
1414 }
1415}
1416# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001417pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001418 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001419 match _i {
1420 Fn(_binding_0, ) => {
1421 Fn (
1422 _visitor.fold_foreign_item_fn(_binding_0),
1423 )
1424 }
1425 Static(_binding_0, ) => {
1426 Static (
1427 _visitor.fold_foreign_item_static(_binding_0),
1428 )
1429 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001430 Type(_binding_0, ) => {
1431 Type (
1432 _visitor.fold_foreign_item_type(_binding_0),
1433 )
1434 }
Nika Layzell27726662017-10-24 23:16:35 -04001435 }
1436}
1437# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001438pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1439 ForeignItemFn {
1440 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1441 vis: _visitor.fold_visibility(_i . vis),
1442 ident: _i . ident,
1443 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1444 semi_token: _i . semi_token,
1445 }
1446}
1447# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001448pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001449 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001450 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1451 vis: _visitor.fold_visibility(_i . vis),
Nika Layzell27726662017-10-24 23:16:35 -04001452 static_token: _i . static_token,
Nika Layzell27726662017-10-24 23:16:35 -04001453 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay8894f602017-11-11 12:11:04 -08001454 ident: _i . ident,
1455 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001456 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnay8894f602017-11-11 12:11:04 -08001457 semi_token: _i . semi_token,
Nika Layzell27726662017-10-24 23:16:35 -04001458 }
1459}
David Tolnay199bcbb2017-11-12 10:33:52 -08001460# [ cfg ( feature = "full" ) ]
1461pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1462 ForeignItemType {
1463 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1464 vis: _visitor.fold_visibility(_i . vis),
1465 type_token: _i . type_token,
1466 ident: _i . ident,
1467 semi_token: _i . semi_token,
1468 }
1469}
Nika Layzell27726662017-10-24 23:16:35 -04001470
Nika Layzellc08227a2017-12-04 16:30:17 -05001471pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1472 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001473 match _i {
1474 Lifetime(_binding_0, ) => {
1475 Lifetime (
1476 _binding_0,
1477 )
1478 }
1479 Type(_binding_0, ) => {
1480 Type (
1481 _visitor.fold_type(_binding_0),
1482 )
1483 }
1484 TypeBinding(_binding_0, ) => {
1485 TypeBinding (
1486 _visitor.fold_type_binding(_binding_0),
1487 )
1488 }
Nika Layzellc680e612017-12-04 19:07:20 -05001489 Const(_binding_0, ) => {
1490 Const (
Nika Layzellce37f332017-12-05 12:01:22 -05001491 _visitor.fold_expr(_binding_0),
Nika Layzellc680e612017-12-04 19:07:20 -05001492 )
1493 }
Nika Layzell357885a2017-12-04 15:47:07 -05001494 }
1495}
1496
David Tolnayc2f1aba2017-11-12 20:29:22 -08001497pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1498 use ::GenericParam::*;
1499 match _i {
1500 Lifetime(_binding_0, ) => {
1501 Lifetime (
1502 _visitor.fold_lifetime_def(_binding_0),
1503 )
1504 }
1505 Type(_binding_0, ) => {
1506 Type (
1507 _visitor.fold_type_param(_binding_0),
1508 )
1509 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001510 Const(_binding_0, ) => {
1511 Const (
1512 _visitor.fold_const_param(_binding_0),
1513 )
1514 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001515 }
1516}
1517
Nika Layzella6f46c42017-10-26 15:26:16 -04001518pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001519 Generics {
1520 lt_token: _i . lt_token,
David Tolnayc2f1aba2017-11-12 20:29:22 -08001521 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001522 gt_token: _i . gt_token,
Nika Layzell27726662017-10-24 23:16:35 -04001523 where_clause: _visitor.fold_where_clause(_i . where_clause),
1524 }
1525}
1526# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001527pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001528 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001529 match _i {
1530 Const(_binding_0, ) => {
1531 Const (
1532 _visitor.fold_impl_item_const(_binding_0),
1533 )
1534 }
1535 Method(_binding_0, ) => {
1536 Method (
1537 _visitor.fold_impl_item_method(_binding_0),
1538 )
1539 }
1540 Type(_binding_0, ) => {
1541 Type (
1542 _visitor.fold_impl_item_type(_binding_0),
1543 )
1544 }
1545 Macro(_binding_0, ) => {
1546 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001547 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001548 )
1549 }
1550 }
1551}
1552# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001553pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1554 ImplItemConst {
1555 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1556 vis: _visitor.fold_visibility(_i . vis),
1557 defaultness: _visitor.fold_defaultness(_i . defaultness),
1558 const_token: _i . const_token,
1559 ident: _i . ident,
1560 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001561 ty: _visitor.fold_type(_i . ty),
David Tolnay857628c2017-11-11 12:25:31 -08001562 eq_token: _i . eq_token,
1563 expr: _visitor.fold_expr(_i . expr),
1564 semi_token: _i . semi_token,
1565 }
1566}
1567# [ cfg ( feature = "full" ) ]
1568pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1569 ImplItemMacro {
1570 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1571 mac: _visitor.fold_macro(_i . mac),
1572 }
1573}
1574# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001575pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001576 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001577 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001578 vis: _visitor.fold_visibility(_i . vis),
1579 defaultness: _visitor.fold_defaultness(_i . defaultness),
1580 sig: _visitor.fold_method_sig(_i . sig),
1581 block: _visitor.fold_block(_i . block),
1582 }
1583}
1584# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001585pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001586 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001587 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001588 vis: _visitor.fold_visibility(_i . vis),
1589 defaultness: _visitor.fold_defaultness(_i . defaultness),
1590 type_token: _i . type_token,
1591 ident: _i . ident,
Nika Layzell591528a2017-12-05 12:47:37 -05001592 generics: _visitor.fold_generics(_i . generics),
Nika Layzell27726662017-10-24 23:16:35 -04001593 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001594 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001595 semi_token: _i . semi_token,
1596 }
1597}
1598# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001599pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001600 use ::ImplPolarity::*;
1601 match _i {
1602 Positive => { Positive }
1603 Negative(_binding_0, ) => {
1604 Negative (
1605 _binding_0,
1606 )
1607 }
1608 }
1609}
1610# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001611pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001612 use ::InPlaceKind::*;
1613 match _i {
1614 Arrow(_binding_0, ) => {
1615 Arrow (
1616 _binding_0,
1617 )
1618 }
1619 In(_binding_0, ) => {
1620 In (
1621 _binding_0,
1622 )
1623 }
1624 }
1625}
1626# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001627pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001628 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001629 match _i {
1630 ExternCrate(_binding_0, ) => {
1631 ExternCrate (
1632 _visitor.fold_item_extern_crate(_binding_0),
1633 )
1634 }
1635 Use(_binding_0, ) => {
1636 Use (
1637 _visitor.fold_item_use(_binding_0),
1638 )
1639 }
1640 Static(_binding_0, ) => {
1641 Static (
1642 _visitor.fold_item_static(_binding_0),
1643 )
1644 }
1645 Const(_binding_0, ) => {
1646 Const (
1647 _visitor.fold_item_const(_binding_0),
1648 )
1649 }
1650 Fn(_binding_0, ) => {
1651 Fn (
1652 _visitor.fold_item_fn(_binding_0),
1653 )
1654 }
1655 Mod(_binding_0, ) => {
1656 Mod (
1657 _visitor.fold_item_mod(_binding_0),
1658 )
1659 }
1660 ForeignMod(_binding_0, ) => {
1661 ForeignMod (
1662 _visitor.fold_item_foreign_mod(_binding_0),
1663 )
1664 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001665 Type(_binding_0, ) => {
1666 Type (
1667 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001668 )
1669 }
1670 Enum(_binding_0, ) => {
1671 Enum (
1672 _visitor.fold_item_enum(_binding_0),
1673 )
1674 }
1675 Struct(_binding_0, ) => {
1676 Struct (
1677 _visitor.fold_item_struct(_binding_0),
1678 )
1679 }
1680 Union(_binding_0, ) => {
1681 Union (
1682 _visitor.fold_item_union(_binding_0),
1683 )
1684 }
1685 Trait(_binding_0, ) => {
1686 Trait (
1687 _visitor.fold_item_trait(_binding_0),
1688 )
1689 }
1690 DefaultImpl(_binding_0, ) => {
1691 DefaultImpl (
1692 _visitor.fold_item_default_impl(_binding_0),
1693 )
1694 }
1695 Impl(_binding_0, ) => {
1696 Impl (
1697 _visitor.fold_item_impl(_binding_0),
1698 )
1699 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001700 Macro(_binding_0, ) => {
1701 Macro (
1702 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001703 )
1704 }
David Tolnay500d8322017-12-18 00:32:51 -08001705 Macro2(_binding_0, ) => {
1706 Macro2 (
1707 _visitor.fold_item_macro2(_binding_0),
1708 )
1709 }
Nika Layzell27726662017-10-24 23:16:35 -04001710 }
1711}
1712# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001713pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1714 ItemConst {
1715 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1716 vis: _visitor.fold_visibility(_i . vis),
1717 const_token: _i . const_token,
1718 ident: _i . ident,
1719 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001720 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001721 eq_token: _i . eq_token,
1722 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1723 semi_token: _i . semi_token,
1724 }
1725}
1726# [ cfg ( feature = "full" ) ]
1727pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1728 ItemDefaultImpl {
1729 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1730 unsafety: _visitor.fold_unsafety(_i . unsafety),
1731 impl_token: _i . impl_token,
1732 path: _visitor.fold_path(_i . path),
1733 for_token: _i . for_token,
1734 dot2_token: _i . dot2_token,
1735 brace_token: _i . brace_token,
1736 }
1737}
1738# [ cfg ( feature = "full" ) ]
1739pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1740 ItemEnum {
1741 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1742 vis: _visitor.fold_visibility(_i . vis),
1743 enum_token: _i . enum_token,
1744 ident: _i . ident,
1745 generics: _visitor.fold_generics(_i . generics),
1746 brace_token: _i . brace_token,
1747 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1748 }
1749}
1750# [ cfg ( feature = "full" ) ]
1751pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1752 ItemExternCrate {
1753 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1754 vis: _visitor.fold_visibility(_i . vis),
1755 extern_token: _i . extern_token,
1756 crate_token: _i . crate_token,
1757 ident: _i . ident,
1758 rename: _i . rename,
1759 semi_token: _i . semi_token,
1760 }
1761}
1762# [ cfg ( feature = "full" ) ]
1763pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1764 ItemFn {
1765 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1766 vis: _visitor.fold_visibility(_i . vis),
1767 constness: _visitor.fold_constness(_i . constness),
1768 unsafety: _visitor.fold_unsafety(_i . unsafety),
1769 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1770 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1771 ident: _i . ident,
1772 block: Box::new(_visitor.fold_block(* _i . block)),
1773 }
1774}
1775# [ cfg ( feature = "full" ) ]
1776pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1777 ItemForeignMod {
1778 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1779 abi: _visitor.fold_abi(_i . abi),
1780 brace_token: _i . brace_token,
1781 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1782 }
1783}
1784# [ cfg ( feature = "full" ) ]
1785pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1786 ItemImpl {
1787 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1788 defaultness: _visitor.fold_defaultness(_i . defaultness),
1789 unsafety: _visitor.fold_unsafety(_i . unsafety),
1790 impl_token: _i . impl_token,
1791 generics: _visitor.fold_generics(_i . generics),
1792 trait_: _i . trait_,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001793 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001794 brace_token: _i . brace_token,
1795 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1796 }
1797}
1798# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001799pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1800 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001801 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay99a953d2017-11-11 12:51:43 -08001802 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001803 mac: _visitor.fold_macro(_i . mac),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 }
1805}
1806# [ cfg ( feature = "full" ) ]
David Tolnay500d8322017-12-18 00:32:51 -08001807pub fn fold_item_macro2<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1808 ItemMacro2 {
1809 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1810 vis: _visitor.fold_visibility(_i . vis),
1811 macro_token: _i . macro_token,
1812 ident: _i . ident,
1813 args: _i . args,
1814 body: _i . body,
1815 }
1816}
1817# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001818pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001819 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001820 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001821 vis: _visitor.fold_visibility(_i . vis),
1822 mod_token: _i . mod_token,
1823 ident: _i . ident,
1824 content: _i . content,
1825 semi: _i . semi,
1826 }
1827}
1828# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001829pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001830 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001831 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001832 vis: _visitor.fold_visibility(_i . vis),
1833 static_token: _i . static_token,
1834 mutbl: _visitor.fold_mutability(_i . mutbl),
1835 ident: _i . ident,
1836 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001837 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001838 eq_token: _i . eq_token,
1839 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1840 semi_token: _i . semi_token,
1841 }
1842}
1843# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001844pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001845 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001846 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001847 vis: _visitor.fold_visibility(_i . vis),
1848 struct_token: _i . struct_token,
1849 ident: _i . ident,
1850 generics: _visitor.fold_generics(_i . generics),
1851 data: _visitor.fold_variant_data(_i . data),
1852 semi_token: _i . semi_token,
1853 }
1854}
1855# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001856pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001857 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001858 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001859 vis: _visitor.fold_visibility(_i . vis),
1860 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell0dc6e632017-11-18 12:55:25 -05001861 auto_token: _i . auto_token,
Nika Layzell27726662017-10-24 23:16:35 -04001862 trait_token: _i . trait_token,
1863 ident: _i . ident,
1864 generics: _visitor.fold_generics(_i . generics),
1865 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001866 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001867 brace_token: _i . brace_token,
1868 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1869 }
1870}
1871# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001872pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1873 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001874 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001875 vis: _visitor.fold_visibility(_i . vis),
1876 type_token: _i . type_token,
1877 ident: _i . ident,
1878 generics: _visitor.fold_generics(_i . generics),
1879 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001880 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001881 semi_token: _i . semi_token,
1882 }
1883}
1884# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001885pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001886 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001887 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001888 vis: _visitor.fold_visibility(_i . vis),
1889 union_token: _i . union_token,
1890 ident: _i . ident,
1891 generics: _visitor.fold_generics(_i . generics),
1892 data: _visitor.fold_variant_data(_i . data),
1893 }
1894}
1895# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001896pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001897 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001898 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001899 vis: _visitor.fold_visibility(_i . vis),
1900 use_token: _i . use_token,
1901 path: Box::new(_visitor.fold_view_path(* _i . path)),
1902 semi_token: _i . semi_token,
1903 }
1904}
1905
Nika Layzella6f46c42017-10-26 15:26:16 -04001906pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001907 LifetimeDef {
1908 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1909 lifetime: _i . lifetime,
1910 colon_token: _i . colon_token,
1911 bounds: _i . bounds,
1912 }
1913}
1914# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001915pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001916 Local {
1917 let_token: _i . let_token,
1918 colon_token: _i . colon_token,
1919 eq_token: _i . eq_token,
1920 semi_token: _i . semi_token,
1921 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001922 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001923 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001924 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1925 }
1926}
Nika Layzell27726662017-10-24 23:16:35 -04001927# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001928pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
Nika Layzell27726662017-10-24 23:16:35 -04001929 use ::MacStmtStyle::*;
1930 match _i {
1931 Semicolon(_binding_0, ) => {
1932 Semicolon (
1933 _binding_0,
1934 )
1935 }
1936 Braces => { Braces }
1937 NoBraces => { NoBraces }
1938 }
1939}
1940
David Tolnaydecf28d2017-11-11 11:56:45 -08001941pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1942 Macro {
1943 path: _visitor.fold_path(_i . path),
1944 bang_token: _i . bang_token,
David Tolnaydecf28d2017-11-11 11:56:45 -08001945 tokens: _i . tokens,
1946 }
1947}
1948
Nika Layzella6f46c42017-10-26 15:26:16 -04001949pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001950 use ::MetaItem::*;
1951 match _i {
1952 Term(_binding_0, ) => {
1953 Term (
1954 _binding_0,
1955 )
1956 }
1957 List(_binding_0, ) => {
1958 List (
1959 _visitor.fold_meta_item_list(_binding_0),
1960 )
1961 }
1962 NameValue(_binding_0, ) => {
1963 NameValue (
1964 _visitor.fold_meta_name_value(_binding_0),
1965 )
1966 }
1967 }
1968}
1969
Nika Layzella6f46c42017-10-26 15:26:16 -04001970pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001971 MetaItemList {
1972 ident: _i . ident,
1973 paren_token: _i . paren_token,
1974 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1975 }
1976}
1977
Nika Layzella6f46c42017-10-26 15:26:16 -04001978pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001979 MetaNameValue {
1980 ident: _i . ident,
1981 eq_token: _i . eq_token,
1982 lit: _i . lit,
1983 }
1984}
1985# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001986pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001987 MethodSig {
1988 constness: _visitor.fold_constness(_i . constness),
1989 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001990 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001991 ident: _i . ident,
1992 decl: _visitor.fold_fn_decl(_i . decl),
1993 }
1994}
1995
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001996pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1997 MutType {
1998 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001999 mutability: _visitor.fold_mutability(_i . mutability),
2000 }
2001}
2002
Nika Layzella6f46c42017-10-26 15:26:16 -04002003pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04002004 use ::Mutability::*;
2005 match _i {
2006 Mutable(_binding_0, ) => {
2007 Mutable (
2008 _binding_0,
2009 )
2010 }
2011 Immutable => { Immutable }
2012 }
2013}
2014
Nika Layzella6f46c42017-10-26 15:26:16 -04002015pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04002016 use ::NestedMetaItem::*;
2017 match _i {
2018 MetaItem(_binding_0, ) => {
2019 MetaItem (
2020 _visitor.fold_meta_item(_binding_0),
2021 )
2022 }
2023 Literal(_binding_0, ) => {
2024 Literal (
2025 _binding_0,
2026 )
2027 }
2028 }
2029}
2030
Nika Layzellc08227a2017-12-04 16:30:17 -05002031pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2032 ParenthesizedGenericArguments {
Nika Layzell27726662017-10-24 23:16:35 -04002033 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002034 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002035 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002036 }
2037}
2038# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002039pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002040 use ::Pat::*;
2041 match _i {
2042 Wild(_binding_0, ) => {
2043 Wild (
2044 _visitor.fold_pat_wild(_binding_0),
2045 )
2046 }
2047 Ident(_binding_0, ) => {
2048 Ident (
2049 _visitor.fold_pat_ident(_binding_0),
2050 )
2051 }
2052 Struct(_binding_0, ) => {
2053 Struct (
2054 _visitor.fold_pat_struct(_binding_0),
2055 )
2056 }
2057 TupleStruct(_binding_0, ) => {
2058 TupleStruct (
2059 _visitor.fold_pat_tuple_struct(_binding_0),
2060 )
2061 }
2062 Path(_binding_0, ) => {
2063 Path (
2064 _visitor.fold_pat_path(_binding_0),
2065 )
2066 }
2067 Tuple(_binding_0, ) => {
2068 Tuple (
2069 _visitor.fold_pat_tuple(_binding_0),
2070 )
2071 }
2072 Box(_binding_0, ) => {
2073 Box (
2074 _visitor.fold_pat_box(_binding_0),
2075 )
2076 }
2077 Ref(_binding_0, ) => {
2078 Ref (
2079 _visitor.fold_pat_ref(_binding_0),
2080 )
2081 }
2082 Lit(_binding_0, ) => {
2083 Lit (
2084 _visitor.fold_pat_lit(_binding_0),
2085 )
2086 }
2087 Range(_binding_0, ) => {
2088 Range (
2089 _visitor.fold_pat_range(_binding_0),
2090 )
2091 }
2092 Slice(_binding_0, ) => {
2093 Slice (
2094 _visitor.fold_pat_slice(_binding_0),
2095 )
2096 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002097 Macro(_binding_0, ) => {
2098 Macro (
2099 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002100 )
2101 }
2102 }
2103}
2104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002105pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002106 PatBox {
2107 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2108 box_token: _i . box_token,
2109 }
2110}
2111# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002112pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002113 PatIdent {
2114 mode: _visitor.fold_binding_mode(_i . mode),
2115 ident: _i . ident,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002116 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002117 at_token: _i . at_token,
2118 }
2119}
2120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002121pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002122 PatLit {
2123 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2124 }
2125}
2126# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002127pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002128 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002129 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002130 path: _visitor.fold_path(_i . path),
2131 }
2132}
2133# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002134pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002135 PatRange {
2136 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2137 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2138 limits: _visitor.fold_range_limits(_i . limits),
2139 }
2140}
2141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002142pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002143 PatRef {
2144 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2145 mutbl: _visitor.fold_mutability(_i . mutbl),
2146 and_token: _i . and_token,
2147 }
2148}
2149# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002150pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002151 PatSlice {
2152 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002153 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002154 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2155 dot2_token: _i . dot2_token,
2156 comma_token: _i . comma_token,
2157 bracket_token: _i . bracket_token,
2158 }
2159}
2160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002161pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002162 PatStruct {
2163 path: _visitor.fold_path(_i . path),
2164 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2165 brace_token: _i . brace_token,
2166 dot2_token: _i . dot2_token,
2167 }
2168}
2169# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002170pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002171 PatTuple {
2172 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
2173 dots_pos: _i . dots_pos,
2174 paren_token: _i . paren_token,
2175 dot2_token: _i . dot2_token,
2176 comma_token: _i . comma_token,
2177 }
2178}
2179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002181 PatTupleStruct {
2182 path: _visitor.fold_path(_i . path),
2183 pat: _visitor.fold_pat_tuple(_i . pat),
2184 }
2185}
2186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002188 PatWild {
2189 underscore_token: _i . underscore_token,
2190 }
2191}
2192
Nika Layzella6f46c42017-10-26 15:26:16 -04002193pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002194 Path {
2195 leading_colon: _i . leading_colon,
2196 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2197 }
2198}
Nika Layzellc08227a2017-12-04 16:30:17 -05002199
2200pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2201 use ::PathArguments::*;
2202 match _i {
2203 None => { None }
2204 AngleBracketed(_binding_0, ) => {
2205 AngleBracketed (
2206 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2207 )
2208 }
2209 Parenthesized(_binding_0, ) => {
2210 Parenthesized (
2211 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2212 )
2213 }
2214 }
2215}
Nika Layzell27726662017-10-24 23:16:35 -04002216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002217pub fn fold_path_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: PathGlob) -> PathGlob {
Nika Layzell27726662017-10-24 23:16:35 -04002218 PathGlob {
2219 path: _visitor.fold_path(_i . path),
2220 colon2_token: _i . colon2_token,
2221 star_token: _i . star_token,
2222 }
2223}
2224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002225pub fn fold_path_list<V: Folder + ?Sized>(_visitor: &mut V, _i: PathList) -> PathList {
Nika Layzell27726662017-10-24 23:16:35 -04002226 PathList {
2227 path: _visitor.fold_path(_i . path),
2228 colon2_token: _i . colon2_token,
2229 brace_token: _i . brace_token,
2230 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_path_list_item(it) }),
2231 }
2232}
2233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002234pub fn fold_path_list_item<V: Folder + ?Sized>(_visitor: &mut V, _i: PathListItem) -> PathListItem {
Nika Layzell27726662017-10-24 23:16:35 -04002235 PathListItem {
2236 name: _i . name,
2237 rename: _i . rename,
2238 as_token: _i . as_token,
2239 }
2240}
2241
Nika Layzella6f46c42017-10-26 15:26:16 -04002242pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002243 PathSegment {
2244 ident: _i . ident,
Nika Layzellc08227a2017-12-04 16:30:17 -05002245 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002246 }
2247}
2248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002249pub fn fold_path_simple<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSimple) -> PathSimple {
Nika Layzell27726662017-10-24 23:16:35 -04002250 PathSimple {
2251 path: _visitor.fold_path(_i . path),
2252 as_token: _i . as_token,
2253 rename: _i . rename,
2254 }
2255}
2256
Nika Layzella6f46c42017-10-26 15:26:16 -04002257pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002258 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002259 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002260 trait_ref: _visitor.fold_path(_i . trait_ref),
2261 }
2262}
2263
Nika Layzella6f46c42017-10-26 15:26:16 -04002264pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002265 QSelf {
2266 lt_token: _i . lt_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002267 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002268 position: _i . position,
2269 as_token: _i . as_token,
2270 gt_token: _i . gt_token,
2271 }
2272}
2273# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002274pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002275 use ::RangeLimits::*;
2276 match _i {
2277 HalfOpen(_binding_0, ) => {
2278 HalfOpen (
2279 _binding_0,
2280 )
2281 }
2282 Closed(_binding_0, ) => {
2283 Closed (
2284 _binding_0,
2285 )
2286 }
2287 }
2288}
David Tolnayf93b90d2017-11-11 19:21:26 -08002289
2290pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2291 use ::ReturnType::*;
2292 match _i {
2293 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002294 Type(_binding_0, _binding_1, ) => {
2295 Type (
2296 _visitor.fold_type(_binding_0),
David Tolnayf93b90d2017-11-11 19:21:26 -08002297 _binding_1,
2298 )
2299 }
2300 }
2301}
Nika Layzell27726662017-10-24 23:16:35 -04002302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002303pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002304 use ::Stmt::*;
2305 match _i {
2306 Local(_binding_0, ) => {
2307 Local (
2308 Box::new(_visitor.fold_local(* _binding_0)),
2309 )
2310 }
2311 Item(_binding_0, ) => {
2312 Item (
2313 Box::new(_visitor.fold_item(* _binding_0)),
2314 )
2315 }
2316 Expr(_binding_0, ) => {
2317 Expr (
2318 Box::new(_visitor.fold_expr(* _binding_0)),
2319 )
2320 }
2321 Semi(_binding_0, _binding_1, ) => {
2322 Semi (
2323 Box::new(_visitor.fold_expr(* _binding_0)),
2324 _binding_1,
2325 )
2326 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002327 Macro(_binding_0, ) => {
2328 Macro (
Nika Layzell27726662017-10-24 23:16:35 -04002329 _binding_0,
2330 )
2331 }
2332 }
2333}
2334
Nika Layzella6f46c42017-10-26 15:26:16 -04002335pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002336 use ::TraitBoundModifier::*;
2337 match _i {
2338 None => { None }
2339 Maybe(_binding_0, ) => {
2340 Maybe (
2341 _binding_0,
2342 )
2343 }
2344 }
2345}
2346# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002347pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002348 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002349 match _i {
2350 Const(_binding_0, ) => {
2351 Const (
2352 _visitor.fold_trait_item_const(_binding_0),
2353 )
2354 }
2355 Method(_binding_0, ) => {
2356 Method (
2357 _visitor.fold_trait_item_method(_binding_0),
2358 )
2359 }
2360 Type(_binding_0, ) => {
2361 Type (
2362 _visitor.fold_trait_item_type(_binding_0),
2363 )
2364 }
2365 Macro(_binding_0, ) => {
2366 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002367 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002368 )
2369 }
2370 }
2371}
2372# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002373pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2374 TraitItemConst {
2375 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2376 const_token: _i . const_token,
2377 ident: _i . ident,
2378 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002379 ty: _visitor.fold_type(_i . ty),
David Tolnayda705bd2017-11-10 21:58:05 -08002380 default: _i . default,
2381 semi_token: _i . semi_token,
2382 }
2383}
2384# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002385pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2386 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002387 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002388 mac: _visitor.fold_macro(_i . mac),
David Tolnayda705bd2017-11-10 21:58:05 -08002389 }
2390}
2391# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002392pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002393 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002394 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002395 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002396 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002397 semi_token: _i . semi_token,
2398 }
2399}
2400# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002401pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002402 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002403 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002404 type_token: _i . type_token,
2405 ident: _i . ident,
Nika Layzell591528a2017-12-05 12:47:37 -05002406 generics: _visitor.fold_generics(_i . generics),
Nika Layzell27726662017-10-24 23:16:35 -04002407 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002408 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002409 default: _i . default,
2410 semi_token: _i . semi_token,
2411 }
2412}
2413
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002414pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2415 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002416 match _i {
2417 Slice(_binding_0, ) => {
2418 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002419 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002420 )
2421 }
2422 Array(_binding_0, ) => {
2423 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002425 )
2426 }
2427 Ptr(_binding_0, ) => {
2428 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002429 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002430 )
2431 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002432 Reference(_binding_0, ) => {
2433 Reference (
2434 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002435 )
2436 }
2437 BareFn(_binding_0, ) => {
2438 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002439 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
2442 Never(_binding_0, ) => {
2443 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002444 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002445 )
2446 }
2447 Tup(_binding_0, ) => {
2448 Tup (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449 _visitor.fold_type_tup(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002450 )
2451 }
2452 Path(_binding_0, ) => {
2453 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002454 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002455 )
2456 }
2457 TraitObject(_binding_0, ) => {
2458 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002459 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002460 )
2461 }
2462 ImplTrait(_binding_0, ) => {
2463 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002464 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002465 )
2466 }
2467 Paren(_binding_0, ) => {
2468 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002469 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002470 )
2471 }
2472 Group(_binding_0, ) => {
2473 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002474 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002475 )
2476 }
2477 Infer(_binding_0, ) => {
2478 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002480 )
2481 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002482 Macro(_binding_0, ) => {
2483 Macro (
2484 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002485 )
2486 }
2487 }
2488}
2489
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2491 TypeArray {
Nika Layzell27726662017-10-24 23:16:35 -04002492 bracket_token: _i . bracket_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002493 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002494 semi_token: _i . semi_token,
2495 amt: _visitor.fold_expr(_i . amt),
2496 }
2497}
2498
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002499pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2500 TypeBareFn {
2501 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002502 }
2503}
2504
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002505pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2506 TypeBinding {
2507 ident: _i . ident,
2508 eq_token: _i . eq_token,
2509 ty: _visitor.fold_type(_i . ty),
2510 }
2511}
2512
2513pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2514 TypeGroup {
Nika Layzell27726662017-10-24 23:16:35 -04002515 group_token: _i . group_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002516 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002517 }
2518}
2519
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002520pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2521 TypeImplTrait {
Nika Layzell27726662017-10-24 23:16:35 -04002522 impl_token: _i . impl_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002523 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002524 }
2525}
2526
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002527pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2528 TypeInfer {
Nika Layzell27726662017-10-24 23:16:35 -04002529 underscore_token: _i . underscore_token,
2530 }
2531}
2532
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002533pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2534 TypeNever {
Nika Layzell27726662017-10-24 23:16:35 -04002535 bang_token: _i . bang_token,
2536 }
2537}
2538
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002539pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2540 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002541 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2542 ident: _i . ident,
2543 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002544 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002545 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002546 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002547 }
2548}
2549
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2551 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002552 match _i {
2553 Trait(_binding_0, _binding_1, ) => {
2554 Trait (
2555 _visitor.fold_poly_trait_ref(_binding_0),
2556 _visitor.fold_trait_bound_modifier(_binding_1),
2557 )
2558 }
2559 Region(_binding_0, ) => {
2560 Region (
2561 _binding_0,
2562 )
2563 }
2564 }
2565}
2566
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002567pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2568 TypeParen {
Nika Layzell27726662017-10-24 23:16:35 -04002569 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002570 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002571 }
2572}
2573
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2575 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002576 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002577 path: _visitor.fold_path(_i . path),
2578 }
2579}
2580
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002581pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2582 TypePtr {
Nika Layzell27726662017-10-24 23:16:35 -04002583 star_token: _i . star_token,
2584 const_token: _i . const_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002585 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002586 }
2587}
2588
David Tolnay0a89b4d2017-11-13 00:55:45 -08002589pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2590 TypeReference {
Nika Layzell27726662017-10-24 23:16:35 -04002591 and_token: _i . and_token,
2592 lifetime: _i . lifetime,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002593 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002594 }
2595}
2596
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002597pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2598 TypeSlice {
2599 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002600 bracket_token: _i . bracket_token,
2601 }
2602}
2603
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002604pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2605 TypeTraitObject {
2606 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002607 }
2608}
2609
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002610pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
2611 TypeTup {
Nika Layzell27726662017-10-24 23:16:35 -04002612 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002613 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002614 lone_comma: _i . lone_comma,
2615 }
2616}
2617
Nika Layzella6f46c42017-10-26 15:26:16 -04002618pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002619 use ::UnOp::*;
2620 match _i {
2621 Deref(_binding_0, ) => {
2622 Deref (
2623 _binding_0,
2624 )
2625 }
2626 Not(_binding_0, ) => {
2627 Not (
2628 _binding_0,
2629 )
2630 }
2631 Neg(_binding_0, ) => {
2632 Neg (
2633 _binding_0,
2634 )
2635 }
2636 }
2637}
2638
Nika Layzella6f46c42017-10-26 15:26:16 -04002639pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002640 use ::Unsafety::*;
2641 match _i {
2642 Unsafe(_binding_0, ) => {
2643 Unsafe (
2644 _binding_0,
2645 )
2646 }
2647 Normal => { Normal }
2648 }
2649}
2650
Nika Layzella6f46c42017-10-26 15:26:16 -04002651pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002652 Variant {
2653 ident: _i . ident,
2654 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2655 data: _visitor.fold_variant_data(_i . data),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002656 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002657 eq_token: _i . eq_token,
2658 }
2659}
2660
Nika Layzella6f46c42017-10-26 15:26:16 -04002661pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002662 use ::VariantData::*;
2663 match _i {
2664 Struct(_binding_0, _binding_1, ) => {
2665 Struct (
2666 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2667 _binding_1,
2668 )
2669 }
2670 Tuple(_binding_0, _binding_1, ) => {
2671 Tuple (
2672 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2673 _binding_1,
2674 )
2675 }
2676 Unit => { Unit }
2677 }
2678}
2679# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002680pub fn fold_view_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ViewPath) -> ViewPath {
Nika Layzell27726662017-10-24 23:16:35 -04002681 use ::ViewPath::*;
2682 match _i {
2683 Simple(_binding_0, ) => {
2684 Simple (
2685 _visitor.fold_path_simple(_binding_0),
2686 )
2687 }
2688 Glob(_binding_0, ) => {
2689 Glob (
2690 _visitor.fold_path_glob(_binding_0),
2691 )
2692 }
2693 List(_binding_0, ) => {
2694 List (
2695 _visitor.fold_path_list(_binding_0),
2696 )
2697 }
2698 }
2699}
2700
Nika Layzella6f46c42017-10-26 15:26:16 -04002701pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002702 VisCrate {
2703 pub_token: _i . pub_token,
2704 paren_token: _i . paren_token,
2705 crate_token: _i . crate_token,
2706 }
2707}
2708
Nika Layzella6f46c42017-10-26 15:26:16 -04002709pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002710 VisInherited {
2711 }
2712}
2713
Nika Layzella6f46c42017-10-26 15:26:16 -04002714pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002715 VisPublic {
2716 pub_token: _i . pub_token,
2717 }
2718}
2719
Nika Layzella6f46c42017-10-26 15:26:16 -04002720pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002721 VisRestricted {
2722 pub_token: _i . pub_token,
2723 paren_token: _i . paren_token,
2724 in_token: _i . in_token,
2725 path: Box::new(_visitor.fold_path(* _i . path)),
2726 }
2727}
2728
Nika Layzella6f46c42017-10-26 15:26:16 -04002729pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002730 use ::Visibility::*;
2731 match _i {
2732 Public(_binding_0, ) => {
2733 Public (
2734 _visitor.fold_vis_public(_binding_0),
2735 )
2736 }
2737 Crate(_binding_0, ) => {
2738 Crate (
2739 _visitor.fold_vis_crate(_binding_0),
2740 )
2741 }
2742 Restricted(_binding_0, ) => {
2743 Restricted (
2744 _visitor.fold_vis_restricted(_binding_0),
2745 )
2746 }
2747 Inherited(_binding_0, ) => {
2748 Inherited (
2749 _visitor.fold_vis_inherited(_binding_0),
2750 )
2751 }
2752 }
2753}
2754
Nika Layzella6f46c42017-10-26 15:26:16 -04002755pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002756 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002757 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002758 bounded_ty: _visitor.fold_type(_i . bounded_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002759 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002760 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002761 }
2762}
2763
Nika Layzella6f46c42017-10-26 15:26:16 -04002764pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002765 WhereClause {
2766 where_token: _i . where_token,
2767 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2768 }
2769}
2770
Nika Layzella6f46c42017-10-26 15:26:16 -04002771pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002772 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002773 lhs_ty: _visitor.fold_type(_i . lhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002774 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002775 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002776 }
2777}
2778
Nika Layzella6f46c42017-10-26 15:26:16 -04002779pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002780 use ::WherePredicate::*;
2781 match _i {
2782 BoundPredicate(_binding_0, ) => {
2783 BoundPredicate (
2784 _visitor.fold_where_bound_predicate(_binding_0),
2785 )
2786 }
2787 RegionPredicate(_binding_0, ) => {
2788 RegionPredicate (
2789 _visitor.fold_where_region_predicate(_binding_0),
2790 )
2791 }
2792 EqPredicate(_binding_0, ) => {
2793 EqPredicate (
2794 _visitor.fold_where_eq_predicate(_binding_0),
2795 )
2796 }
2797 }
2798}
2799
Nika Layzella6f46c42017-10-26 15:26:16 -04002800pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002801 WhereRegionPredicate {
2802 lifetime: _i . lifetime,
2803 colon_token: _i . colon_token,
2804 bounds: _i . bounds,
2805 }
2806}
2807