blob: ed7db7c93df31edfe37347de4c49dbce56a6e4c4 [file] [log] [blame]
Nika Layzell27726662017-10-24 23:16:35 -04001
2// THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
3
4//! A Folder represents an AST->AST fold; it accepts an AST piece,
5//! and returns a piece of the same type.
6
7// Unreachable code is generated sometimes without the full feature.
8#![allow(unreachable_code)]
9
Nika Layzella6f46c42017-10-26 15:26:16 -040010use *;
Nika Layzell27726662017-10-24 23:16:35 -040011use synom::delimited::Delimited;
12
13trait FoldHelper {
14 type Item;
15 fn lift<F>(self, f: F) -> Self where F: FnMut(Self::Item) -> Self::Item;
16}
17
18impl<T> FoldHelper for Vec<T> {
19 type Item = T;
20 fn lift<F>(self, f: F) -> Self where F: FnMut(Self::Item) -> Self::Item {
21 self.into_iter().map(f).collect()
22 }
23}
24
25impl<T, U> FoldHelper for Delimited<T, U> {
26 type Item = T;
27 fn lift<F>(self, mut f: F) -> Self where F: FnMut(Self::Item) -> Self::Item {
28 self.into_iter().map(|elem| {
29 let (t, u) = elem.into_tuple();
30 (f(t), u)
31 }).collect::<Vec<(T, Option<U>)>>().into()
32 }
33}
34
Nika Layzell4ab8d6e2017-10-26 09:45:49 -040035
36#[cfg(feature = "full")]
37macro_rules! full {
38 ($e:expr) => { $e }
39}
40
41#[cfg(not(feature = "full"))]
42macro_rules! full {
43 ($e:expr) => { unreachable!() }
44}
45
46
Nika Layzell27726662017-10-24 23:16:35 -040047/// AST->AST fold.
48///
49/// Each method of the Folder trait is a hook to be potentially overridden. Each
50/// method's default implementation recursively visits the substructure of the
51/// input via the `walk` functions, which perform an "identity fold", that
52/// is, they return the same structure that they are given (for example the
53/// `fold_file` method by default calls `fold::walk_file`).
54///
55/// If you want to ensure that your code handles every variant
56/// explicitly, you need to override each method. (And you also need
57/// to monitor future changes to `Folder` in case a new method with a
58/// new default implementation gets introduced.)
59pub trait Folder {
60
Nika Layzella6f46c42017-10-26 15:26:16 -040061fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040062
Nika Layzella6f46c42017-10-26 15:26:16 -040063fn fold_abi_kind(&mut self, i: AbiKind) -> AbiKind { fold_abi_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040064
Nika Layzellc08227a2017-12-04 16:30:17 -050065fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
David Tolnayfd6bf5c2017-11-12 09:41:14 -080083fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500100
101fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_kind(&mut self, i: ExprKind) -> ExprKind { fold_expr_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_expr_tup(&mut self, i: ExprTup) -> ExprTup { fold_expr_tup(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_expr_tup_field(&mut self, i: ExprTupField) -> ExprTupField { fold_expr_tup_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -0500181fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400202# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400203fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800206# [ cfg ( feature = "full" ) ]
207fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208
Nika Layzellc08227a2017-12-04 16:30:17 -0500209fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
Nika Layzell357885a2017-12-04 15:47:07 -0500210
David Tolnayc2f1aba2017-11-12 20:29:22 -0800211fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
212
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800219fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800245fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800255fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
David Tolnaydecf28d2017-11-11 11:56:45 -0800267fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
268
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800277fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282
Nika Layzellc08227a2017-12-04 16:30:17 -0500283fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzellc08227a2017-12-04 16:30:17 -0500310
311fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_path_glob(&mut self, i: PathGlob) -> PathGlob { fold_path_glob(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_path_list(&mut self, i: PathList) -> PathList { fold_path_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_path_list_item(&mut self, i: PathListItem) -> PathListItem { fold_path_list_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_path_simple(&mut self, i: PathSimple) -> PathSimple { fold_path_simple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800328
329fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800339fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400341fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800345fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400348
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800349fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400350
Nika Layzella6f46c42017-10-26 15:26:16 -0400351fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400352
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800353fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
354
355fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
356
357fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
358
359fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
360
361fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
362
363fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
364
365fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
366
367fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
368
369fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
370
David Tolnay0a89b4d2017-11-13 00:55:45 -0800371fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800372
373fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
374
375fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
376
377fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_view_path(&mut self, i: ViewPath) -> ViewPath { fold_view_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_vis_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400402
Nika Layzella6f46c42017-10-26 15:26:16 -0400403fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400404
Nika Layzella6f46c42017-10-26 15:26:16 -0400405fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400406
Nika Layzella6f46c42017-10-26 15:26:16 -0400407fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400408
409}
410
411
Nika Layzella6f46c42017-10-26 15:26:16 -0400412pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400413 Abi {
414 extern_token: _i . extern_token,
415 kind: _visitor.fold_abi_kind(_i . kind),
416 }
417}
418
Nika Layzella6f46c42017-10-26 15:26:16 -0400419pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400420 use ::AbiKind::*;
421 match _i {
422 Named(_binding_0, ) => {
423 Named (
424 _binding_0,
425 )
426 }
427 Default => { Default }
428 }
429}
430
Nika Layzellc08227a2017-12-04 16:30:17 -0500431pub fn fold_angle_bracketed_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
432 AngleBracketedGenericArguments {
Nika Layzell27726662017-10-24 23:16:35 -0400433 turbofish: _i . turbofish,
434 lt_token: _i . lt_token,
Nika Layzellc08227a2017-12-04 16:30:17 -0500435 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400436 gt_token: _i . gt_token,
437 }
438}
439# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400440pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400441 ArgCaptured {
442 pat: _visitor.fold_pat(_i . pat),
443 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800444 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400445 }
446}
447# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400448pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400449 ArgSelf {
450 mutbl: _visitor.fold_mutability(_i . mutbl),
451 self_token: _i . self_token,
452 }
453}
454# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400455pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400456 ArgSelfRef {
457 and_token: _i . and_token,
458 self_token: _i . self_token,
459 lifetime: _i . lifetime,
460 mutbl: _visitor.fold_mutability(_i . mutbl),
461 }
462}
463# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400464pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400465 Arm {
466 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
467 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
468 if_token: _i . if_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400469 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400470 rocket_token: _i . rocket_token,
471 body: Box::new(_visitor.fold_expr(* _i . body)),
472 comma: _i . comma,
473 }
474}
475
Nika Layzella6f46c42017-10-26 15:26:16 -0400476pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400477 use ::AttrStyle::*;
478 match _i {
479 Outer => { Outer }
480 Inner(_binding_0, ) => {
481 Inner (
482 _binding_0,
483 )
484 }
485 }
486}
487
Nika Layzella6f46c42017-10-26 15:26:16 -0400488pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400489 Attribute {
490 style: _visitor.fold_attr_style(_i . style),
491 pound_token: _i . pound_token,
492 bracket_token: _i . bracket_token,
493 path: _visitor.fold_path(_i . path),
494 tts: _i . tts,
495 is_sugared_doc: _i . is_sugared_doc,
496 }
497}
498
Nika Layzella6f46c42017-10-26 15:26:16 -0400499pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400500 BareFnArg {
501 name: _i . name,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800502 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400503 }
504}
505
Nika Layzella6f46c42017-10-26 15:26:16 -0400506pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400507 use ::BareFnArgName::*;
508 match _i {
509 Named(_binding_0, ) => {
510 Named (
511 _binding_0,
512 )
513 }
514 Wild(_binding_0, ) => {
515 Wild (
516 _binding_0,
517 )
518 }
519 }
520}
521
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800522pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
523 BareFnType {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400524 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400525 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400526 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400527 fn_token: _i . fn_token,
528 paren_token: _i . paren_token,
529 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
530 variadic: _i . variadic,
David Tolnayf93b90d2017-11-11 19:21:26 -0800531 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400532 }
533}
534
Nika Layzella6f46c42017-10-26 15:26:16 -0400535pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400536 use ::BinOp::*;
537 match _i {
538 Add(_binding_0, ) => {
539 Add (
540 _binding_0,
541 )
542 }
543 Sub(_binding_0, ) => {
544 Sub (
545 _binding_0,
546 )
547 }
548 Mul(_binding_0, ) => {
549 Mul (
550 _binding_0,
551 )
552 }
553 Div(_binding_0, ) => {
554 Div (
555 _binding_0,
556 )
557 }
558 Rem(_binding_0, ) => {
559 Rem (
560 _binding_0,
561 )
562 }
563 And(_binding_0, ) => {
564 And (
565 _binding_0,
566 )
567 }
568 Or(_binding_0, ) => {
569 Or (
570 _binding_0,
571 )
572 }
573 BitXor(_binding_0, ) => {
574 BitXor (
575 _binding_0,
576 )
577 }
578 BitAnd(_binding_0, ) => {
579 BitAnd (
580 _binding_0,
581 )
582 }
583 BitOr(_binding_0, ) => {
584 BitOr (
585 _binding_0,
586 )
587 }
588 Shl(_binding_0, ) => {
589 Shl (
590 _binding_0,
591 )
592 }
593 Shr(_binding_0, ) => {
594 Shr (
595 _binding_0,
596 )
597 }
598 Eq(_binding_0, ) => {
599 Eq (
600 _binding_0,
601 )
602 }
603 Lt(_binding_0, ) => {
604 Lt (
605 _binding_0,
606 )
607 }
608 Le(_binding_0, ) => {
609 Le (
610 _binding_0,
611 )
612 }
613 Ne(_binding_0, ) => {
614 Ne (
615 _binding_0,
616 )
617 }
618 Ge(_binding_0, ) => {
619 Ge (
620 _binding_0,
621 )
622 }
623 Gt(_binding_0, ) => {
624 Gt (
625 _binding_0,
626 )
627 }
628 AddEq(_binding_0, ) => {
629 AddEq (
630 _binding_0,
631 )
632 }
633 SubEq(_binding_0, ) => {
634 SubEq (
635 _binding_0,
636 )
637 }
638 MulEq(_binding_0, ) => {
639 MulEq (
640 _binding_0,
641 )
642 }
643 DivEq(_binding_0, ) => {
644 DivEq (
645 _binding_0,
646 )
647 }
648 RemEq(_binding_0, ) => {
649 RemEq (
650 _binding_0,
651 )
652 }
653 BitXorEq(_binding_0, ) => {
654 BitXorEq (
655 _binding_0,
656 )
657 }
658 BitAndEq(_binding_0, ) => {
659 BitAndEq (
660 _binding_0,
661 )
662 }
663 BitOrEq(_binding_0, ) => {
664 BitOrEq (
665 _binding_0,
666 )
667 }
668 ShlEq(_binding_0, ) => {
669 ShlEq (
670 _binding_0,
671 )
672 }
673 ShrEq(_binding_0, ) => {
674 ShrEq (
675 _binding_0,
676 )
677 }
678 }
679}
680# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400681pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400682 use ::BindingMode::*;
683 match _i {
684 ByRef(_binding_0, _binding_1, ) => {
685 ByRef (
686 _binding_0,
687 _visitor.fold_mutability(_binding_1),
688 )
689 }
690 ByValue(_binding_0, ) => {
691 ByValue (
692 _visitor.fold_mutability(_binding_0),
693 )
694 }
695 }
696}
697# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400698pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400699 Block {
700 brace_token: _i . brace_token,
701 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
702 }
703}
704
Nika Layzella6f46c42017-10-26 15:26:16 -0400705pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400706 use ::Body::*;
707 match _i {
708 Enum(_binding_0, ) => {
709 Enum (
710 _visitor.fold_body_enum(_binding_0),
711 )
712 }
713 Struct(_binding_0, ) => {
714 Struct (
715 _visitor.fold_body_struct(_binding_0),
716 )
717 }
718 }
719}
720
Nika Layzella6f46c42017-10-26 15:26:16 -0400721pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400722 BodyEnum {
723 enum_token: _i . enum_token,
724 brace_token: _i . brace_token,
725 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
726 }
727}
728
Nika Layzella6f46c42017-10-26 15:26:16 -0400729pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400730 BodyStruct {
731 data: _visitor.fold_variant_data(_i . data),
732 struct_token: _i . struct_token,
733 semi_token: _i . semi_token,
734 }
735}
736
Nika Layzella6f46c42017-10-26 15:26:16 -0400737pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400738 BoundLifetimes {
739 for_token: _i . for_token,
740 lt_token: _i . lt_token,
741 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
742 gt_token: _i . gt_token,
743 }
744}
745# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400746pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400747 use ::CaptureBy::*;
748 match _i {
749 Value(_binding_0, ) => {
750 Value (
751 _binding_0,
752 )
753 }
754 Ref => { Ref }
755 }
756}
Nika Layzellf1fdc0b2017-12-04 19:58:32 -0500757
758pub fn fold_const_param<V: Folder + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
759 ConstParam {
760 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
761 const_token: _i . const_token,
762 ident: _i . ident,
763 colon_token: _i . colon_token,
764 ty: _visitor.fold_type(_i . ty),
765 eq_token: _i . eq_token,
766 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
767 }
768}
Nika Layzell27726662017-10-24 23:16:35 -0400769# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400770pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400771 use ::Constness::*;
772 match _i {
773 Const(_binding_0, ) => {
774 Const (
775 _binding_0,
776 )
777 }
778 NotConst => { NotConst }
779 }
780}
781# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400782pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400783 use ::Defaultness::*;
784 match _i {
785 Default(_binding_0, ) => {
786 Default (
787 _binding_0,
788 )
789 }
790 Final => { Final }
791 }
792}
793
Nika Layzella6f46c42017-10-26 15:26:16 -0400794pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400795 DeriveInput {
796 ident: _i . ident,
797 vis: _visitor.fold_visibility(_i . vis),
798 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
799 generics: _visitor.fold_generics(_i . generics),
800 body: _visitor.fold_body(_i . body),
801 }
802}
803
Nika Layzella6f46c42017-10-26 15:26:16 -0400804pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400805 Expr {
806 node: _visitor.fold_expr_kind(_i . node),
807 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
808 }
809}
810# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400811pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400812 ExprAddrOf {
813 and_token: _i . and_token,
814 mutbl: _visitor.fold_mutability(_i . mutbl),
815 expr: Box::new(_visitor.fold_expr(* _i . expr)),
816 }
817}
818# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400819pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400820 ExprArray {
821 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
822 bracket_token: _i . bracket_token,
823 }
824}
825# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400826pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400827 ExprAssign {
828 left: Box::new(_visitor.fold_expr(* _i . left)),
829 right: Box::new(_visitor.fold_expr(* _i . right)),
830 eq_token: _i . eq_token,
831 }
832}
833# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400834pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400835 ExprAssignOp {
836 op: _visitor.fold_bin_op(_i . op),
837 left: Box::new(_visitor.fold_expr(* _i . left)),
838 right: Box::new(_visitor.fold_expr(* _i . right)),
839 }
840}
841
Nika Layzella6f46c42017-10-26 15:26:16 -0400842pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400843 ExprBinary {
844 op: _visitor.fold_bin_op(_i . op),
845 left: Box::new(_visitor.fold_expr(* _i . left)),
846 right: Box::new(_visitor.fold_expr(* _i . right)),
847 }
848}
849# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400850pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400851 ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400852 block: _visitor.fold_block(_i . block),
853 }
854}
855# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400856pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400857 ExprBox {
858 expr: Box::new(_visitor.fold_expr(* _i . expr)),
859 box_token: _i . box_token,
860 }
861}
862# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400863pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400864 ExprBreak {
865 label: _i . label,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400866 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400867 break_token: _i . break_token,
868 }
869}
870
Nika Layzella6f46c42017-10-26 15:26:16 -0400871pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400872 ExprCall {
873 func: Box::new(_visitor.fold_expr(* _i . func)),
874 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
875 paren_token: _i . paren_token,
876 }
877}
878
Nika Layzella6f46c42017-10-26 15:26:16 -0400879pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400880 ExprCast {
881 expr: Box::new(_visitor.fold_expr(* _i . expr)),
882 as_token: _i . as_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800883 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400884 }
885}
886# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400887pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400888 ExprCatch {
889 do_token: _i . do_token,
890 catch_token: _i . catch_token,
891 block: _visitor.fold_block(_i . block),
892 }
893}
894# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400895pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400896 ExprClosure {
897 capture: _visitor.fold_capture_by(_i . capture),
898 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
899 body: Box::new(_visitor.fold_expr(* _i . body)),
900 or1_token: _i . or1_token,
901 or2_token: _i . or2_token,
902 }
903}
904# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400905pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400906 ExprContinue {
907 label: _i . label,
908 continue_token: _i . continue_token,
909 }
910}
911# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400912pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400913 ExprField {
914 expr: Box::new(_visitor.fold_expr(* _i . expr)),
915 field: _i . field,
916 dot_token: _i . dot_token,
917 }
918}
919# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400920pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400921 ExprForLoop {
922 pat: Box::new(_visitor.fold_pat(* _i . pat)),
923 expr: Box::new(_visitor.fold_expr(* _i . expr)),
924 body: _visitor.fold_block(_i . body),
925 label: _i . label,
926 for_token: _i . for_token,
927 colon_token: _i . colon_token,
928 in_token: _i . in_token,
929 }
930}
931
Nika Layzella6f46c42017-10-26 15:26:16 -0400932pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400933 ExprGroup {
934 expr: Box::new(_visitor.fold_expr(* _i . expr)),
935 group_token: _i . group_token,
936 }
937}
938# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400939pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400940 ExprIf {
941 cond: Box::new(_visitor.fold_expr(* _i . cond)),
942 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400943 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400944 if_token: _i . if_token,
945 else_token: _i . else_token,
946 }
947}
948# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400949pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400950 ExprIfLet {
951 pat: Box::new(_visitor.fold_pat(* _i . pat)),
952 expr: Box::new(_visitor.fold_expr(* _i . expr)),
953 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400954 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400955 if_token: _i . if_token,
956 let_token: _i . let_token,
957 eq_token: _i . eq_token,
958 else_token: _i . else_token,
959 }
960}
961# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400962pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400963 ExprInPlace {
964 place: Box::new(_visitor.fold_expr(* _i . place)),
965 kind: _visitor.fold_in_place_kind(_i . kind),
966 value: Box::new(_visitor.fold_expr(* _i . value)),
967 }
968}
969
Nika Layzella6f46c42017-10-26 15:26:16 -0400970pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400971 ExprIndex {
972 expr: Box::new(_visitor.fold_expr(* _i . expr)),
973 index: Box::new(_visitor.fold_expr(* _i . index)),
974 bracket_token: _i . bracket_token,
975 }
976}
977
Nika Layzella6f46c42017-10-26 15:26:16 -0400978pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400979 use ::ExprKind::*;
980 match _i {
981 Box(_binding_0, ) => {
982 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400983 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400984 )
985 }
986 InPlace(_binding_0, ) => {
987 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400988 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400989 )
990 }
991 Array(_binding_0, ) => {
992 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400993 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400994 )
995 }
996 Call(_binding_0, ) => {
997 Call (
998 _visitor.fold_expr_call(_binding_0),
999 )
1000 }
1001 MethodCall(_binding_0, ) => {
1002 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001003 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001004 )
1005 }
1006 Tup(_binding_0, ) => {
1007 Tup (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001008 full!(_visitor.fold_expr_tup(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001009 )
1010 }
1011 Binary(_binding_0, ) => {
1012 Binary (
1013 _visitor.fold_expr_binary(_binding_0),
1014 )
1015 }
1016 Unary(_binding_0, ) => {
1017 Unary (
1018 _visitor.fold_expr_unary(_binding_0),
1019 )
1020 }
1021 Lit(_binding_0, ) => {
1022 Lit (
1023 _binding_0,
1024 )
1025 }
1026 Cast(_binding_0, ) => {
1027 Cast (
1028 _visitor.fold_expr_cast(_binding_0),
1029 )
1030 }
1031 Type(_binding_0, ) => {
1032 Type (
1033 _visitor.fold_expr_type(_binding_0),
1034 )
1035 }
1036 If(_binding_0, ) => {
1037 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001038 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001039 )
1040 }
1041 IfLet(_binding_0, ) => {
1042 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001043 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001044 )
1045 }
1046 While(_binding_0, ) => {
1047 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001048 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001049 )
1050 }
1051 WhileLet(_binding_0, ) => {
1052 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001053 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001054 )
1055 }
1056 ForLoop(_binding_0, ) => {
1057 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001058 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001059 )
1060 }
1061 Loop(_binding_0, ) => {
1062 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001063 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001064 )
1065 }
1066 Match(_binding_0, ) => {
1067 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001068 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001069 )
1070 }
1071 Closure(_binding_0, ) => {
1072 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001073 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001074 )
1075 }
Nika Layzell640832a2017-12-04 13:37:09 -05001076 Unsafe(_binding_0, ) => {
1077 Unsafe (
1078 full!(_visitor.fold_expr_unsafe(_binding_0)),
1079 )
1080 }
Nika Layzell27726662017-10-24 23:16:35 -04001081 Block(_binding_0, ) => {
1082 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001083 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001084 )
1085 }
1086 Assign(_binding_0, ) => {
1087 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001088 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001089 )
1090 }
1091 AssignOp(_binding_0, ) => {
1092 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001093 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001094 )
1095 }
1096 Field(_binding_0, ) => {
1097 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001098 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001099 )
1100 }
1101 TupField(_binding_0, ) => {
1102 TupField (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001103 full!(_visitor.fold_expr_tup_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001104 )
1105 }
1106 Index(_binding_0, ) => {
1107 Index (
1108 _visitor.fold_expr_index(_binding_0),
1109 )
1110 }
1111 Range(_binding_0, ) => {
1112 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001113 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001114 )
1115 }
1116 Path(_binding_0, ) => {
1117 Path (
1118 _visitor.fold_expr_path(_binding_0),
1119 )
1120 }
1121 AddrOf(_binding_0, ) => {
1122 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001123 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001124 )
1125 }
1126 Break(_binding_0, ) => {
1127 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001128 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001129 )
1130 }
1131 Continue(_binding_0, ) => {
1132 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001133 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001134 )
1135 }
1136 Ret(_binding_0, ) => {
1137 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001138 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001139 )
1140 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001141 Macro(_binding_0, ) => {
1142 Macro (
1143 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001144 )
1145 }
1146 Struct(_binding_0, ) => {
1147 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001148 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001149 )
1150 }
1151 Repeat(_binding_0, ) => {
1152 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001153 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001154 )
1155 }
1156 Paren(_binding_0, ) => {
1157 Paren (
1158 _visitor.fold_expr_paren(_binding_0),
1159 )
1160 }
1161 Group(_binding_0, ) => {
1162 Group (
1163 _visitor.fold_expr_group(_binding_0),
1164 )
1165 }
1166 Try(_binding_0, ) => {
1167 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001168 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001169 )
1170 }
1171 Catch(_binding_0, ) => {
1172 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001173 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001174 )
1175 }
1176 Yield(_binding_0, ) => {
1177 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001178 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001179 )
1180 }
1181 }
1182}
1183# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001184pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001185 ExprLoop {
1186 body: _visitor.fold_block(_i . body),
1187 label: _i . label,
1188 loop_token: _i . loop_token,
1189 colon_token: _i . colon_token,
1190 }
1191}
1192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001193pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001194 ExprMatch {
1195 match_token: _i . match_token,
1196 brace_token: _i . brace_token,
1197 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1198 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1199 }
1200}
1201# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001202pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001203 ExprMethodCall {
1204 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1205 method: _i . method,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001206 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001207 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1208 paren_token: _i . paren_token,
1209 dot_token: _i . dot_token,
1210 lt_token: _i . lt_token,
1211 colon2_token: _i . colon2_token,
1212 gt_token: _i . gt_token,
1213 }
1214}
1215
Nika Layzella6f46c42017-10-26 15:26:16 -04001216pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprParen {
1218 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1219 paren_token: _i . paren_token,
1220 }
1221}
1222
Nika Layzella6f46c42017-10-26 15:26:16 -04001223pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001224 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001225 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001226 path: _visitor.fold_path(_i . path),
1227 }
1228}
1229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001230pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001231 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001232 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1233 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001234 limits: _visitor.fold_range_limits(_i . limits),
1235 }
1236}
1237# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001238pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001239 ExprRepeat {
1240 bracket_token: _i . bracket_token,
1241 semi_token: _i . semi_token,
1242 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1243 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1244 }
1245}
1246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001247pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001248 ExprRet {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001249 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001250 return_token: _i . return_token,
1251 }
1252}
1253# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001254pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001255 ExprStruct {
1256 path: _visitor.fold_path(_i . path),
1257 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001258 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001259 dot2_token: _i . dot2_token,
1260 brace_token: _i . brace_token,
1261 }
1262}
1263# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001264pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001265 ExprTry {
1266 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1267 question_token: _i . question_token,
1268 }
1269}
1270# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001271pub fn fold_expr_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTup) -> ExprTup {
Nika Layzell27726662017-10-24 23:16:35 -04001272 ExprTup {
1273 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1274 paren_token: _i . paren_token,
1275 lone_comma: _i . lone_comma,
1276 }
1277}
1278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001279pub fn fold_expr_tup_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTupField) -> ExprTupField {
Nika Layzell27726662017-10-24 23:16:35 -04001280 ExprTupField {
1281 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1282 field: _i . field,
1283 dot_token: _i . dot_token,
1284 }
1285}
1286
Nika Layzella6f46c42017-10-26 15:26:16 -04001287pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001288 ExprType {
1289 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1290 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001291 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001292 }
1293}
1294
Nika Layzella6f46c42017-10-26 15:26:16 -04001295pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001296 ExprUnary {
1297 op: _visitor.fold_un_op(_i . op),
1298 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1299 }
1300}
1301# [ cfg ( feature = "full" ) ]
Nika Layzell640832a2017-12-04 13:37:09 -05001302pub fn fold_expr_unsafe<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1303 ExprUnsafe {
1304 unsafe_token: _i . unsafe_token,
1305 block: _visitor.fold_block(_i . block),
1306 }
1307}
1308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001309pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001310 ExprWhile {
1311 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1312 body: _visitor.fold_block(_i . body),
1313 label: _i . label,
1314 colon_token: _i . colon_token,
1315 while_token: _i . while_token,
1316 }
1317}
1318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001319pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001320 ExprWhileLet {
1321 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1322 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1323 body: _visitor.fold_block(_i . body),
1324 label: _i . label,
1325 colon_token: _i . colon_token,
1326 while_token: _i . while_token,
1327 let_token: _i . let_token,
1328 eq_token: _i . eq_token,
1329 }
1330}
1331# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001332pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001333 ExprYield {
1334 yield_token: _i . yield_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001335 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001336 }
1337}
1338
Nika Layzella6f46c42017-10-26 15:26:16 -04001339pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001340 Field {
1341 ident: _i . ident,
1342 vis: _visitor.fold_visibility(_i . vis),
1343 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001344 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001345 colon_token: _i . colon_token,
1346 }
1347}
1348# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001349pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001350 FieldPat {
1351 ident: _i . ident,
1352 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1353 is_shorthand: _i . is_shorthand,
1354 colon_token: _i . colon_token,
1355 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1356 }
1357}
1358# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001359pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001360 FieldValue {
1361 ident: _i . ident,
1362 expr: _visitor.fold_expr(_i . expr),
1363 is_shorthand: _i . is_shorthand,
1364 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1365 colon_token: _i . colon_token,
1366 }
1367}
1368# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001369pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001370 File {
1371 shebang: _i . shebang,
1372 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1373 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1374 }
1375}
1376# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001377pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001378 use ::FnArg::*;
1379 match _i {
1380 SelfRef(_binding_0, ) => {
1381 SelfRef (
1382 _visitor.fold_arg_self_ref(_binding_0),
1383 )
1384 }
1385 SelfValue(_binding_0, ) => {
1386 SelfValue (
1387 _visitor.fold_arg_self(_binding_0),
1388 )
1389 }
1390 Captured(_binding_0, ) => {
1391 Captured (
1392 _visitor.fold_arg_captured(_binding_0),
1393 )
1394 }
1395 Ignored(_binding_0, ) => {
1396 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001397 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001398 )
1399 }
1400 }
1401}
1402# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001403pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001404 FnDecl {
1405 fn_token: _i . fn_token,
1406 paren_token: _i . paren_token,
1407 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001408 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001409 generics: _visitor.fold_generics(_i . generics),
1410 variadic: _i . variadic,
1411 dot_tokens: _i . dot_tokens,
1412 }
1413}
1414# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001415pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001416 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001417 match _i {
1418 Fn(_binding_0, ) => {
1419 Fn (
1420 _visitor.fold_foreign_item_fn(_binding_0),
1421 )
1422 }
1423 Static(_binding_0, ) => {
1424 Static (
1425 _visitor.fold_foreign_item_static(_binding_0),
1426 )
1427 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001428 Type(_binding_0, ) => {
1429 Type (
1430 _visitor.fold_foreign_item_type(_binding_0),
1431 )
1432 }
Nika Layzell27726662017-10-24 23:16:35 -04001433 }
1434}
1435# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001436pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1437 ForeignItemFn {
1438 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1439 vis: _visitor.fold_visibility(_i . vis),
1440 ident: _i . ident,
1441 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1442 semi_token: _i . semi_token,
1443 }
1444}
1445# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001446pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001447 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001448 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1449 vis: _visitor.fold_visibility(_i . vis),
Nika Layzell27726662017-10-24 23:16:35 -04001450 static_token: _i . static_token,
Nika Layzell27726662017-10-24 23:16:35 -04001451 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay8894f602017-11-11 12:11:04 -08001452 ident: _i . ident,
1453 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001454 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnay8894f602017-11-11 12:11:04 -08001455 semi_token: _i . semi_token,
Nika Layzell27726662017-10-24 23:16:35 -04001456 }
1457}
David Tolnay199bcbb2017-11-12 10:33:52 -08001458# [ cfg ( feature = "full" ) ]
1459pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1460 ForeignItemType {
1461 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1462 vis: _visitor.fold_visibility(_i . vis),
1463 type_token: _i . type_token,
1464 ident: _i . ident,
1465 semi_token: _i . semi_token,
1466 }
1467}
Nika Layzell27726662017-10-24 23:16:35 -04001468
Nika Layzellc08227a2017-12-04 16:30:17 -05001469pub fn fold_generic_argument<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1470 use ::GenericArgument::*;
Nika Layzell357885a2017-12-04 15:47:07 -05001471 match _i {
1472 Lifetime(_binding_0, ) => {
1473 Lifetime (
1474 _binding_0,
1475 )
1476 }
1477 Type(_binding_0, ) => {
1478 Type (
1479 _visitor.fold_type(_binding_0),
1480 )
1481 }
1482 TypeBinding(_binding_0, ) => {
1483 TypeBinding (
1484 _visitor.fold_type_binding(_binding_0),
1485 )
1486 }
Nika Layzellc680e612017-12-04 19:07:20 -05001487 Const(_binding_0, ) => {
1488 Const (
1489 full!(_visitor.fold_expr_block(_binding_0)),
1490 )
1491 }
Nika Layzell357885a2017-12-04 15:47:07 -05001492 }
1493}
1494
David Tolnayc2f1aba2017-11-12 20:29:22 -08001495pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1496 use ::GenericParam::*;
1497 match _i {
1498 Lifetime(_binding_0, ) => {
1499 Lifetime (
1500 _visitor.fold_lifetime_def(_binding_0),
1501 )
1502 }
1503 Type(_binding_0, ) => {
1504 Type (
1505 _visitor.fold_type_param(_binding_0),
1506 )
1507 }
Nika Layzellf1fdc0b2017-12-04 19:58:32 -05001508 Const(_binding_0, ) => {
1509 Const (
1510 _visitor.fold_const_param(_binding_0),
1511 )
1512 }
David Tolnayc2f1aba2017-11-12 20:29:22 -08001513 }
1514}
1515
Nika Layzella6f46c42017-10-26 15:26:16 -04001516pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001517 Generics {
1518 lt_token: _i . lt_token,
David Tolnayc2f1aba2017-11-12 20:29:22 -08001519 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001520 gt_token: _i . gt_token,
Nika Layzell27726662017-10-24 23:16:35 -04001521 where_clause: _visitor.fold_where_clause(_i . where_clause),
1522 }
1523}
1524# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001525pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001526 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001527 match _i {
1528 Const(_binding_0, ) => {
1529 Const (
1530 _visitor.fold_impl_item_const(_binding_0),
1531 )
1532 }
1533 Method(_binding_0, ) => {
1534 Method (
1535 _visitor.fold_impl_item_method(_binding_0),
1536 )
1537 }
1538 Type(_binding_0, ) => {
1539 Type (
1540 _visitor.fold_impl_item_type(_binding_0),
1541 )
1542 }
1543 Macro(_binding_0, ) => {
1544 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001545 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001546 )
1547 }
1548 }
1549}
1550# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001551pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1552 ImplItemConst {
1553 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1554 vis: _visitor.fold_visibility(_i . vis),
1555 defaultness: _visitor.fold_defaultness(_i . defaultness),
1556 const_token: _i . const_token,
1557 ident: _i . ident,
1558 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001559 ty: _visitor.fold_type(_i . ty),
David Tolnay857628c2017-11-11 12:25:31 -08001560 eq_token: _i . eq_token,
1561 expr: _visitor.fold_expr(_i . expr),
1562 semi_token: _i . semi_token,
1563 }
1564}
1565# [ cfg ( feature = "full" ) ]
1566pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1567 ImplItemMacro {
1568 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1569 mac: _visitor.fold_macro(_i . mac),
1570 }
1571}
1572# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001573pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001574 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001575 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001576 vis: _visitor.fold_visibility(_i . vis),
1577 defaultness: _visitor.fold_defaultness(_i . defaultness),
1578 sig: _visitor.fold_method_sig(_i . sig),
1579 block: _visitor.fold_block(_i . block),
1580 }
1581}
1582# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001583pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001584 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001585 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001586 vis: _visitor.fold_visibility(_i . vis),
1587 defaultness: _visitor.fold_defaultness(_i . defaultness),
1588 type_token: _i . type_token,
1589 ident: _i . ident,
1590 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001591 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001592 semi_token: _i . semi_token,
1593 }
1594}
1595# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001596pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001597 use ::ImplPolarity::*;
1598 match _i {
1599 Positive => { Positive }
1600 Negative(_binding_0, ) => {
1601 Negative (
1602 _binding_0,
1603 )
1604 }
1605 }
1606}
1607# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001608pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001609 use ::InPlaceKind::*;
1610 match _i {
1611 Arrow(_binding_0, ) => {
1612 Arrow (
1613 _binding_0,
1614 )
1615 }
1616 In(_binding_0, ) => {
1617 In (
1618 _binding_0,
1619 )
1620 }
1621 }
1622}
1623# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001624pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001625 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001626 match _i {
1627 ExternCrate(_binding_0, ) => {
1628 ExternCrate (
1629 _visitor.fold_item_extern_crate(_binding_0),
1630 )
1631 }
1632 Use(_binding_0, ) => {
1633 Use (
1634 _visitor.fold_item_use(_binding_0),
1635 )
1636 }
1637 Static(_binding_0, ) => {
1638 Static (
1639 _visitor.fold_item_static(_binding_0),
1640 )
1641 }
1642 Const(_binding_0, ) => {
1643 Const (
1644 _visitor.fold_item_const(_binding_0),
1645 )
1646 }
1647 Fn(_binding_0, ) => {
1648 Fn (
1649 _visitor.fold_item_fn(_binding_0),
1650 )
1651 }
1652 Mod(_binding_0, ) => {
1653 Mod (
1654 _visitor.fold_item_mod(_binding_0),
1655 )
1656 }
1657 ForeignMod(_binding_0, ) => {
1658 ForeignMod (
1659 _visitor.fold_item_foreign_mod(_binding_0),
1660 )
1661 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001662 Type(_binding_0, ) => {
1663 Type (
1664 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001665 )
1666 }
1667 Enum(_binding_0, ) => {
1668 Enum (
1669 _visitor.fold_item_enum(_binding_0),
1670 )
1671 }
1672 Struct(_binding_0, ) => {
1673 Struct (
1674 _visitor.fold_item_struct(_binding_0),
1675 )
1676 }
1677 Union(_binding_0, ) => {
1678 Union (
1679 _visitor.fold_item_union(_binding_0),
1680 )
1681 }
1682 Trait(_binding_0, ) => {
1683 Trait (
1684 _visitor.fold_item_trait(_binding_0),
1685 )
1686 }
1687 DefaultImpl(_binding_0, ) => {
1688 DefaultImpl (
1689 _visitor.fold_item_default_impl(_binding_0),
1690 )
1691 }
1692 Impl(_binding_0, ) => {
1693 Impl (
1694 _visitor.fold_item_impl(_binding_0),
1695 )
1696 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001697 Macro(_binding_0, ) => {
1698 Macro (
1699 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001700 )
1701 }
1702 }
1703}
1704# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001705pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1706 ItemConst {
1707 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1708 vis: _visitor.fold_visibility(_i . vis),
1709 const_token: _i . const_token,
1710 ident: _i . ident,
1711 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001712 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001713 eq_token: _i . eq_token,
1714 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1715 semi_token: _i . semi_token,
1716 }
1717}
1718# [ cfg ( feature = "full" ) ]
1719pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1720 ItemDefaultImpl {
1721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1722 unsafety: _visitor.fold_unsafety(_i . unsafety),
1723 impl_token: _i . impl_token,
1724 path: _visitor.fold_path(_i . path),
1725 for_token: _i . for_token,
1726 dot2_token: _i . dot2_token,
1727 brace_token: _i . brace_token,
1728 }
1729}
1730# [ cfg ( feature = "full" ) ]
1731pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1732 ItemEnum {
1733 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1734 vis: _visitor.fold_visibility(_i . vis),
1735 enum_token: _i . enum_token,
1736 ident: _i . ident,
1737 generics: _visitor.fold_generics(_i . generics),
1738 brace_token: _i . brace_token,
1739 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1740 }
1741}
1742# [ cfg ( feature = "full" ) ]
1743pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1744 ItemExternCrate {
1745 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1746 vis: _visitor.fold_visibility(_i . vis),
1747 extern_token: _i . extern_token,
1748 crate_token: _i . crate_token,
1749 ident: _i . ident,
1750 rename: _i . rename,
1751 semi_token: _i . semi_token,
1752 }
1753}
1754# [ cfg ( feature = "full" ) ]
1755pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1756 ItemFn {
1757 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1758 vis: _visitor.fold_visibility(_i . vis),
1759 constness: _visitor.fold_constness(_i . constness),
1760 unsafety: _visitor.fold_unsafety(_i . unsafety),
1761 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1762 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1763 ident: _i . ident,
1764 block: Box::new(_visitor.fold_block(* _i . block)),
1765 }
1766}
1767# [ cfg ( feature = "full" ) ]
1768pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1769 ItemForeignMod {
1770 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1771 abi: _visitor.fold_abi(_i . abi),
1772 brace_token: _i . brace_token,
1773 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1774 }
1775}
1776# [ cfg ( feature = "full" ) ]
1777pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1778 ItemImpl {
1779 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1780 defaultness: _visitor.fold_defaultness(_i . defaultness),
1781 unsafety: _visitor.fold_unsafety(_i . unsafety),
1782 impl_token: _i . impl_token,
1783 generics: _visitor.fold_generics(_i . generics),
1784 trait_: _i . trait_,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001785 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001786 brace_token: _i . brace_token,
1787 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1788 }
1789}
1790# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001791pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1792 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay99a953d2017-11-11 12:51:43 -08001794 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001795 mac: _visitor.fold_macro(_i . mac),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001796 }
1797}
1798# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001799pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001800 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001801 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001802 vis: _visitor.fold_visibility(_i . vis),
1803 mod_token: _i . mod_token,
1804 ident: _i . ident,
1805 content: _i . content,
1806 semi: _i . semi,
1807 }
1808}
1809# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001810pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001811 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001812 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001813 vis: _visitor.fold_visibility(_i . vis),
1814 static_token: _i . static_token,
1815 mutbl: _visitor.fold_mutability(_i . mutbl),
1816 ident: _i . ident,
1817 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001818 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001819 eq_token: _i . eq_token,
1820 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1821 semi_token: _i . semi_token,
1822 }
1823}
1824# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001825pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001826 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001827 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001828 vis: _visitor.fold_visibility(_i . vis),
1829 struct_token: _i . struct_token,
1830 ident: _i . ident,
1831 generics: _visitor.fold_generics(_i . generics),
1832 data: _visitor.fold_variant_data(_i . data),
1833 semi_token: _i . semi_token,
1834 }
1835}
1836# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001837pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001838 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001839 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001840 vis: _visitor.fold_visibility(_i . vis),
1841 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell0dc6e632017-11-18 12:55:25 -05001842 auto_token: _i . auto_token,
Nika Layzell27726662017-10-24 23:16:35 -04001843 trait_token: _i . trait_token,
1844 ident: _i . ident,
1845 generics: _visitor.fold_generics(_i . generics),
1846 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001847 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001848 brace_token: _i . brace_token,
1849 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1850 }
1851}
1852# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001853pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1854 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001855 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001856 vis: _visitor.fold_visibility(_i . vis),
1857 type_token: _i . type_token,
1858 ident: _i . ident,
1859 generics: _visitor.fold_generics(_i . generics),
1860 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001861 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001862 semi_token: _i . semi_token,
1863 }
1864}
1865# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001866pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001867 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001868 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001869 vis: _visitor.fold_visibility(_i . vis),
1870 union_token: _i . union_token,
1871 ident: _i . ident,
1872 generics: _visitor.fold_generics(_i . generics),
1873 data: _visitor.fold_variant_data(_i . data),
1874 }
1875}
1876# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001877pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001878 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001879 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001880 vis: _visitor.fold_visibility(_i . vis),
1881 use_token: _i . use_token,
1882 path: Box::new(_visitor.fold_view_path(* _i . path)),
1883 semi_token: _i . semi_token,
1884 }
1885}
1886
Nika Layzella6f46c42017-10-26 15:26:16 -04001887pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001888 LifetimeDef {
1889 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1890 lifetime: _i . lifetime,
1891 colon_token: _i . colon_token,
1892 bounds: _i . bounds,
1893 }
1894}
1895# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001896pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001897 Local {
1898 let_token: _i . let_token,
1899 colon_token: _i . colon_token,
1900 eq_token: _i . eq_token,
1901 semi_token: _i . semi_token,
1902 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001903 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001904 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001905 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1906 }
1907}
Nika Layzell27726662017-10-24 23:16:35 -04001908# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001909pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
Nika Layzell27726662017-10-24 23:16:35 -04001910 use ::MacStmtStyle::*;
1911 match _i {
1912 Semicolon(_binding_0, ) => {
1913 Semicolon (
1914 _binding_0,
1915 )
1916 }
1917 Braces => { Braces }
1918 NoBraces => { NoBraces }
1919 }
1920}
1921
David Tolnaydecf28d2017-11-11 11:56:45 -08001922pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1923 Macro {
1924 path: _visitor.fold_path(_i . path),
1925 bang_token: _i . bang_token,
David Tolnaydecf28d2017-11-11 11:56:45 -08001926 tokens: _i . tokens,
1927 }
1928}
1929
Nika Layzella6f46c42017-10-26 15:26:16 -04001930pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001931 use ::MetaItem::*;
1932 match _i {
1933 Term(_binding_0, ) => {
1934 Term (
1935 _binding_0,
1936 )
1937 }
1938 List(_binding_0, ) => {
1939 List (
1940 _visitor.fold_meta_item_list(_binding_0),
1941 )
1942 }
1943 NameValue(_binding_0, ) => {
1944 NameValue (
1945 _visitor.fold_meta_name_value(_binding_0),
1946 )
1947 }
1948 }
1949}
1950
Nika Layzella6f46c42017-10-26 15:26:16 -04001951pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001952 MetaItemList {
1953 ident: _i . ident,
1954 paren_token: _i . paren_token,
1955 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1956 }
1957}
1958
Nika Layzella6f46c42017-10-26 15:26:16 -04001959pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001960 MetaNameValue {
1961 ident: _i . ident,
1962 eq_token: _i . eq_token,
1963 lit: _i . lit,
1964 }
1965}
1966# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001967pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001968 MethodSig {
1969 constness: _visitor.fold_constness(_i . constness),
1970 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001971 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001972 ident: _i . ident,
1973 decl: _visitor.fold_fn_decl(_i . decl),
1974 }
1975}
1976
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001977pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1978 MutType {
1979 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001980 mutability: _visitor.fold_mutability(_i . mutability),
1981 }
1982}
1983
Nika Layzella6f46c42017-10-26 15:26:16 -04001984pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04001985 use ::Mutability::*;
1986 match _i {
1987 Mutable(_binding_0, ) => {
1988 Mutable (
1989 _binding_0,
1990 )
1991 }
1992 Immutable => { Immutable }
1993 }
1994}
1995
Nika Layzella6f46c42017-10-26 15:26:16 -04001996pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001997 use ::NestedMetaItem::*;
1998 match _i {
1999 MetaItem(_binding_0, ) => {
2000 MetaItem (
2001 _visitor.fold_meta_item(_binding_0),
2002 )
2003 }
2004 Literal(_binding_0, ) => {
2005 Literal (
2006 _binding_0,
2007 )
2008 }
2009 }
2010}
2011
Nika Layzellc08227a2017-12-04 16:30:17 -05002012pub fn fold_parenthesized_generic_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2013 ParenthesizedGenericArguments {
Nika Layzell27726662017-10-24 23:16:35 -04002014 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002015 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08002016 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04002017 }
2018}
2019# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002020pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04002021 use ::Pat::*;
2022 match _i {
2023 Wild(_binding_0, ) => {
2024 Wild (
2025 _visitor.fold_pat_wild(_binding_0),
2026 )
2027 }
2028 Ident(_binding_0, ) => {
2029 Ident (
2030 _visitor.fold_pat_ident(_binding_0),
2031 )
2032 }
2033 Struct(_binding_0, ) => {
2034 Struct (
2035 _visitor.fold_pat_struct(_binding_0),
2036 )
2037 }
2038 TupleStruct(_binding_0, ) => {
2039 TupleStruct (
2040 _visitor.fold_pat_tuple_struct(_binding_0),
2041 )
2042 }
2043 Path(_binding_0, ) => {
2044 Path (
2045 _visitor.fold_pat_path(_binding_0),
2046 )
2047 }
2048 Tuple(_binding_0, ) => {
2049 Tuple (
2050 _visitor.fold_pat_tuple(_binding_0),
2051 )
2052 }
2053 Box(_binding_0, ) => {
2054 Box (
2055 _visitor.fold_pat_box(_binding_0),
2056 )
2057 }
2058 Ref(_binding_0, ) => {
2059 Ref (
2060 _visitor.fold_pat_ref(_binding_0),
2061 )
2062 }
2063 Lit(_binding_0, ) => {
2064 Lit (
2065 _visitor.fold_pat_lit(_binding_0),
2066 )
2067 }
2068 Range(_binding_0, ) => {
2069 Range (
2070 _visitor.fold_pat_range(_binding_0),
2071 )
2072 }
2073 Slice(_binding_0, ) => {
2074 Slice (
2075 _visitor.fold_pat_slice(_binding_0),
2076 )
2077 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002078 Macro(_binding_0, ) => {
2079 Macro (
2080 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002081 )
2082 }
2083 }
2084}
2085# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002086pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002087 PatBox {
2088 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2089 box_token: _i . box_token,
2090 }
2091}
2092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002093pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002094 PatIdent {
2095 mode: _visitor.fold_binding_mode(_i . mode),
2096 ident: _i . ident,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002097 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002098 at_token: _i . at_token,
2099 }
2100}
2101# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002102pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002103 PatLit {
2104 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2105 }
2106}
2107# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002108pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002109 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002110 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002111 path: _visitor.fold_path(_i . path),
2112 }
2113}
2114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002115pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002116 PatRange {
2117 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2118 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2119 limits: _visitor.fold_range_limits(_i . limits),
2120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PatRef {
2125 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2126 mutbl: _visitor.fold_mutability(_i . mutbl),
2127 and_token: _i . and_token,
2128 }
2129}
2130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002132 PatSlice {
2133 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002134 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002135 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2136 dot2_token: _i . dot2_token,
2137 comma_token: _i . comma_token,
2138 bracket_token: _i . bracket_token,
2139 }
2140}
2141# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002142pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002143 PatStruct {
2144 path: _visitor.fold_path(_i . path),
2145 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2146 brace_token: _i . brace_token,
2147 dot2_token: _i . dot2_token,
2148 }
2149}
2150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002151pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002152 PatTuple {
2153 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
2154 dots_pos: _i . dots_pos,
2155 paren_token: _i . paren_token,
2156 dot2_token: _i . dot2_token,
2157 comma_token: _i . comma_token,
2158 }
2159}
2160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002161pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002162 PatTupleStruct {
2163 path: _visitor.fold_path(_i . path),
2164 pat: _visitor.fold_pat_tuple(_i . pat),
2165 }
2166}
2167# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002168pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002169 PatWild {
2170 underscore_token: _i . underscore_token,
2171 }
2172}
2173
Nika Layzella6f46c42017-10-26 15:26:16 -04002174pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002175 Path {
2176 leading_colon: _i . leading_colon,
2177 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2178 }
2179}
Nika Layzellc08227a2017-12-04 16:30:17 -05002180
2181pub fn fold_path_arguments<V: Folder + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2182 use ::PathArguments::*;
2183 match _i {
2184 None => { None }
2185 AngleBracketed(_binding_0, ) => {
2186 AngleBracketed (
2187 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2188 )
2189 }
2190 Parenthesized(_binding_0, ) => {
2191 Parenthesized (
2192 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2193 )
2194 }
2195 }
2196}
Nika Layzell27726662017-10-24 23:16:35 -04002197# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002198pub fn fold_path_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: PathGlob) -> PathGlob {
Nika Layzell27726662017-10-24 23:16:35 -04002199 PathGlob {
2200 path: _visitor.fold_path(_i . path),
2201 colon2_token: _i . colon2_token,
2202 star_token: _i . star_token,
2203 }
2204}
2205# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002206pub fn fold_path_list<V: Folder + ?Sized>(_visitor: &mut V, _i: PathList) -> PathList {
Nika Layzell27726662017-10-24 23:16:35 -04002207 PathList {
2208 path: _visitor.fold_path(_i . path),
2209 colon2_token: _i . colon2_token,
2210 brace_token: _i . brace_token,
2211 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_path_list_item(it) }),
2212 }
2213}
2214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002215pub fn fold_path_list_item<V: Folder + ?Sized>(_visitor: &mut V, _i: PathListItem) -> PathListItem {
Nika Layzell27726662017-10-24 23:16:35 -04002216 PathListItem {
2217 name: _i . name,
2218 rename: _i . rename,
2219 as_token: _i . as_token,
2220 }
2221}
2222
Nika Layzella6f46c42017-10-26 15:26:16 -04002223pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002224 PathSegment {
2225 ident: _i . ident,
Nika Layzellc08227a2017-12-04 16:30:17 -05002226 arguments: _visitor.fold_path_arguments(_i . arguments),
Nika Layzell27726662017-10-24 23:16:35 -04002227 }
2228}
2229# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002230pub fn fold_path_simple<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSimple) -> PathSimple {
Nika Layzell27726662017-10-24 23:16:35 -04002231 PathSimple {
2232 path: _visitor.fold_path(_i . path),
2233 as_token: _i . as_token,
2234 rename: _i . rename,
2235 }
2236}
2237
Nika Layzella6f46c42017-10-26 15:26:16 -04002238pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002239 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002240 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002241 trait_ref: _visitor.fold_path(_i . trait_ref),
2242 }
2243}
2244
Nika Layzella6f46c42017-10-26 15:26:16 -04002245pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002246 QSelf {
2247 lt_token: _i . lt_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002248 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002249 position: _i . position,
2250 as_token: _i . as_token,
2251 gt_token: _i . gt_token,
2252 }
2253}
2254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002255pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002256 use ::RangeLimits::*;
2257 match _i {
2258 HalfOpen(_binding_0, ) => {
2259 HalfOpen (
2260 _binding_0,
2261 )
2262 }
2263 Closed(_binding_0, ) => {
2264 Closed (
2265 _binding_0,
2266 )
2267 }
2268 }
2269}
David Tolnayf93b90d2017-11-11 19:21:26 -08002270
2271pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2272 use ::ReturnType::*;
2273 match _i {
2274 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002275 Type(_binding_0, _binding_1, ) => {
2276 Type (
2277 _visitor.fold_type(_binding_0),
David Tolnayf93b90d2017-11-11 19:21:26 -08002278 _binding_1,
2279 )
2280 }
2281 }
2282}
Nika Layzell27726662017-10-24 23:16:35 -04002283# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002284pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002285 use ::Stmt::*;
2286 match _i {
2287 Local(_binding_0, ) => {
2288 Local (
2289 Box::new(_visitor.fold_local(* _binding_0)),
2290 )
2291 }
2292 Item(_binding_0, ) => {
2293 Item (
2294 Box::new(_visitor.fold_item(* _binding_0)),
2295 )
2296 }
2297 Expr(_binding_0, ) => {
2298 Expr (
2299 Box::new(_visitor.fold_expr(* _binding_0)),
2300 )
2301 }
2302 Semi(_binding_0, _binding_1, ) => {
2303 Semi (
2304 Box::new(_visitor.fold_expr(* _binding_0)),
2305 _binding_1,
2306 )
2307 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002308 Macro(_binding_0, ) => {
2309 Macro (
Nika Layzell27726662017-10-24 23:16:35 -04002310 _binding_0,
2311 )
2312 }
2313 }
2314}
2315
Nika Layzella6f46c42017-10-26 15:26:16 -04002316pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002317 use ::TraitBoundModifier::*;
2318 match _i {
2319 None => { None }
2320 Maybe(_binding_0, ) => {
2321 Maybe (
2322 _binding_0,
2323 )
2324 }
2325 }
2326}
2327# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002328pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002329 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002330 match _i {
2331 Const(_binding_0, ) => {
2332 Const (
2333 _visitor.fold_trait_item_const(_binding_0),
2334 )
2335 }
2336 Method(_binding_0, ) => {
2337 Method (
2338 _visitor.fold_trait_item_method(_binding_0),
2339 )
2340 }
2341 Type(_binding_0, ) => {
2342 Type (
2343 _visitor.fold_trait_item_type(_binding_0),
2344 )
2345 }
2346 Macro(_binding_0, ) => {
2347 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002348 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002349 )
2350 }
2351 }
2352}
2353# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002354pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2355 TraitItemConst {
2356 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2357 const_token: _i . const_token,
2358 ident: _i . ident,
2359 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002360 ty: _visitor.fold_type(_i . ty),
David Tolnayda705bd2017-11-10 21:58:05 -08002361 default: _i . default,
2362 semi_token: _i . semi_token,
2363 }
2364}
2365# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002366pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2367 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002368 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002369 mac: _visitor.fold_macro(_i . mac),
David Tolnayda705bd2017-11-10 21:58:05 -08002370 }
2371}
2372# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002373pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002374 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002375 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002376 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002377 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002378 semi_token: _i . semi_token,
2379 }
2380}
2381# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002382pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002383 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002384 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002385 type_token: _i . type_token,
2386 ident: _i . ident,
2387 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002388 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002389 default: _i . default,
2390 semi_token: _i . semi_token,
2391 }
2392}
2393
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002394pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2395 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002396 match _i {
2397 Slice(_binding_0, ) => {
2398 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002399 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002400 )
2401 }
2402 Array(_binding_0, ) => {
2403 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002404 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002405 )
2406 }
2407 Ptr(_binding_0, ) => {
2408 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002409 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002410 )
2411 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002412 Reference(_binding_0, ) => {
2413 Reference (
2414 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002415 )
2416 }
2417 BareFn(_binding_0, ) => {
2418 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002419 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002420 )
2421 }
2422 Never(_binding_0, ) => {
2423 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002424 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002425 )
2426 }
2427 Tup(_binding_0, ) => {
2428 Tup (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002429 _visitor.fold_type_tup(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002430 )
2431 }
2432 Path(_binding_0, ) => {
2433 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002434 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002435 )
2436 }
2437 TraitObject(_binding_0, ) => {
2438 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002439 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002440 )
2441 }
2442 ImplTrait(_binding_0, ) => {
2443 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002444 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002445 )
2446 }
2447 Paren(_binding_0, ) => {
2448 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002450 )
2451 }
2452 Group(_binding_0, ) => {
2453 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002454 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002455 )
2456 }
2457 Infer(_binding_0, ) => {
2458 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002459 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002460 )
2461 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002462 Macro(_binding_0, ) => {
2463 Macro (
2464 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002465 )
2466 }
2467 }
2468}
2469
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002470pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2471 TypeArray {
Nika Layzell27726662017-10-24 23:16:35 -04002472 bracket_token: _i . bracket_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002473 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002474 semi_token: _i . semi_token,
2475 amt: _visitor.fold_expr(_i . amt),
2476 }
2477}
2478
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2480 TypeBareFn {
2481 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002482 }
2483}
2484
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002485pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2486 TypeBinding {
2487 ident: _i . ident,
2488 eq_token: _i . eq_token,
2489 ty: _visitor.fold_type(_i . ty),
2490 }
2491}
2492
2493pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2494 TypeGroup {
Nika Layzell27726662017-10-24 23:16:35 -04002495 group_token: _i . group_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002497 }
2498}
2499
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002500pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2501 TypeImplTrait {
Nika Layzell27726662017-10-24 23:16:35 -04002502 impl_token: _i . impl_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002504 }
2505}
2506
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002507pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2508 TypeInfer {
Nika Layzell27726662017-10-24 23:16:35 -04002509 underscore_token: _i . underscore_token,
2510 }
2511}
2512
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002513pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2514 TypeNever {
Nika Layzell27726662017-10-24 23:16:35 -04002515 bang_token: _i . bang_token,
2516 }
2517}
2518
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2520 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002521 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2522 ident: _i . ident,
2523 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002524 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002525 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002526 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002527 }
2528}
2529
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002530pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2531 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002532 match _i {
2533 Trait(_binding_0, _binding_1, ) => {
2534 Trait (
2535 _visitor.fold_poly_trait_ref(_binding_0),
2536 _visitor.fold_trait_bound_modifier(_binding_1),
2537 )
2538 }
2539 Region(_binding_0, ) => {
2540 Region (
2541 _binding_0,
2542 )
2543 }
2544 }
2545}
2546
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002547pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2548 TypeParen {
Nika Layzell27726662017-10-24 23:16:35 -04002549 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002550 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002551 }
2552}
2553
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002554pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2555 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002556 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002557 path: _visitor.fold_path(_i . path),
2558 }
2559}
2560
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002561pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2562 TypePtr {
Nika Layzell27726662017-10-24 23:16:35 -04002563 star_token: _i . star_token,
2564 const_token: _i . const_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002565 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002566 }
2567}
2568
David Tolnay0a89b4d2017-11-13 00:55:45 -08002569pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2570 TypeReference {
Nika Layzell27726662017-10-24 23:16:35 -04002571 and_token: _i . and_token,
2572 lifetime: _i . lifetime,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002573 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002574 }
2575}
2576
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002577pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2578 TypeSlice {
2579 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002580 bracket_token: _i . bracket_token,
2581 }
2582}
2583
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002584pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2585 TypeTraitObject {
2586 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002587 }
2588}
2589
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002590pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
2591 TypeTup {
Nika Layzell27726662017-10-24 23:16:35 -04002592 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002593 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002594 lone_comma: _i . lone_comma,
2595 }
2596}
2597
Nika Layzella6f46c42017-10-26 15:26:16 -04002598pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002599 use ::UnOp::*;
2600 match _i {
2601 Deref(_binding_0, ) => {
2602 Deref (
2603 _binding_0,
2604 )
2605 }
2606 Not(_binding_0, ) => {
2607 Not (
2608 _binding_0,
2609 )
2610 }
2611 Neg(_binding_0, ) => {
2612 Neg (
2613 _binding_0,
2614 )
2615 }
2616 }
2617}
2618
Nika Layzella6f46c42017-10-26 15:26:16 -04002619pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002620 use ::Unsafety::*;
2621 match _i {
2622 Unsafe(_binding_0, ) => {
2623 Unsafe (
2624 _binding_0,
2625 )
2626 }
2627 Normal => { Normal }
2628 }
2629}
2630
Nika Layzella6f46c42017-10-26 15:26:16 -04002631pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002632 Variant {
2633 ident: _i . ident,
2634 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2635 data: _visitor.fold_variant_data(_i . data),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002636 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002637 eq_token: _i . eq_token,
2638 }
2639}
2640
Nika Layzella6f46c42017-10-26 15:26:16 -04002641pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002642 use ::VariantData::*;
2643 match _i {
2644 Struct(_binding_0, _binding_1, ) => {
2645 Struct (
2646 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2647 _binding_1,
2648 )
2649 }
2650 Tuple(_binding_0, _binding_1, ) => {
2651 Tuple (
2652 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2653 _binding_1,
2654 )
2655 }
2656 Unit => { Unit }
2657 }
2658}
2659# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002660pub fn fold_view_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ViewPath) -> ViewPath {
Nika Layzell27726662017-10-24 23:16:35 -04002661 use ::ViewPath::*;
2662 match _i {
2663 Simple(_binding_0, ) => {
2664 Simple (
2665 _visitor.fold_path_simple(_binding_0),
2666 )
2667 }
2668 Glob(_binding_0, ) => {
2669 Glob (
2670 _visitor.fold_path_glob(_binding_0),
2671 )
2672 }
2673 List(_binding_0, ) => {
2674 List (
2675 _visitor.fold_path_list(_binding_0),
2676 )
2677 }
2678 }
2679}
2680
Nika Layzella6f46c42017-10-26 15:26:16 -04002681pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002682 VisCrate {
2683 pub_token: _i . pub_token,
2684 paren_token: _i . paren_token,
2685 crate_token: _i . crate_token,
2686 }
2687}
2688
Nika Layzella6f46c42017-10-26 15:26:16 -04002689pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002690 VisInherited {
2691 }
2692}
2693
Nika Layzella6f46c42017-10-26 15:26:16 -04002694pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002695 VisPublic {
2696 pub_token: _i . pub_token,
2697 }
2698}
2699
Nika Layzella6f46c42017-10-26 15:26:16 -04002700pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002701 VisRestricted {
2702 pub_token: _i . pub_token,
2703 paren_token: _i . paren_token,
2704 in_token: _i . in_token,
2705 path: Box::new(_visitor.fold_path(* _i . path)),
2706 }
2707}
2708
Nika Layzella6f46c42017-10-26 15:26:16 -04002709pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002710 use ::Visibility::*;
2711 match _i {
2712 Public(_binding_0, ) => {
2713 Public (
2714 _visitor.fold_vis_public(_binding_0),
2715 )
2716 }
2717 Crate(_binding_0, ) => {
2718 Crate (
2719 _visitor.fold_vis_crate(_binding_0),
2720 )
2721 }
2722 Restricted(_binding_0, ) => {
2723 Restricted (
2724 _visitor.fold_vis_restricted(_binding_0),
2725 )
2726 }
2727 Inherited(_binding_0, ) => {
2728 Inherited (
2729 _visitor.fold_vis_inherited(_binding_0),
2730 )
2731 }
2732 }
2733}
2734
Nika Layzella6f46c42017-10-26 15:26:16 -04002735pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002736 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002737 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002738 bounded_ty: _visitor.fold_type(_i . bounded_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002739 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002740 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002741 }
2742}
2743
Nika Layzella6f46c42017-10-26 15:26:16 -04002744pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002745 WhereClause {
2746 where_token: _i . where_token,
2747 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2748 }
2749}
2750
Nika Layzella6f46c42017-10-26 15:26:16 -04002751pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002752 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002753 lhs_ty: _visitor.fold_type(_i . lhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002754 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002755 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002756 }
2757}
2758
Nika Layzella6f46c42017-10-26 15:26:16 -04002759pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002760 use ::WherePredicate::*;
2761 match _i {
2762 BoundPredicate(_binding_0, ) => {
2763 BoundPredicate (
2764 _visitor.fold_where_bound_predicate(_binding_0),
2765 )
2766 }
2767 RegionPredicate(_binding_0, ) => {
2768 RegionPredicate (
2769 _visitor.fold_where_region_predicate(_binding_0),
2770 )
2771 }
2772 EqPredicate(_binding_0, ) => {
2773 EqPredicate (
2774 _visitor.fold_where_eq_predicate(_binding_0),
2775 )
2776 }
2777 }
2778}
2779
Nika Layzella6f46c42017-10-26 15:26:16 -04002780pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002781 WhereRegionPredicate {
2782 lifetime: _i . lifetime,
2783 colon_token: _i . colon_token,
2784 bounds: _i . bounds,
2785 }
2786}
2787