blob: 186e38028c6700fd4efdc662b9d9122106264538 [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 Layzell27726662017-10-24 23:16:35 -0400100# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_kind(&mut self, i: ExprKind) -> ExprKind { fold_expr_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_expr_tup(&mut self, i: ExprTup) -> ExprTup { fold_expr_tup(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_expr_tup_field(&mut self, i: ExprTupField) -> ExprTupField { fold_expr_tup_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500179fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800204# [ cfg ( feature = "full" ) ]
205fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206
Nika Layzellc08227a2017-12-04 16:30:17 -0500207fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500208
David Tolnayc2f1aba2017-11-12 20:29:22 -0800209fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
210
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800217fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800243fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800253fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
David Tolnaydecf28d2017-11-11 11:56:45 -0800265fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
266
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800275fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280
Nika Layzellc08227a2017-12-04 16:30:17 -0500281fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500308
309fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_path_glob(&mut self, i: PathGlob) -> PathGlob { fold_path_glob(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_path_list(&mut self, i: PathList) -> PathList { fold_path_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_path_list_item(&mut self, i: PathListItem) -> PathListItem { fold_path_list_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_path_simple(&mut self, i: PathSimple) -> PathSimple { fold_path_simple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800326
327fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800337fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400339fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400341fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800343fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800345fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348
Nika Layzella6f46c42017-10-26 15:26:16 -0400349fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800351fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
352
353fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
354
355fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
356
357fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
358
359fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
360
361fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
362
363fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
364
365fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
366
367fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
368
David Tolnay0a89b4d2017-11-13 00:55:45 -0800369fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800370
371fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
372
373fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
374
375fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_view_path(&mut self, i: ViewPath) -> ViewPath { fold_view_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_vis_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400402
Nika Layzella6f46c42017-10-26 15:26:16 -0400403fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400404
Nika Layzella6f46c42017-10-26 15:26:16 -0400405fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400406
407}
408
409
Nika Layzella6f46c42017-10-26 15:26:16 -0400410pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400411 Abi {
412 extern_token: _i . extern_token,
413 kind: _visitor.fold_abi_kind(_i . kind),
414 }
415}
416
Nika Layzella6f46c42017-10-26 15:26:16 -0400417pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400418 use ::AbiKind::*;
419 match _i {
420 Named(_binding_0, ) => {
421 Named (
422 _binding_0,
423 )
424 }
425 Default => { Default }
426 }
427}
428
Nika Layzellc08227a2017-12-04 16:30:17 -0500429pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
430 AngleBracketedGenericArguments {
Nika Layzell27726662017-10-24 23:16:35 -0400431 turbofish: _i . turbofish,
432 lt_token: _i . lt_token,
Nika Layzellc08227a2017-12-04 16:30:17 -0500433 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400434 gt_token: _i . gt_token,
435 }
436}
437# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400438pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400439 ArgCaptured {
440 pat: _visitor.fold_pat(_i . pat),
441 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800442 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400443 }
444}
445# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400446pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400447 ArgSelf {
448 mutbl: _visitor.fold_mutability(_i . mutbl),
449 self_token: _i . self_token,
450 }
451}
452# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400453pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400454 ArgSelfRef {
455 and_token: _i . and_token,
456 self_token: _i . self_token,
457 lifetime: _i . lifetime,
458 mutbl: _visitor.fold_mutability(_i . mutbl),
459 }
460}
461# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400462pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400463 Arm {
464 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
465 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
466 if_token: _i . if_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400467 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400468 rocket_token: _i . rocket_token,
469 body: Box::new(_visitor.fold_expr(* _i . body)),
470 comma: _i . comma,
471 }
472}
473
Nika Layzella6f46c42017-10-26 15:26:16 -0400474pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400475 use ::AttrStyle::*;
476 match _i {
477 Outer => { Outer }
478 Inner(_binding_0, ) => {
479 Inner (
480 _binding_0,
481 )
482 }
483 }
484}
485
Nika Layzella6f46c42017-10-26 15:26:16 -0400486pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400487 Attribute {
488 style: _visitor.fold_attr_style(_i . style),
489 pound_token: _i . pound_token,
490 bracket_token: _i . bracket_token,
491 path: _visitor.fold_path(_i . path),
492 tts: _i . tts,
493 is_sugared_doc: _i . is_sugared_doc,
494 }
495}
496
Nika Layzella6f46c42017-10-26 15:26:16 -0400497pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400498 BareFnArg {
499 name: _i . name,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800500 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400501 }
502}
503
Nika Layzella6f46c42017-10-26 15:26:16 -0400504pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400505 use ::BareFnArgName::*;
506 match _i {
507 Named(_binding_0, ) => {
508 Named (
509 _binding_0,
510 )
511 }
512 Wild(_binding_0, ) => {
513 Wild (
514 _binding_0,
515 )
516 }
517 }
518}
519
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800520pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
521 BareFnType {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400522 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400523 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400524 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400525 fn_token: _i . fn_token,
526 paren_token: _i . paren_token,
527 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
528 variadic: _i . variadic,
David Tolnayf93b90d2017-11-11 19:21:26 -0800529 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400530 }
531}
532
Nika Layzella6f46c42017-10-26 15:26:16 -0400533pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400534 use ::BinOp::*;
535 match _i {
536 Add(_binding_0, ) => {
537 Add (
538 _binding_0,
539 )
540 }
541 Sub(_binding_0, ) => {
542 Sub (
543 _binding_0,
544 )
545 }
546 Mul(_binding_0, ) => {
547 Mul (
548 _binding_0,
549 )
550 }
551 Div(_binding_0, ) => {
552 Div (
553 _binding_0,
554 )
555 }
556 Rem(_binding_0, ) => {
557 Rem (
558 _binding_0,
559 )
560 }
561 And(_binding_0, ) => {
562 And (
563 _binding_0,
564 )
565 }
566 Or(_binding_0, ) => {
567 Or (
568 _binding_0,
569 )
570 }
571 BitXor(_binding_0, ) => {
572 BitXor (
573 _binding_0,
574 )
575 }
576 BitAnd(_binding_0, ) => {
577 BitAnd (
578 _binding_0,
579 )
580 }
581 BitOr(_binding_0, ) => {
582 BitOr (
583 _binding_0,
584 )
585 }
586 Shl(_binding_0, ) => {
587 Shl (
588 _binding_0,
589 )
590 }
591 Shr(_binding_0, ) => {
592 Shr (
593 _binding_0,
594 )
595 }
596 Eq(_binding_0, ) => {
597 Eq (
598 _binding_0,
599 )
600 }
601 Lt(_binding_0, ) => {
602 Lt (
603 _binding_0,
604 )
605 }
606 Le(_binding_0, ) => {
607 Le (
608 _binding_0,
609 )
610 }
611 Ne(_binding_0, ) => {
612 Ne (
613 _binding_0,
614 )
615 }
616 Ge(_binding_0, ) => {
617 Ge (
618 _binding_0,
619 )
620 }
621 Gt(_binding_0, ) => {
622 Gt (
623 _binding_0,
624 )
625 }
626 AddEq(_binding_0, ) => {
627 AddEq (
628 _binding_0,
629 )
630 }
631 SubEq(_binding_0, ) => {
632 SubEq (
633 _binding_0,
634 )
635 }
636 MulEq(_binding_0, ) => {
637 MulEq (
638 _binding_0,
639 )
640 }
641 DivEq(_binding_0, ) => {
642 DivEq (
643 _binding_0,
644 )
645 }
646 RemEq(_binding_0, ) => {
647 RemEq (
648 _binding_0,
649 )
650 }
651 BitXorEq(_binding_0, ) => {
652 BitXorEq (
653 _binding_0,
654 )
655 }
656 BitAndEq(_binding_0, ) => {
657 BitAndEq (
658 _binding_0,
659 )
660 }
661 BitOrEq(_binding_0, ) => {
662 BitOrEq (
663 _binding_0,
664 )
665 }
666 ShlEq(_binding_0, ) => {
667 ShlEq (
668 _binding_0,
669 )
670 }
671 ShrEq(_binding_0, ) => {
672 ShrEq (
673 _binding_0,
674 )
675 }
676 }
677}
678# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400679pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400680 use ::BindingMode::*;
681 match _i {
682 ByRef(_binding_0, _binding_1, ) => {
683 ByRef (
684 _binding_0,
685 _visitor.fold_mutability(_binding_1),
686 )
687 }
688 ByValue(_binding_0, ) => {
689 ByValue (
690 _visitor.fold_mutability(_binding_0),
691 )
692 }
693 }
694}
695# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400696pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400697 Block {
698 brace_token: _i . brace_token,
699 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
700 }
701}
702
Nika Layzella6f46c42017-10-26 15:26:16 -0400703pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400704 use ::Body::*;
705 match _i {
706 Enum(_binding_0, ) => {
707 Enum (
708 _visitor.fold_body_enum(_binding_0),
709 )
710 }
711 Struct(_binding_0, ) => {
712 Struct (
713 _visitor.fold_body_struct(_binding_0),
714 )
715 }
716 }
717}
718
Nika Layzella6f46c42017-10-26 15:26:16 -0400719pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400720 BodyEnum {
721 enum_token: _i . enum_token,
722 brace_token: _i . brace_token,
723 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
724 }
725}
726
Nika Layzella6f46c42017-10-26 15:26:16 -0400727pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400728 BodyStruct {
729 data: _visitor.fold_variant_data(_i . data),
730 struct_token: _i . struct_token,
731 semi_token: _i . semi_token,
732 }
733}
734
Nika Layzella6f46c42017-10-26 15:26:16 -0400735pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400736 BoundLifetimes {
737 for_token: _i . for_token,
738 lt_token: _i . lt_token,
739 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
740 gt_token: _i . gt_token,
741 }
742}
743# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400744pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400745 use ::CaptureBy::*;
746 match _i {
747 Value(_binding_0, ) => {
748 Value (
749 _binding_0,
750 )
751 }
752 Ref => { Ref }
753 }
754}
755# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400756pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400757 use ::Constness::*;
758 match _i {
759 Const(_binding_0, ) => {
760 Const (
761 _binding_0,
762 )
763 }
764 NotConst => { NotConst }
765 }
766}
767# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400768pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400769 use ::Defaultness::*;
770 match _i {
771 Default(_binding_0, ) => {
772 Default (
773 _binding_0,
774 )
775 }
776 Final => { Final }
777 }
778}
779
Nika Layzella6f46c42017-10-26 15:26:16 -0400780pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400781 DeriveInput {
782 ident: _i . ident,
783 vis: _visitor.fold_visibility(_i . vis),
784 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
785 generics: _visitor.fold_generics(_i . generics),
786 body: _visitor.fold_body(_i . body),
787 }
788}
789
Nika Layzella6f46c42017-10-26 15:26:16 -0400790pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400791 Expr {
792 node: _visitor.fold_expr_kind(_i . node),
793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
794 }
795}
796# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400797pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400798 ExprAddrOf {
799 and_token: _i . and_token,
800 mutbl: _visitor.fold_mutability(_i . mutbl),
801 expr: Box::new(_visitor.fold_expr(* _i . expr)),
802 }
803}
804# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400805pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400806 ExprArray {
807 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
808 bracket_token: _i . bracket_token,
809 }
810}
811# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400812pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400813 ExprAssign {
814 left: Box::new(_visitor.fold_expr(* _i . left)),
815 right: Box::new(_visitor.fold_expr(* _i . right)),
816 eq_token: _i . eq_token,
817 }
818}
819# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400820pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400821 ExprAssignOp {
822 op: _visitor.fold_bin_op(_i . op),
823 left: Box::new(_visitor.fold_expr(* _i . left)),
824 right: Box::new(_visitor.fold_expr(* _i . right)),
825 }
826}
827
Nika Layzella6f46c42017-10-26 15:26:16 -0400828pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400829 ExprBinary {
830 op: _visitor.fold_bin_op(_i . op),
831 left: Box::new(_visitor.fold_expr(* _i . left)),
832 right: Box::new(_visitor.fold_expr(* _i . right)),
833 }
834}
835# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400836pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400837 ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400838 block: _visitor.fold_block(_i . block),
839 }
840}
841# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400842pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400843 ExprBox {
844 expr: Box::new(_visitor.fold_expr(* _i . expr)),
845 box_token: _i . box_token,
846 }
847}
848# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400849pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400850 ExprBreak {
851 label: _i . label,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400852 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400853 break_token: _i . break_token,
854 }
855}
856
Nika Layzella6f46c42017-10-26 15:26:16 -0400857pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400858 ExprCall {
859 func: Box::new(_visitor.fold_expr(* _i . func)),
860 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
861 paren_token: _i . paren_token,
862 }
863}
864
Nika Layzella6f46c42017-10-26 15:26:16 -0400865pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400866 ExprCast {
867 expr: Box::new(_visitor.fold_expr(* _i . expr)),
868 as_token: _i . as_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800869 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400870 }
871}
872# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400873pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400874 ExprCatch {
875 do_token: _i . do_token,
876 catch_token: _i . catch_token,
877 block: _visitor.fold_block(_i . block),
878 }
879}
880# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400881pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400882 ExprClosure {
883 capture: _visitor.fold_capture_by(_i . capture),
884 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
885 body: Box::new(_visitor.fold_expr(* _i . body)),
886 or1_token: _i . or1_token,
887 or2_token: _i . or2_token,
888 }
889}
890# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400891pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400892 ExprContinue {
893 label: _i . label,
894 continue_token: _i . continue_token,
895 }
896}
897# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400898pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400899 ExprField {
900 expr: Box::new(_visitor.fold_expr(* _i . expr)),
901 field: _i . field,
902 dot_token: _i . dot_token,
903 }
904}
905# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400906pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400907 ExprForLoop {
908 pat: Box::new(_visitor.fold_pat(* _i . pat)),
909 expr: Box::new(_visitor.fold_expr(* _i . expr)),
910 body: _visitor.fold_block(_i . body),
911 label: _i . label,
912 for_token: _i . for_token,
913 colon_token: _i . colon_token,
914 in_token: _i . in_token,
915 }
916}
917
Nika Layzella6f46c42017-10-26 15:26:16 -0400918pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400919 ExprGroup {
920 expr: Box::new(_visitor.fold_expr(* _i . expr)),
921 group_token: _i . group_token,
922 }
923}
924# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400925pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400926 ExprIf {
927 cond: Box::new(_visitor.fold_expr(* _i . cond)),
928 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400929 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400930 if_token: _i . if_token,
931 else_token: _i . else_token,
932 }
933}
934# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400935pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400936 ExprIfLet {
937 pat: Box::new(_visitor.fold_pat(* _i . pat)),
938 expr: Box::new(_visitor.fold_expr(* _i . expr)),
939 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400940 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400941 if_token: _i . if_token,
942 let_token: _i . let_token,
943 eq_token: _i . eq_token,
944 else_token: _i . else_token,
945 }
946}
947# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400948pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400949 ExprInPlace {
950 place: Box::new(_visitor.fold_expr(* _i . place)),
951 kind: _visitor.fold_in_place_kind(_i . kind),
952 value: Box::new(_visitor.fold_expr(* _i . value)),
953 }
954}
955
Nika Layzella6f46c42017-10-26 15:26:16 -0400956pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400957 ExprIndex {
958 expr: Box::new(_visitor.fold_expr(* _i . expr)),
959 index: Box::new(_visitor.fold_expr(* _i . index)),
960 bracket_token: _i . bracket_token,
961 }
962}
963
Nika Layzella6f46c42017-10-26 15:26:16 -0400964pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400965 use ::ExprKind::*;
966 match _i {
967 Box(_binding_0, ) => {
968 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400969 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400970 )
971 }
972 InPlace(_binding_0, ) => {
973 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400974 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400975 )
976 }
977 Array(_binding_0, ) => {
978 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400979 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400980 )
981 }
982 Call(_binding_0, ) => {
983 Call (
984 _visitor.fold_expr_call(_binding_0),
985 )
986 }
987 MethodCall(_binding_0, ) => {
988 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400989 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400990 )
991 }
992 Tup(_binding_0, ) => {
993 Tup (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400994 full!(_visitor.fold_expr_tup(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400995 )
996 }
997 Binary(_binding_0, ) => {
998 Binary (
999 _visitor.fold_expr_binary(_binding_0),
1000 )
1001 }
1002 Unary(_binding_0, ) => {
1003 Unary (
1004 _visitor.fold_expr_unary(_binding_0),
1005 )
1006 }
1007 Lit(_binding_0, ) => {
1008 Lit (
1009 _binding_0,
1010 )
1011 }
1012 Cast(_binding_0, ) => {
1013 Cast (
1014 _visitor.fold_expr_cast(_binding_0),
1015 )
1016 }
1017 Type(_binding_0, ) => {
1018 Type (
1019 _visitor.fold_expr_type(_binding_0),
1020 )
1021 }
1022 If(_binding_0, ) => {
1023 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001024 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001025 )
1026 }
1027 IfLet(_binding_0, ) => {
1028 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001029 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001030 )
1031 }
1032 While(_binding_0, ) => {
1033 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001034 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001035 )
1036 }
1037 WhileLet(_binding_0, ) => {
1038 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001039 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001040 )
1041 }
1042 ForLoop(_binding_0, ) => {
1043 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001044 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001045 )
1046 }
1047 Loop(_binding_0, ) => {
1048 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001049 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001050 )
1051 }
1052 Match(_binding_0, ) => {
1053 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001054 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001055 )
1056 }
1057 Closure(_binding_0, ) => {
1058 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001059 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001060 )
1061 }
Nika Layzell640832a2017-12-04 13:37:09 -05001062 Unsafe(_binding_0, ) => {
1063 Unsafe (
1064 full!(_visitor.fold_expr_unsafe(_binding_0)),
1065 )
1066 }
Nika Layzell27726662017-10-24 23:16:35 -04001067 Block(_binding_0, ) => {
1068 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001069 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001070 )
1071 }
1072 Assign(_binding_0, ) => {
1073 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001074 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001075 )
1076 }
1077 AssignOp(_binding_0, ) => {
1078 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001079 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001080 )
1081 }
1082 Field(_binding_0, ) => {
1083 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001084 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001085 )
1086 }
1087 TupField(_binding_0, ) => {
1088 TupField (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001089 full!(_visitor.fold_expr_tup_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001090 )
1091 }
1092 Index(_binding_0, ) => {
1093 Index (
1094 _visitor.fold_expr_index(_binding_0),
1095 )
1096 }
1097 Range(_binding_0, ) => {
1098 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001099 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001100 )
1101 }
1102 Path(_binding_0, ) => {
1103 Path (
1104 _visitor.fold_expr_path(_binding_0),
1105 )
1106 }
1107 AddrOf(_binding_0, ) => {
1108 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001109 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001110 )
1111 }
1112 Break(_binding_0, ) => {
1113 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001114 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001115 )
1116 }
1117 Continue(_binding_0, ) => {
1118 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001119 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001120 )
1121 }
1122 Ret(_binding_0, ) => {
1123 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001124 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001125 )
1126 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001127 Macro(_binding_0, ) => {
1128 Macro (
1129 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001130 )
1131 }
1132 Struct(_binding_0, ) => {
1133 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001134 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001135 )
1136 }
1137 Repeat(_binding_0, ) => {
1138 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001139 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001140 )
1141 }
1142 Paren(_binding_0, ) => {
1143 Paren (
1144 _visitor.fold_expr_paren(_binding_0),
1145 )
1146 }
1147 Group(_binding_0, ) => {
1148 Group (
1149 _visitor.fold_expr_group(_binding_0),
1150 )
1151 }
1152 Try(_binding_0, ) => {
1153 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001154 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001155 )
1156 }
1157 Catch(_binding_0, ) => {
1158 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001159 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001160 )
1161 }
1162 Yield(_binding_0, ) => {
1163 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001164 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001165 )
1166 }
1167 }
1168}
1169# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001170pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001171 ExprLoop {
1172 body: _visitor.fold_block(_i . body),
1173 label: _i . label,
1174 loop_token: _i . loop_token,
1175 colon_token: _i . colon_token,
1176 }
1177}
1178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001179pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001180 ExprMatch {
1181 match_token: _i . match_token,
1182 brace_token: _i . brace_token,
1183 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1184 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1185 }
1186}
1187# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001188pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001189 ExprMethodCall {
1190 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1191 method: _i . method,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001192 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001193 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1194 paren_token: _i . paren_token,
1195 dot_token: _i . dot_token,
1196 lt_token: _i . lt_token,
1197 colon2_token: _i . colon2_token,
1198 gt_token: _i . gt_token,
1199 }
1200}
1201
Nika Layzella6f46c42017-10-26 15:26:16 -04001202pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001203 ExprParen {
1204 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1205 paren_token: _i . paren_token,
1206 }
1207}
1208
Nika Layzella6f46c42017-10-26 15:26:16 -04001209pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001210 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001211 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001212 path: _visitor.fold_path(_i . path),
1213 }
1214}
1215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001216pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001218 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1219 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001220 limits: _visitor.fold_range_limits(_i . limits),
1221 }
1222}
1223# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001224pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001225 ExprRepeat {
1226 bracket_token: _i . bracket_token,
1227 semi_token: _i . semi_token,
1228 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1229 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1230 }
1231}
1232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001233pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001234 ExprRet {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001235 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001236 return_token: _i . return_token,
1237 }
1238}
1239# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001240pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001241 ExprStruct {
1242 path: _visitor.fold_path(_i . path),
1243 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001244 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001245 dot2_token: _i . dot2_token,
1246 brace_token: _i . brace_token,
1247 }
1248}
1249# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001250pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001251 ExprTry {
1252 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1253 question_token: _i . question_token,
1254 }
1255}
1256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001257pub fn fold_expr_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTup) -> ExprTup {
Nika Layzell27726662017-10-24 23:16:35 -04001258 ExprTup {
1259 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1260 paren_token: _i . paren_token,
1261 lone_comma: _i . lone_comma,
1262 }
1263}
1264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001265pub fn fold_expr_tup_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTupField) -> ExprTupField {
Nika Layzell27726662017-10-24 23:16:35 -04001266 ExprTupField {
1267 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1268 field: _i . field,
1269 dot_token: _i . dot_token,
1270 }
1271}
1272
Nika Layzella6f46c42017-10-26 15:26:16 -04001273pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprType {
1275 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1276 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001277 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001278 }
1279}
1280
Nika Layzella6f46c42017-10-26 15:26:16 -04001281pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001282 ExprUnary {
1283 op: _visitor.fold_un_op(_i . op),
1284 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1285 }
1286}
1287# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001288pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1289 ExprUnsafe {
1290 unsafe_token: _i . unsafe_token,
1291 block: _visitor.fold_block(_i . block),
1292 }
1293}
1294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001295pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001296 ExprWhile {
1297 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1298 body: _visitor.fold_block(_i . body),
1299 label: _i . label,
1300 colon_token: _i . colon_token,
1301 while_token: _i . while_token,
1302 }
1303}
1304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001305pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprWhileLet {
1307 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1308 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1309 body: _visitor.fold_block(_i . body),
1310 label: _i . label,
1311 colon_token: _i . colon_token,
1312 while_token: _i . while_token,
1313 let_token: _i . let_token,
1314 eq_token: _i . eq_token,
1315 }
1316}
1317# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001318pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001319 ExprYield {
1320 yield_token: _i . yield_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001321 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001322 }
1323}
1324
Nika Layzella6f46c42017-10-26 15:26:16 -04001325pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001326 Field {
1327 ident: _i . ident,
1328 vis: _visitor.fold_visibility(_i . vis),
1329 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001330 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001331 colon_token: _i . colon_token,
1332 }
1333}
1334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001335pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001336 FieldPat {
1337 ident: _i . ident,
1338 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1339 is_shorthand: _i . is_shorthand,
1340 colon_token: _i . colon_token,
1341 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1342 }
1343}
1344# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001345pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001346 FieldValue {
1347 ident: _i . ident,
1348 expr: _visitor.fold_expr(_i . expr),
1349 is_shorthand: _i . is_shorthand,
1350 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1351 colon_token: _i . colon_token,
1352 }
1353}
1354# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001355pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001356 File {
1357 shebang: _i . shebang,
1358 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1359 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1360 }
1361}
1362# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001363pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001364 use ::FnArg::*;
1365 match _i {
1366 SelfRef(_binding_0, ) => {
1367 SelfRef (
1368 _visitor.fold_arg_self_ref(_binding_0),
1369 )
1370 }
1371 SelfValue(_binding_0, ) => {
1372 SelfValue (
1373 _visitor.fold_arg_self(_binding_0),
1374 )
1375 }
1376 Captured(_binding_0, ) => {
1377 Captured (
1378 _visitor.fold_arg_captured(_binding_0),
1379 )
1380 }
1381 Ignored(_binding_0, ) => {
1382 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001383 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001384 )
1385 }
1386 }
1387}
1388# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001389pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001390 FnDecl {
1391 fn_token: _i . fn_token,
1392 paren_token: _i . paren_token,
1393 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001394 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001395 generics: _visitor.fold_generics(_i . generics),
1396 variadic: _i . variadic,
1397 dot_tokens: _i . dot_tokens,
1398 }
1399}
1400# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001401pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001402 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001403 match _i {
1404 Fn(_binding_0, ) => {
1405 Fn (
1406 _visitor.fold_foreign_item_fn(_binding_0),
1407 )
1408 }
1409 Static(_binding_0, ) => {
1410 Static (
1411 _visitor.fold_foreign_item_static(_binding_0),
1412 )
1413 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001414 Type(_binding_0, ) => {
1415 Type (
1416 _visitor.fold_foreign_item_type(_binding_0),
1417 )
1418 }
Nika Layzell27726662017-10-24 23:16:35 -04001419 }
1420}
1421# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001422pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1423 ForeignItemFn {
1424 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1425 vis: _visitor.fold_visibility(_i . vis),
1426 ident: _i . ident,
1427 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1428 semi_token: _i . semi_token,
1429 }
1430}
1431# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001432pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001433 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001434 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1435 vis: _visitor.fold_visibility(_i . vis),
Nika Layzell27726662017-10-24 23:16:35 -04001436 static_token: _i . static_token,
Nika Layzell27726662017-10-24 23:16:35 -04001437 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay8894f602017-11-11 12:11:04 -08001438 ident: _i . ident,
1439 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001440 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnay8894f602017-11-11 12:11:04 -08001441 semi_token: _i . semi_token,
Nika Layzell27726662017-10-24 23:16:35 -04001442 }
1443}
David Tolnay199bcbb2017-11-12 10:33:52 -08001444# [ cfg ( feature = "full" ) ]
1445pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1446 ForeignItemType {
1447 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1448 vis: _visitor.fold_visibility(_i . vis),
1449 type_token: _i . type_token,
1450 ident: _i . ident,
1451 semi_token: _i . semi_token,
1452 }
1453}
Nika Layzell27726662017-10-24 23:16:35 -04001454
Nika Layzellc08227a2017-12-04 16:30:17 -05001455pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1456 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001457 match _i {
1458 Lifetime(_binding_0, ) => {
1459 Lifetime (
1460 _binding_0,
1461 )
1462 }
1463 Type(_binding_0, ) => {
1464 Type (
1465 _visitor.fold_type(_binding_0),
1466 )
1467 }
1468 TypeBinding(_binding_0, ) => {
1469 TypeBinding (
1470 _visitor.fold_type_binding(_binding_0),
1471 )
1472 }
Nika Layzellc680e612017-12-04 19:07:20 -05001473 Const(_binding_0, ) => {
1474 Const (
1475 full!(_visitor.fold_expr_block(_binding_0)),
1476 )
1477 }
Nika Layzell357885a2017-12-04 15:47:07 -05001478 }
1479}
1480
David Tolnayc2f1aba2017-11-12 20:29:22 -08001481pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1482 use ::GenericParam::*;
1483 match _i {
1484 Lifetime(_binding_0, ) => {
1485 Lifetime (
1486 _visitor.fold_lifetime_def(_binding_0),
1487 )
1488 }
1489 Type(_binding_0, ) => {
1490 Type (
1491 _visitor.fold_type_param(_binding_0),
1492 )
1493 }
1494 }
1495}
1496
Nika Layzella6f46c42017-10-26 15:26:16 -04001497pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001498 Generics {
1499 lt_token: _i . lt_token,
David Tolnayc2f1aba2017-11-12 20:29:22 -08001500 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001501 gt_token: _i . gt_token,
Nika Layzell27726662017-10-24 23:16:35 -04001502 where_clause: _visitor.fold_where_clause(_i . where_clause),
1503 }
1504}
1505# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001506pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001507 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001508 match _i {
1509 Const(_binding_0, ) => {
1510 Const (
1511 _visitor.fold_impl_item_const(_binding_0),
1512 )
1513 }
1514 Method(_binding_0, ) => {
1515 Method (
1516 _visitor.fold_impl_item_method(_binding_0),
1517 )
1518 }
1519 Type(_binding_0, ) => {
1520 Type (
1521 _visitor.fold_impl_item_type(_binding_0),
1522 )
1523 }
1524 Macro(_binding_0, ) => {
1525 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001526 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001527 )
1528 }
1529 }
1530}
1531# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001532pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1533 ImplItemConst {
1534 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1535 vis: _visitor.fold_visibility(_i . vis),
1536 defaultness: _visitor.fold_defaultness(_i . defaultness),
1537 const_token: _i . const_token,
1538 ident: _i . ident,
1539 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001540 ty: _visitor.fold_type(_i . ty),
David Tolnay857628c2017-11-11 12:25:31 -08001541 eq_token: _i . eq_token,
1542 expr: _visitor.fold_expr(_i . expr),
1543 semi_token: _i . semi_token,
1544 }
1545}
1546# [ cfg ( feature = "full" ) ]
1547pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1548 ImplItemMacro {
1549 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1550 mac: _visitor.fold_macro(_i . mac),
1551 }
1552}
1553# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001554pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001555 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001556 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001557 vis: _visitor.fold_visibility(_i . vis),
1558 defaultness: _visitor.fold_defaultness(_i . defaultness),
1559 sig: _visitor.fold_method_sig(_i . sig),
1560 block: _visitor.fold_block(_i . block),
1561 }
1562}
1563# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001564pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001565 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001566 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001567 vis: _visitor.fold_visibility(_i . vis),
1568 defaultness: _visitor.fold_defaultness(_i . defaultness),
1569 type_token: _i . type_token,
1570 ident: _i . ident,
1571 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001572 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001573 semi_token: _i . semi_token,
1574 }
1575}
1576# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001577pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001578 use ::ImplPolarity::*;
1579 match _i {
1580 Positive => { Positive }
1581 Negative(_binding_0, ) => {
1582 Negative (
1583 _binding_0,
1584 )
1585 }
1586 }
1587}
1588# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001589pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001590 use ::InPlaceKind::*;
1591 match _i {
1592 Arrow(_binding_0, ) => {
1593 Arrow (
1594 _binding_0,
1595 )
1596 }
1597 In(_binding_0, ) => {
1598 In (
1599 _binding_0,
1600 )
1601 }
1602 }
1603}
1604# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001605pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001606 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001607 match _i {
1608 ExternCrate(_binding_0, ) => {
1609 ExternCrate (
1610 _visitor.fold_item_extern_crate(_binding_0),
1611 )
1612 }
1613 Use(_binding_0, ) => {
1614 Use (
1615 _visitor.fold_item_use(_binding_0),
1616 )
1617 }
1618 Static(_binding_0, ) => {
1619 Static (
1620 _visitor.fold_item_static(_binding_0),
1621 )
1622 }
1623 Const(_binding_0, ) => {
1624 Const (
1625 _visitor.fold_item_const(_binding_0),
1626 )
1627 }
1628 Fn(_binding_0, ) => {
1629 Fn (
1630 _visitor.fold_item_fn(_binding_0),
1631 )
1632 }
1633 Mod(_binding_0, ) => {
1634 Mod (
1635 _visitor.fold_item_mod(_binding_0),
1636 )
1637 }
1638 ForeignMod(_binding_0, ) => {
1639 ForeignMod (
1640 _visitor.fold_item_foreign_mod(_binding_0),
1641 )
1642 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001643 Type(_binding_0, ) => {
1644 Type (
1645 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001646 )
1647 }
1648 Enum(_binding_0, ) => {
1649 Enum (
1650 _visitor.fold_item_enum(_binding_0),
1651 )
1652 }
1653 Struct(_binding_0, ) => {
1654 Struct (
1655 _visitor.fold_item_struct(_binding_0),
1656 )
1657 }
1658 Union(_binding_0, ) => {
1659 Union (
1660 _visitor.fold_item_union(_binding_0),
1661 )
1662 }
1663 Trait(_binding_0, ) => {
1664 Trait (
1665 _visitor.fold_item_trait(_binding_0),
1666 )
1667 }
1668 DefaultImpl(_binding_0, ) => {
1669 DefaultImpl (
1670 _visitor.fold_item_default_impl(_binding_0),
1671 )
1672 }
1673 Impl(_binding_0, ) => {
1674 Impl (
1675 _visitor.fold_item_impl(_binding_0),
1676 )
1677 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001678 Macro(_binding_0, ) => {
1679 Macro (
1680 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001681 )
1682 }
1683 }
1684}
1685# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001686pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1687 ItemConst {
1688 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1689 vis: _visitor.fold_visibility(_i . vis),
1690 const_token: _i . const_token,
1691 ident: _i . ident,
1692 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001693 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001694 eq_token: _i . eq_token,
1695 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1696 semi_token: _i . semi_token,
1697 }
1698}
1699# [ cfg ( feature = "full" ) ]
1700pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1701 ItemDefaultImpl {
1702 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1703 unsafety: _visitor.fold_unsafety(_i . unsafety),
1704 impl_token: _i . impl_token,
1705 path: _visitor.fold_path(_i . path),
1706 for_token: _i . for_token,
1707 dot2_token: _i . dot2_token,
1708 brace_token: _i . brace_token,
1709 }
1710}
1711# [ cfg ( feature = "full" ) ]
1712pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1713 ItemEnum {
1714 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1715 vis: _visitor.fold_visibility(_i . vis),
1716 enum_token: _i . enum_token,
1717 ident: _i . ident,
1718 generics: _visitor.fold_generics(_i . generics),
1719 brace_token: _i . brace_token,
1720 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1721 }
1722}
1723# [ cfg ( feature = "full" ) ]
1724pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1725 ItemExternCrate {
1726 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1727 vis: _visitor.fold_visibility(_i . vis),
1728 extern_token: _i . extern_token,
1729 crate_token: _i . crate_token,
1730 ident: _i . ident,
1731 rename: _i . rename,
1732 semi_token: _i . semi_token,
1733 }
1734}
1735# [ cfg ( feature = "full" ) ]
1736pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1737 ItemFn {
1738 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1739 vis: _visitor.fold_visibility(_i . vis),
1740 constness: _visitor.fold_constness(_i . constness),
1741 unsafety: _visitor.fold_unsafety(_i . unsafety),
1742 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1743 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1744 ident: _i . ident,
1745 block: Box::new(_visitor.fold_block(* _i . block)),
1746 }
1747}
1748# [ cfg ( feature = "full" ) ]
1749pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1750 ItemForeignMod {
1751 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1752 abi: _visitor.fold_abi(_i . abi),
1753 brace_token: _i . brace_token,
1754 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1755 }
1756}
1757# [ cfg ( feature = "full" ) ]
1758pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1759 ItemImpl {
1760 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1761 defaultness: _visitor.fold_defaultness(_i . defaultness),
1762 unsafety: _visitor.fold_unsafety(_i . unsafety),
1763 impl_token: _i . impl_token,
1764 generics: _visitor.fold_generics(_i . generics),
1765 trait_: _i . trait_,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001766 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001767 brace_token: _i . brace_token,
1768 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1769 }
1770}
1771# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001772pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1773 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001774 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay99a953d2017-11-11 12:51:43 -08001775 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001776 mac: _visitor.fold_macro(_i . mac),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001777 }
1778}
1779# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001780pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001781 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001782 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001783 vis: _visitor.fold_visibility(_i . vis),
1784 mod_token: _i . mod_token,
1785 ident: _i . ident,
1786 content: _i . content,
1787 semi: _i . semi,
1788 }
1789}
1790# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001791pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001792 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001794 vis: _visitor.fold_visibility(_i . vis),
1795 static_token: _i . static_token,
1796 mutbl: _visitor.fold_mutability(_i . mutbl),
1797 ident: _i . ident,
1798 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001799 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001800 eq_token: _i . eq_token,
1801 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1802 semi_token: _i . semi_token,
1803 }
1804}
1805# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001806pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001807 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001808 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001809 vis: _visitor.fold_visibility(_i . vis),
1810 struct_token: _i . struct_token,
1811 ident: _i . ident,
1812 generics: _visitor.fold_generics(_i . generics),
1813 data: _visitor.fold_variant_data(_i . data),
1814 semi_token: _i . semi_token,
1815 }
1816}
1817# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001818pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001819 ItemTrait {
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 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell0dc6e632017-11-18 12:55:25 -05001823 auto_token: _i . auto_token,
Nika Layzell27726662017-10-24 23:16:35 -04001824 trait_token: _i . trait_token,
1825 ident: _i . ident,
1826 generics: _visitor.fold_generics(_i . generics),
1827 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001828 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001829 brace_token: _i . brace_token,
1830 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1831 }
1832}
1833# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001834pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1835 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001836 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001837 vis: _visitor.fold_visibility(_i . vis),
1838 type_token: _i . type_token,
1839 ident: _i . ident,
1840 generics: _visitor.fold_generics(_i . generics),
1841 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001842 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001843 semi_token: _i . semi_token,
1844 }
1845}
1846# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001847pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001848 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001849 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001850 vis: _visitor.fold_visibility(_i . vis),
1851 union_token: _i . union_token,
1852 ident: _i . ident,
1853 generics: _visitor.fold_generics(_i . generics),
1854 data: _visitor.fold_variant_data(_i . data),
1855 }
1856}
1857# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001858pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001859 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001860 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001861 vis: _visitor.fold_visibility(_i . vis),
1862 use_token: _i . use_token,
1863 path: Box::new(_visitor.fold_view_path(* _i . path)),
1864 semi_token: _i . semi_token,
1865 }
1866}
1867
Nika Layzella6f46c42017-10-26 15:26:16 -04001868pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001869 LifetimeDef {
1870 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1871 lifetime: _i . lifetime,
1872 colon_token: _i . colon_token,
1873 bounds: _i . bounds,
1874 }
1875}
1876# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001877pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001878 Local {
1879 let_token: _i . let_token,
1880 colon_token: _i . colon_token,
1881 eq_token: _i . eq_token,
1882 semi_token: _i . semi_token,
1883 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001884 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001885 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001886 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1887 }
1888}
Nika Layzell27726662017-10-24 23:16:35 -04001889# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001890pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
Nika Layzell27726662017-10-24 23:16:35 -04001891 use ::MacStmtStyle::*;
1892 match _i {
1893 Semicolon(_binding_0, ) => {
1894 Semicolon (
1895 _binding_0,
1896 )
1897 }
1898 Braces => { Braces }
1899 NoBraces => { NoBraces }
1900 }
1901}
1902
David Tolnaydecf28d2017-11-11 11:56:45 -08001903pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1904 Macro {
1905 path: _visitor.fold_path(_i . path),
1906 bang_token: _i . bang_token,
David Tolnaydecf28d2017-11-11 11:56:45 -08001907 tokens: _i . tokens,
1908 }
1909}
1910
Nika Layzella6f46c42017-10-26 15:26:16 -04001911pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001912 use ::MetaItem::*;
1913 match _i {
1914 Term(_binding_0, ) => {
1915 Term (
1916 _binding_0,
1917 )
1918 }
1919 List(_binding_0, ) => {
1920 List (
1921 _visitor.fold_meta_item_list(_binding_0),
1922 )
1923 }
1924 NameValue(_binding_0, ) => {
1925 NameValue (
1926 _visitor.fold_meta_name_value(_binding_0),
1927 )
1928 }
1929 }
1930}
1931
Nika Layzella6f46c42017-10-26 15:26:16 -04001932pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001933 MetaItemList {
1934 ident: _i . ident,
1935 paren_token: _i . paren_token,
1936 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1937 }
1938}
1939
Nika Layzella6f46c42017-10-26 15:26:16 -04001940pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001941 MetaNameValue {
1942 ident: _i . ident,
1943 eq_token: _i . eq_token,
1944 lit: _i . lit,
1945 }
1946}
1947# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001948pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001949 MethodSig {
1950 constness: _visitor.fold_constness(_i . constness),
1951 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001952 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001953 ident: _i . ident,
1954 decl: _visitor.fold_fn_decl(_i . decl),
1955 }
1956}
1957
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001958pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1959 MutType {
1960 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001961 mutability: _visitor.fold_mutability(_i . mutability),
1962 }
1963}
1964
Nika Layzella6f46c42017-10-26 15:26:16 -04001965pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04001966 use ::Mutability::*;
1967 match _i {
1968 Mutable(_binding_0, ) => {
1969 Mutable (
1970 _binding_0,
1971 )
1972 }
1973 Immutable => { Immutable }
1974 }
1975}
1976
Nika Layzella6f46c42017-10-26 15:26:16 -04001977pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001978 use ::NestedMetaItem::*;
1979 match _i {
1980 MetaItem(_binding_0, ) => {
1981 MetaItem (
1982 _visitor.fold_meta_item(_binding_0),
1983 )
1984 }
1985 Literal(_binding_0, ) => {
1986 Literal (
1987 _binding_0,
1988 )
1989 }
1990 }
1991}
1992
Nika Layzellc08227a2017-12-04 16:30:17 -05001993pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
1994 ParenthesizedGenericArguments {
Nika Layzell27726662017-10-24 23:16:35 -04001995 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001996 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001997 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001998 }
1999}
2000# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002001pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002002 use ::Pat::*;
2003 match _i {
2004 Wild(_binding_0, ) => {
2005 Wild (
2006 _visitor.fold_pat_wild(_binding_0),
2007 )
2008 }
2009 Ident(_binding_0, ) => {
2010 Ident (
2011 _visitor.fold_pat_ident(_binding_0),
2012 )
2013 }
2014 Struct(_binding_0, ) => {
2015 Struct (
2016 _visitor.fold_pat_struct(_binding_0),
2017 )
2018 }
2019 TupleStruct(_binding_0, ) => {
2020 TupleStruct (
2021 _visitor.fold_pat_tuple_struct(_binding_0),
2022 )
2023 }
2024 Path(_binding_0, ) => {
2025 Path (
2026 _visitor.fold_pat_path(_binding_0),
2027 )
2028 }
2029 Tuple(_binding_0, ) => {
2030 Tuple (
2031 _visitor.fold_pat_tuple(_binding_0),
2032 )
2033 }
2034 Box(_binding_0, ) => {
2035 Box (
2036 _visitor.fold_pat_box(_binding_0),
2037 )
2038 }
2039 Ref(_binding_0, ) => {
2040 Ref (
2041 _visitor.fold_pat_ref(_binding_0),
2042 )
2043 }
2044 Lit(_binding_0, ) => {
2045 Lit (
2046 _visitor.fold_pat_lit(_binding_0),
2047 )
2048 }
2049 Range(_binding_0, ) => {
2050 Range (
2051 _visitor.fold_pat_range(_binding_0),
2052 )
2053 }
2054 Slice(_binding_0, ) => {
2055 Slice (
2056 _visitor.fold_pat_slice(_binding_0),
2057 )
2058 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002059 Macro(_binding_0, ) => {
2060 Macro (
2061 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002062 )
2063 }
2064 }
2065}
2066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002067pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002068 PatBox {
2069 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2070 box_token: _i . box_token,
2071 }
2072}
2073# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002074pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002075 PatIdent {
2076 mode: _visitor.fold_binding_mode(_i . mode),
2077 ident: _i . ident,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002078 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002079 at_token: _i . at_token,
2080 }
2081}
2082# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002083pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002084 PatLit {
2085 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2086 }
2087}
2088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002089pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002090 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002091 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002092 path: _visitor.fold_path(_i . path),
2093 }
2094}
2095# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002096pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002097 PatRange {
2098 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2099 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2100 limits: _visitor.fold_range_limits(_i . limits),
2101 }
2102}
2103# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002104pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002105 PatRef {
2106 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2107 mutbl: _visitor.fold_mutability(_i . mutbl),
2108 and_token: _i . and_token,
2109 }
2110}
2111# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002112pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002113 PatSlice {
2114 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002115 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002116 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2117 dot2_token: _i . dot2_token,
2118 comma_token: _i . comma_token,
2119 bracket_token: _i . bracket_token,
2120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PatStruct {
2125 path: _visitor.fold_path(_i . path),
2126 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2127 brace_token: _i . brace_token,
2128 dot2_token: _i . dot2_token,
2129 }
2130}
2131# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002132pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002133 PatTuple {
2134 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
2135 dots_pos: _i . dots_pos,
2136 paren_token: _i . paren_token,
2137 dot2_token: _i . dot2_token,
2138 comma_token: _i . comma_token,
2139 }
2140}
2141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002142pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002143 PatTupleStruct {
2144 path: _visitor.fold_path(_i . path),
2145 pat: _visitor.fold_pat_tuple(_i . pat),
2146 }
2147}
2148# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002149pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002150 PatWild {
2151 underscore_token: _i . underscore_token,
2152 }
2153}
2154
Nika Layzella6f46c42017-10-26 15:26:16 -04002155pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002156 Path {
2157 leading_colon: _i . leading_colon,
2158 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2159 }
2160}
Nika Layzellc08227a2017-12-04 16:30:17 -05002161
2162pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2163 use ::PathArguments::*;
2164 match _i {
2165 None => { None }
2166 AngleBracketed(_binding_0, ) => {
2167 AngleBracketed (
2168 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2169 )
2170 }
2171 Parenthesized(_binding_0, ) => {
2172 Parenthesized (
2173 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2174 )
2175 }
2176 }
2177}
Nika Layzell27726662017-10-24 23:16:35 -04002178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002179pub fn fold_path_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: PathGlob) -> PathGlob {
Nika Layzell27726662017-10-24 23:16:35 -04002180 PathGlob {
2181 path: _visitor.fold_path(_i . path),
2182 colon2_token: _i . colon2_token,
2183 star_token: _i . star_token,
2184 }
2185}
2186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_path_list<V: Folder + ?Sized>(_visitor: &mut V, _i: PathList) -> PathList {
Nika Layzell27726662017-10-24 23:16:35 -04002188 PathList {
2189 path: _visitor.fold_path(_i . path),
2190 colon2_token: _i . colon2_token,
2191 brace_token: _i . brace_token,
2192 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_path_list_item(it) }),
2193 }
2194}
2195# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002196pub fn fold_path_list_item<V: Folder + ?Sized>(_visitor: &mut V, _i: PathListItem) -> PathListItem {
Nika Layzell27726662017-10-24 23:16:35 -04002197 PathListItem {
2198 name: _i . name,
2199 rename: _i . rename,
2200 as_token: _i . as_token,
2201 }
2202}
2203
Nika Layzella6f46c42017-10-26 15:26:16 -04002204pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002205 PathSegment {
2206 ident: _i . ident,
Nika Layzellc08227a2017-12-04 16:30:17 -05002207 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002208 }
2209}
2210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002211pub fn fold_path_simple<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSimple) -> PathSimple {
Nika Layzell27726662017-10-24 23:16:35 -04002212 PathSimple {
2213 path: _visitor.fold_path(_i . path),
2214 as_token: _i . as_token,
2215 rename: _i . rename,
2216 }
2217}
2218
Nika Layzella6f46c42017-10-26 15:26:16 -04002219pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002220 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002221 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002222 trait_ref: _visitor.fold_path(_i . trait_ref),
2223 }
2224}
2225
Nika Layzella6f46c42017-10-26 15:26:16 -04002226pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002227 QSelf {
2228 lt_token: _i . lt_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002229 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002230 position: _i . position,
2231 as_token: _i . as_token,
2232 gt_token: _i . gt_token,
2233 }
2234}
2235# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002236pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002237 use ::RangeLimits::*;
2238 match _i {
2239 HalfOpen(_binding_0, ) => {
2240 HalfOpen (
2241 _binding_0,
2242 )
2243 }
2244 Closed(_binding_0, ) => {
2245 Closed (
2246 _binding_0,
2247 )
2248 }
2249 }
2250}
David Tolnayf93b90d2017-11-11 19:21:26 -08002251
2252pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2253 use ::ReturnType::*;
2254 match _i {
2255 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002256 Type(_binding_0, _binding_1, ) => {
2257 Type (
2258 _visitor.fold_type(_binding_0),
David Tolnayf93b90d2017-11-11 19:21:26 -08002259 _binding_1,
2260 )
2261 }
2262 }
2263}
Nika Layzell27726662017-10-24 23:16:35 -04002264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002265pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002266 use ::Stmt::*;
2267 match _i {
2268 Local(_binding_0, ) => {
2269 Local (
2270 Box::new(_visitor.fold_local(* _binding_0)),
2271 )
2272 }
2273 Item(_binding_0, ) => {
2274 Item (
2275 Box::new(_visitor.fold_item(* _binding_0)),
2276 )
2277 }
2278 Expr(_binding_0, ) => {
2279 Expr (
2280 Box::new(_visitor.fold_expr(* _binding_0)),
2281 )
2282 }
2283 Semi(_binding_0, _binding_1, ) => {
2284 Semi (
2285 Box::new(_visitor.fold_expr(* _binding_0)),
2286 _binding_1,
2287 )
2288 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002289 Macro(_binding_0, ) => {
2290 Macro (
Nika Layzell27726662017-10-24 23:16:35 -04002291 _binding_0,
2292 )
2293 }
2294 }
2295}
2296
Nika Layzella6f46c42017-10-26 15:26:16 -04002297pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002298 use ::TraitBoundModifier::*;
2299 match _i {
2300 None => { None }
2301 Maybe(_binding_0, ) => {
2302 Maybe (
2303 _binding_0,
2304 )
2305 }
2306 }
2307}
2308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002309pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002310 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002311 match _i {
2312 Const(_binding_0, ) => {
2313 Const (
2314 _visitor.fold_trait_item_const(_binding_0),
2315 )
2316 }
2317 Method(_binding_0, ) => {
2318 Method (
2319 _visitor.fold_trait_item_method(_binding_0),
2320 )
2321 }
2322 Type(_binding_0, ) => {
2323 Type (
2324 _visitor.fold_trait_item_type(_binding_0),
2325 )
2326 }
2327 Macro(_binding_0, ) => {
2328 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002329 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002330 )
2331 }
2332 }
2333}
2334# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002335pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2336 TraitItemConst {
2337 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2338 const_token: _i . const_token,
2339 ident: _i . ident,
2340 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002341 ty: _visitor.fold_type(_i . ty),
David Tolnayda705bd2017-11-10 21:58:05 -08002342 default: _i . default,
2343 semi_token: _i . semi_token,
2344 }
2345}
2346# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002347pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2348 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002349 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002350 mac: _visitor.fold_macro(_i . mac),
David Tolnayda705bd2017-11-10 21:58:05 -08002351 }
2352}
2353# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002354pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002355 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002356 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002357 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002358 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002359 semi_token: _i . semi_token,
2360 }
2361}
2362# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002363pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002364 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002365 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002366 type_token: _i . type_token,
2367 ident: _i . ident,
2368 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002369 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002370 default: _i . default,
2371 semi_token: _i . semi_token,
2372 }
2373}
2374
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002375pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2376 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002377 match _i {
2378 Slice(_binding_0, ) => {
2379 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002380 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002381 )
2382 }
2383 Array(_binding_0, ) => {
2384 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002385 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002386 )
2387 }
2388 Ptr(_binding_0, ) => {
2389 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002390 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002391 )
2392 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002393 Reference(_binding_0, ) => {
2394 Reference (
2395 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002396 )
2397 }
2398 BareFn(_binding_0, ) => {
2399 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002400 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002401 )
2402 }
2403 Never(_binding_0, ) => {
2404 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002405 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002406 )
2407 }
2408 Tup(_binding_0, ) => {
2409 Tup (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002410 _visitor.fold_type_tup(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002411 )
2412 }
2413 Path(_binding_0, ) => {
2414 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002416 )
2417 }
2418 TraitObject(_binding_0, ) => {
2419 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002420 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002421 )
2422 }
2423 ImplTrait(_binding_0, ) => {
2424 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002426 )
2427 }
2428 Paren(_binding_0, ) => {
2429 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002430 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002431 )
2432 }
2433 Group(_binding_0, ) => {
2434 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002435 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002436 )
2437 }
2438 Infer(_binding_0, ) => {
2439 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002440 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002441 )
2442 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002443 Macro(_binding_0, ) => {
2444 Macro (
2445 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002446 )
2447 }
2448 }
2449}
2450
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002451pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2452 TypeArray {
Nika Layzell27726662017-10-24 23:16:35 -04002453 bracket_token: _i . bracket_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002454 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002455 semi_token: _i . semi_token,
2456 amt: _visitor.fold_expr(_i . amt),
2457 }
2458}
2459
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002460pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2461 TypeBareFn {
2462 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002463 }
2464}
2465
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2467 TypeBinding {
2468 ident: _i . ident,
2469 eq_token: _i . eq_token,
2470 ty: _visitor.fold_type(_i . ty),
2471 }
2472}
2473
2474pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2475 TypeGroup {
Nika Layzell27726662017-10-24 23:16:35 -04002476 group_token: _i . group_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002477 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002478 }
2479}
2480
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002481pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2482 TypeImplTrait {
Nika Layzell27726662017-10-24 23:16:35 -04002483 impl_token: _i . impl_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002484 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002485 }
2486}
2487
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002488pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2489 TypeInfer {
Nika Layzell27726662017-10-24 23:16:35 -04002490 underscore_token: _i . underscore_token,
2491 }
2492}
2493
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002494pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2495 TypeNever {
Nika Layzell27726662017-10-24 23:16:35 -04002496 bang_token: _i . bang_token,
2497 }
2498}
2499
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002500pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2501 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002502 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2503 ident: _i . ident,
2504 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002505 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002506 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002507 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002508 }
2509}
2510
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002511pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2512 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002513 match _i {
2514 Trait(_binding_0, _binding_1, ) => {
2515 Trait (
2516 _visitor.fold_poly_trait_ref(_binding_0),
2517 _visitor.fold_trait_bound_modifier(_binding_1),
2518 )
2519 }
2520 Region(_binding_0, ) => {
2521 Region (
2522 _binding_0,
2523 )
2524 }
2525 }
2526}
2527
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002528pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2529 TypeParen {
Nika Layzell27726662017-10-24 23:16:35 -04002530 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002531 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002532 }
2533}
2534
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2536 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002537 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002538 path: _visitor.fold_path(_i . path),
2539 }
2540}
2541
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002542pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2543 TypePtr {
Nika Layzell27726662017-10-24 23:16:35 -04002544 star_token: _i . star_token,
2545 const_token: _i . const_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002546 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002547 }
2548}
2549
David Tolnay0a89b4d2017-11-13 00:55:45 -08002550pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2551 TypeReference {
Nika Layzell27726662017-10-24 23:16:35 -04002552 and_token: _i . and_token,
2553 lifetime: _i . lifetime,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002554 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002555 }
2556}
2557
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002558pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2559 TypeSlice {
2560 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002561 bracket_token: _i . bracket_token,
2562 }
2563}
2564
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2566 TypeTraitObject {
2567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002568 }
2569}
2570
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002571pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
2572 TypeTup {
Nika Layzell27726662017-10-24 23:16:35 -04002573 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002574 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002575 lone_comma: _i . lone_comma,
2576 }
2577}
2578
Nika Layzella6f46c42017-10-26 15:26:16 -04002579pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002580 use ::UnOp::*;
2581 match _i {
2582 Deref(_binding_0, ) => {
2583 Deref (
2584 _binding_0,
2585 )
2586 }
2587 Not(_binding_0, ) => {
2588 Not (
2589 _binding_0,
2590 )
2591 }
2592 Neg(_binding_0, ) => {
2593 Neg (
2594 _binding_0,
2595 )
2596 }
2597 }
2598}
2599
Nika Layzella6f46c42017-10-26 15:26:16 -04002600pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002601 use ::Unsafety::*;
2602 match _i {
2603 Unsafe(_binding_0, ) => {
2604 Unsafe (
2605 _binding_0,
2606 )
2607 }
2608 Normal => { Normal }
2609 }
2610}
2611
Nika Layzella6f46c42017-10-26 15:26:16 -04002612pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002613 Variant {
2614 ident: _i . ident,
2615 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2616 data: _visitor.fold_variant_data(_i . data),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002617 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002618 eq_token: _i . eq_token,
2619 }
2620}
2621
Nika Layzella6f46c42017-10-26 15:26:16 -04002622pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002623 use ::VariantData::*;
2624 match _i {
2625 Struct(_binding_0, _binding_1, ) => {
2626 Struct (
2627 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2628 _binding_1,
2629 )
2630 }
2631 Tuple(_binding_0, _binding_1, ) => {
2632 Tuple (
2633 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2634 _binding_1,
2635 )
2636 }
2637 Unit => { Unit }
2638 }
2639}
2640# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002641pub fn fold_view_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ViewPath) -> ViewPath {
Nika Layzell27726662017-10-24 23:16:35 -04002642 use ::ViewPath::*;
2643 match _i {
2644 Simple(_binding_0, ) => {
2645 Simple (
2646 _visitor.fold_path_simple(_binding_0),
2647 )
2648 }
2649 Glob(_binding_0, ) => {
2650 Glob (
2651 _visitor.fold_path_glob(_binding_0),
2652 )
2653 }
2654 List(_binding_0, ) => {
2655 List (
2656 _visitor.fold_path_list(_binding_0),
2657 )
2658 }
2659 }
2660}
2661
Nika Layzella6f46c42017-10-26 15:26:16 -04002662pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002663 VisCrate {
2664 pub_token: _i . pub_token,
2665 paren_token: _i . paren_token,
2666 crate_token: _i . crate_token,
2667 }
2668}
2669
Nika Layzella6f46c42017-10-26 15:26:16 -04002670pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002671 VisInherited {
2672 }
2673}
2674
Nika Layzella6f46c42017-10-26 15:26:16 -04002675pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002676 VisPublic {
2677 pub_token: _i . pub_token,
2678 }
2679}
2680
Nika Layzella6f46c42017-10-26 15:26:16 -04002681pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002682 VisRestricted {
2683 pub_token: _i . pub_token,
2684 paren_token: _i . paren_token,
2685 in_token: _i . in_token,
2686 path: Box::new(_visitor.fold_path(* _i . path)),
2687 }
2688}
2689
Nika Layzella6f46c42017-10-26 15:26:16 -04002690pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002691 use ::Visibility::*;
2692 match _i {
2693 Public(_binding_0, ) => {
2694 Public (
2695 _visitor.fold_vis_public(_binding_0),
2696 )
2697 }
2698 Crate(_binding_0, ) => {
2699 Crate (
2700 _visitor.fold_vis_crate(_binding_0),
2701 )
2702 }
2703 Restricted(_binding_0, ) => {
2704 Restricted (
2705 _visitor.fold_vis_restricted(_binding_0),
2706 )
2707 }
2708 Inherited(_binding_0, ) => {
2709 Inherited (
2710 _visitor.fold_vis_inherited(_binding_0),
2711 )
2712 }
2713 }
2714}
2715
Nika Layzella6f46c42017-10-26 15:26:16 -04002716pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002717 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002718 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002719 bounded_ty: _visitor.fold_type(_i . bounded_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002720 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002721 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002722 }
2723}
2724
Nika Layzella6f46c42017-10-26 15:26:16 -04002725pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002726 WhereClause {
2727 where_token: _i . where_token,
2728 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2729 }
2730}
2731
Nika Layzella6f46c42017-10-26 15:26:16 -04002732pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002733 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002734 lhs_ty: _visitor.fold_type(_i . lhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002735 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002736 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002737 }
2738}
2739
Nika Layzella6f46c42017-10-26 15:26:16 -04002740pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002741 use ::WherePredicate::*;
2742 match _i {
2743 BoundPredicate(_binding_0, ) => {
2744 BoundPredicate (
2745 _visitor.fold_where_bound_predicate(_binding_0),
2746 )
2747 }
2748 RegionPredicate(_binding_0, ) => {
2749 RegionPredicate (
2750 _visitor.fold_where_region_predicate(_binding_0),
2751 )
2752 }
2753 EqPredicate(_binding_0, ) => {
2754 EqPredicate (
2755 _visitor.fold_where_eq_predicate(_binding_0),
2756 )
2757 }
2758 }
2759}
2760
Nika Layzella6f46c42017-10-26 15:26:16 -04002761pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002762 WhereRegionPredicate {
2763 lifetime: _i . lifetime,
2764 colon_token: _i . colon_token,
2765 bounds: _i . bounds,
2766 }
2767}
2768