blob: 1b676e24a793b8f300b2b714fe40ea8de6a2ac2b [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 Layzella6f46c42017-10-26 15:26:16 -040065fn fold_angle_bracketed_parameter_data(&mut self, i: AngleBracketedParameterData) -> AngleBracketedParameterData { fold_angle_bracketed_parameter_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040067fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040068# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040069fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040070# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040071fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040072# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040073fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040074
Nika Layzella6f46c42017-10-26 15:26:16 -040075fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040076
Nika Layzella6f46c42017-10-26 15:26:16 -040077fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040078
Nika Layzella6f46c42017-10-26 15:26:16 -040079fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040080
Nika Layzella6f46c42017-10-26 15:26:16 -040081fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040082
David Tolnayfd6bf5c2017-11-12 09:41:14 -080083fn fold_bare_fn_type(&mut self, i: BareFnType) -> BareFnType { fold_bare_fn_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040084
Nika Layzella6f46c42017-10-26 15:26:16 -040085fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040086# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040087fn fold_binding_mode(&mut self, i: BindingMode) -> BindingMode { fold_binding_mode(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040088# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040089fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040090
Nika Layzella6f46c42017-10-26 15:26:16 -040091fn fold_body(&mut self, i: Body) -> Body { fold_body(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040092
Nika Layzella6f46c42017-10-26 15:26:16 -040093fn fold_body_enum(&mut self, i: BodyEnum) -> BodyEnum { fold_body_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040094
Nika Layzella6f46c42017-10-26 15:26:16 -040095fn fold_body_struct(&mut self, i: BodyStruct) -> BodyStruct { fold_body_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040096
Nika Layzella6f46c42017-10-26 15:26:16 -040097fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -040098# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -040099fn fold_capture_by(&mut self, i: CaptureBy) -> CaptureBy { fold_capture_by(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400100# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400101fn fold_constness(&mut self, i: Constness) -> Constness { fold_constness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400103fn fold_defaultness(&mut self, i: Defaultness) -> Defaultness { fold_defaultness(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400104
Nika Layzella6f46c42017-10-26 15:26:16 -0400105fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400106
Nika Layzella6f46c42017-10-26 15:26:16 -0400107fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400108# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400109fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400110# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400111fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400112# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400113fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400114# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400115fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400116
Nika Layzella6f46c42017-10-26 15:26:16 -0400117fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400118# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400119fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400120# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400121fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400123fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400124
Nika Layzella6f46c42017-10-26 15:26:16 -0400125fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400126
Nika Layzella6f46c42017-10-26 15:26:16 -0400127fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400128# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400129fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400131fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400132# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400133fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400134# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400135fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400136# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400137fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400138
Nika Layzella6f46c42017-10-26 15:26:16 -0400139fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400140# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400141fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400142# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400143fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400144# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400145fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400146
Nika Layzella6f46c42017-10-26 15:26:16 -0400147fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400148
Nika Layzella6f46c42017-10-26 15:26:16 -0400149fn fold_expr_kind(&mut self, i: ExprKind) -> ExprKind { fold_expr_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400150# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400151fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400152# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400153fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400155fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400156
Nika Layzella6f46c42017-10-26 15:26:16 -0400157fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400158
Nika Layzella6f46c42017-10-26 15:26:16 -0400159fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400160# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400161fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400162# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400163fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400164# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400165fn fold_expr_ret(&mut self, i: ExprRet) -> ExprRet { fold_expr_ret(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400166# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400167fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400168# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400169fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400171fn fold_expr_tup(&mut self, i: ExprTup) -> ExprTup { fold_expr_tup(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400173fn fold_expr_tup_field(&mut self, i: ExprTupField) -> ExprTupField { fold_expr_tup_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400174
Nika Layzella6f46c42017-10-26 15:26:16 -0400175fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400176
Nika Layzella6f46c42017-10-26 15:26:16 -0400177fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400178# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400179fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400180# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400181fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400182# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400183fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400184
Nika Layzella6f46c42017-10-26 15:26:16 -0400185fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400186# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400187fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400188# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400189fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400190# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400191fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400192# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400193fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400194# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400195fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400197fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400198# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400199fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400200# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400201fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
David Tolnay199bcbb2017-11-12 10:33:52 -0800202# [ cfg ( feature = "full" ) ]
203fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400204
David Tolnayc2f1aba2017-11-12 20:29:22 -0800205fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
206
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400211fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800213fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400237fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800239fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400247fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800249fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400259fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400260
David Tolnaydecf28d2017-11-11 11:56:45 -0800261fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400269fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800271fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_parenthesized_parameter_data(&mut self, i: ParenthesizedParameterData) -> ParenthesizedParameterData { fold_parenthesized_parameter_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_path_glob(&mut self, i: PathGlob) -> PathGlob { fold_path_glob(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_path_list(&mut self, i: PathList) -> PathList { fold_path_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_path_list_item(&mut self, i: PathListItem) -> PathListItem { fold_path_list_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_path_parameters(&mut self, i: PathParameters) -> PathParameters { fold_path_parameters(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_path_simple(&mut self, i: PathSimple) -> PathSimple { fold_path_simple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400320# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400321fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800322
323fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400331fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800333fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400337fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800339fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800341fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800343fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344
Nika Layzella6f46c42017-10-26 15:26:16 -0400345fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400346
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800347fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
348
349fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
350
351fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
352
353fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
354
355fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
356
357fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
358
359fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
360
361fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
362
363fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
364
David Tolnay0a89b4d2017-11-13 00:55:45 -0800365fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800366
367fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
368
369fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
370
371fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_view_path(&mut self, i: ViewPath) -> ViewPath { fold_view_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
Nika Layzella6f46c42017-10-26 15:26:16 -0400401fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400402
403}
404
405
Nika Layzella6f46c42017-10-26 15:26:16 -0400406pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400407 Abi {
408 extern_token: _i . extern_token,
409 kind: _visitor.fold_abi_kind(_i . kind),
410 }
411}
412
Nika Layzella6f46c42017-10-26 15:26:16 -0400413pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400414 use ::AbiKind::*;
415 match _i {
416 Named(_binding_0, ) => {
417 Named (
418 _binding_0,
419 )
420 }
421 Default => { Default }
422 }
423}
424
Nika Layzella6f46c42017-10-26 15:26:16 -0400425pub fn fold_angle_bracketed_parameter_data<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedParameterData) -> AngleBracketedParameterData {
Nika Layzell27726662017-10-24 23:16:35 -0400426 AngleBracketedParameterData {
427 turbofish: _i . turbofish,
428 lt_token: _i . lt_token,
429 lifetimes: _i . lifetimes,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800430 types: FoldHelper::lift(_i . types, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400431 bindings: FoldHelper::lift(_i . bindings, |it| { _visitor.fold_type_binding(it) }),
432 gt_token: _i . gt_token,
433 }
434}
435# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400436pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400437 ArgCaptured {
438 pat: _visitor.fold_pat(_i . pat),
439 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800440 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400441 }
442}
443# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400444pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400445 ArgSelf {
446 mutbl: _visitor.fold_mutability(_i . mutbl),
447 self_token: _i . self_token,
448 }
449}
450# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400451pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400452 ArgSelfRef {
453 and_token: _i . and_token,
454 self_token: _i . self_token,
455 lifetime: _i . lifetime,
456 mutbl: _visitor.fold_mutability(_i . mutbl),
457 }
458}
459# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400460pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400461 Arm {
462 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
463 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
464 if_token: _i . if_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400465 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400466 rocket_token: _i . rocket_token,
467 body: Box::new(_visitor.fold_expr(* _i . body)),
468 comma: _i . comma,
469 }
470}
471
Nika Layzella6f46c42017-10-26 15:26:16 -0400472pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400473 use ::AttrStyle::*;
474 match _i {
475 Outer => { Outer }
476 Inner(_binding_0, ) => {
477 Inner (
478 _binding_0,
479 )
480 }
481 }
482}
483
Nika Layzella6f46c42017-10-26 15:26:16 -0400484pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400485 Attribute {
486 style: _visitor.fold_attr_style(_i . style),
487 pound_token: _i . pound_token,
488 bracket_token: _i . bracket_token,
489 path: _visitor.fold_path(_i . path),
490 tts: _i . tts,
491 is_sugared_doc: _i . is_sugared_doc,
492 }
493}
494
Nika Layzella6f46c42017-10-26 15:26:16 -0400495pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400496 BareFnArg {
497 name: _i . name,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800498 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400499 }
500}
501
Nika Layzella6f46c42017-10-26 15:26:16 -0400502pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400503 use ::BareFnArgName::*;
504 match _i {
505 Named(_binding_0, ) => {
506 Named (
507 _binding_0,
508 )
509 }
510 Wild(_binding_0, ) => {
511 Wild (
512 _binding_0,
513 )
514 }
515 }
516}
517
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800518pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
519 BareFnType {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400520 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400521 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400522 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400523 fn_token: _i . fn_token,
524 paren_token: _i . paren_token,
525 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
526 variadic: _i . variadic,
David Tolnayf93b90d2017-11-11 19:21:26 -0800527 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400528 }
529}
530
Nika Layzella6f46c42017-10-26 15:26:16 -0400531pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400532 use ::BinOp::*;
533 match _i {
534 Add(_binding_0, ) => {
535 Add (
536 _binding_0,
537 )
538 }
539 Sub(_binding_0, ) => {
540 Sub (
541 _binding_0,
542 )
543 }
544 Mul(_binding_0, ) => {
545 Mul (
546 _binding_0,
547 )
548 }
549 Div(_binding_0, ) => {
550 Div (
551 _binding_0,
552 )
553 }
554 Rem(_binding_0, ) => {
555 Rem (
556 _binding_0,
557 )
558 }
559 And(_binding_0, ) => {
560 And (
561 _binding_0,
562 )
563 }
564 Or(_binding_0, ) => {
565 Or (
566 _binding_0,
567 )
568 }
569 BitXor(_binding_0, ) => {
570 BitXor (
571 _binding_0,
572 )
573 }
574 BitAnd(_binding_0, ) => {
575 BitAnd (
576 _binding_0,
577 )
578 }
579 BitOr(_binding_0, ) => {
580 BitOr (
581 _binding_0,
582 )
583 }
584 Shl(_binding_0, ) => {
585 Shl (
586 _binding_0,
587 )
588 }
589 Shr(_binding_0, ) => {
590 Shr (
591 _binding_0,
592 )
593 }
594 Eq(_binding_0, ) => {
595 Eq (
596 _binding_0,
597 )
598 }
599 Lt(_binding_0, ) => {
600 Lt (
601 _binding_0,
602 )
603 }
604 Le(_binding_0, ) => {
605 Le (
606 _binding_0,
607 )
608 }
609 Ne(_binding_0, ) => {
610 Ne (
611 _binding_0,
612 )
613 }
614 Ge(_binding_0, ) => {
615 Ge (
616 _binding_0,
617 )
618 }
619 Gt(_binding_0, ) => {
620 Gt (
621 _binding_0,
622 )
623 }
624 AddEq(_binding_0, ) => {
625 AddEq (
626 _binding_0,
627 )
628 }
629 SubEq(_binding_0, ) => {
630 SubEq (
631 _binding_0,
632 )
633 }
634 MulEq(_binding_0, ) => {
635 MulEq (
636 _binding_0,
637 )
638 }
639 DivEq(_binding_0, ) => {
640 DivEq (
641 _binding_0,
642 )
643 }
644 RemEq(_binding_0, ) => {
645 RemEq (
646 _binding_0,
647 )
648 }
649 BitXorEq(_binding_0, ) => {
650 BitXorEq (
651 _binding_0,
652 )
653 }
654 BitAndEq(_binding_0, ) => {
655 BitAndEq (
656 _binding_0,
657 )
658 }
659 BitOrEq(_binding_0, ) => {
660 BitOrEq (
661 _binding_0,
662 )
663 }
664 ShlEq(_binding_0, ) => {
665 ShlEq (
666 _binding_0,
667 )
668 }
669 ShrEq(_binding_0, ) => {
670 ShrEq (
671 _binding_0,
672 )
673 }
674 }
675}
676# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400677pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400678 use ::BindingMode::*;
679 match _i {
680 ByRef(_binding_0, _binding_1, ) => {
681 ByRef (
682 _binding_0,
683 _visitor.fold_mutability(_binding_1),
684 )
685 }
686 ByValue(_binding_0, ) => {
687 ByValue (
688 _visitor.fold_mutability(_binding_0),
689 )
690 }
691 }
692}
693# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400694pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400695 Block {
696 brace_token: _i . brace_token,
697 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
698 }
699}
700
Nika Layzella6f46c42017-10-26 15:26:16 -0400701pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400702 use ::Body::*;
703 match _i {
704 Enum(_binding_0, ) => {
705 Enum (
706 _visitor.fold_body_enum(_binding_0),
707 )
708 }
709 Struct(_binding_0, ) => {
710 Struct (
711 _visitor.fold_body_struct(_binding_0),
712 )
713 }
714 }
715}
716
Nika Layzella6f46c42017-10-26 15:26:16 -0400717pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400718 BodyEnum {
719 enum_token: _i . enum_token,
720 brace_token: _i . brace_token,
721 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
722 }
723}
724
Nika Layzella6f46c42017-10-26 15:26:16 -0400725pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400726 BodyStruct {
727 data: _visitor.fold_variant_data(_i . data),
728 struct_token: _i . struct_token,
729 semi_token: _i . semi_token,
730 }
731}
732
Nika Layzella6f46c42017-10-26 15:26:16 -0400733pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400734 BoundLifetimes {
735 for_token: _i . for_token,
736 lt_token: _i . lt_token,
737 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
738 gt_token: _i . gt_token,
739 }
740}
741# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400742pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400743 use ::CaptureBy::*;
744 match _i {
745 Value(_binding_0, ) => {
746 Value (
747 _binding_0,
748 )
749 }
750 Ref => { Ref }
751 }
752}
753# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400754pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400755 use ::Constness::*;
756 match _i {
757 Const(_binding_0, ) => {
758 Const (
759 _binding_0,
760 )
761 }
762 NotConst => { NotConst }
763 }
764}
765# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400766pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400767 use ::Defaultness::*;
768 match _i {
769 Default(_binding_0, ) => {
770 Default (
771 _binding_0,
772 )
773 }
774 Final => { Final }
775 }
776}
777
Nika Layzella6f46c42017-10-26 15:26:16 -0400778pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400779 DeriveInput {
780 ident: _i . ident,
781 vis: _visitor.fold_visibility(_i . vis),
782 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
783 generics: _visitor.fold_generics(_i . generics),
784 body: _visitor.fold_body(_i . body),
785 }
786}
787
Nika Layzella6f46c42017-10-26 15:26:16 -0400788pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400789 Expr {
790 node: _visitor.fold_expr_kind(_i . node),
791 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
792 }
793}
794# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400795pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400796 ExprAddrOf {
797 and_token: _i . and_token,
798 mutbl: _visitor.fold_mutability(_i . mutbl),
799 expr: Box::new(_visitor.fold_expr(* _i . expr)),
800 }
801}
802# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400803pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400804 ExprArray {
805 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
806 bracket_token: _i . bracket_token,
807 }
808}
809# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400810pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400811 ExprAssign {
812 left: Box::new(_visitor.fold_expr(* _i . left)),
813 right: Box::new(_visitor.fold_expr(* _i . right)),
814 eq_token: _i . eq_token,
815 }
816}
817# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400818pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400819 ExprAssignOp {
820 op: _visitor.fold_bin_op(_i . op),
821 left: Box::new(_visitor.fold_expr(* _i . left)),
822 right: Box::new(_visitor.fold_expr(* _i . right)),
823 }
824}
825
Nika Layzella6f46c42017-10-26 15:26:16 -0400826pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400827 ExprBinary {
828 op: _visitor.fold_bin_op(_i . op),
829 left: Box::new(_visitor.fold_expr(* _i . left)),
830 right: Box::new(_visitor.fold_expr(* _i . right)),
831 }
832}
833# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400834pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400835 ExprBlock {
836 unsafety: _visitor.fold_unsafety(_i . unsafety),
837 block: _visitor.fold_block(_i . block),
838 }
839}
840# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400841pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400842 ExprBox {
843 expr: Box::new(_visitor.fold_expr(* _i . expr)),
844 box_token: _i . box_token,
845 }
846}
847# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400848pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400849 ExprBreak {
850 label: _i . label,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400851 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400852 break_token: _i . break_token,
853 }
854}
855
Nika Layzella6f46c42017-10-26 15:26:16 -0400856pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400857 ExprCall {
858 func: Box::new(_visitor.fold_expr(* _i . func)),
859 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
860 paren_token: _i . paren_token,
861 }
862}
863
Nika Layzella6f46c42017-10-26 15:26:16 -0400864pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400865 ExprCast {
866 expr: Box::new(_visitor.fold_expr(* _i . expr)),
867 as_token: _i . as_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800868 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400869 }
870}
871# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400872pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400873 ExprCatch {
874 do_token: _i . do_token,
875 catch_token: _i . catch_token,
876 block: _visitor.fold_block(_i . block),
877 }
878}
879# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400880pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400881 ExprClosure {
882 capture: _visitor.fold_capture_by(_i . capture),
883 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
884 body: Box::new(_visitor.fold_expr(* _i . body)),
885 or1_token: _i . or1_token,
886 or2_token: _i . or2_token,
887 }
888}
889# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400890pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400891 ExprContinue {
892 label: _i . label,
893 continue_token: _i . continue_token,
894 }
895}
896# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400897pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400898 ExprField {
899 expr: Box::new(_visitor.fold_expr(* _i . expr)),
900 field: _i . field,
901 dot_token: _i . dot_token,
902 }
903}
904# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400905pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400906 ExprForLoop {
907 pat: Box::new(_visitor.fold_pat(* _i . pat)),
908 expr: Box::new(_visitor.fold_expr(* _i . expr)),
909 body: _visitor.fold_block(_i . body),
910 label: _i . label,
911 for_token: _i . for_token,
912 colon_token: _i . colon_token,
913 in_token: _i . in_token,
914 }
915}
916
Nika Layzella6f46c42017-10-26 15:26:16 -0400917pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400918 ExprGroup {
919 expr: Box::new(_visitor.fold_expr(* _i . expr)),
920 group_token: _i . group_token,
921 }
922}
923# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400924pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400925 ExprIf {
926 cond: Box::new(_visitor.fold_expr(* _i . cond)),
927 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400928 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400929 if_token: _i . if_token,
930 else_token: _i . else_token,
931 }
932}
933# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400934pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400935 ExprIfLet {
936 pat: Box::new(_visitor.fold_pat(* _i . pat)),
937 expr: Box::new(_visitor.fold_expr(* _i . expr)),
938 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400939 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400940 if_token: _i . if_token,
941 let_token: _i . let_token,
942 eq_token: _i . eq_token,
943 else_token: _i . else_token,
944 }
945}
946# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400947pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400948 ExprInPlace {
949 place: Box::new(_visitor.fold_expr(* _i . place)),
950 kind: _visitor.fold_in_place_kind(_i . kind),
951 value: Box::new(_visitor.fold_expr(* _i . value)),
952 }
953}
954
Nika Layzella6f46c42017-10-26 15:26:16 -0400955pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400956 ExprIndex {
957 expr: Box::new(_visitor.fold_expr(* _i . expr)),
958 index: Box::new(_visitor.fold_expr(* _i . index)),
959 bracket_token: _i . bracket_token,
960 }
961}
962
Nika Layzella6f46c42017-10-26 15:26:16 -0400963pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400964 use ::ExprKind::*;
965 match _i {
966 Box(_binding_0, ) => {
967 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400968 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400969 )
970 }
971 InPlace(_binding_0, ) => {
972 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400973 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400974 )
975 }
976 Array(_binding_0, ) => {
977 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400978 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400979 )
980 }
981 Call(_binding_0, ) => {
982 Call (
983 _visitor.fold_expr_call(_binding_0),
984 )
985 }
986 MethodCall(_binding_0, ) => {
987 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400988 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400989 )
990 }
991 Tup(_binding_0, ) => {
992 Tup (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400993 full!(_visitor.fold_expr_tup(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400994 )
995 }
996 Binary(_binding_0, ) => {
997 Binary (
998 _visitor.fold_expr_binary(_binding_0),
999 )
1000 }
1001 Unary(_binding_0, ) => {
1002 Unary (
1003 _visitor.fold_expr_unary(_binding_0),
1004 )
1005 }
1006 Lit(_binding_0, ) => {
1007 Lit (
1008 _binding_0,
1009 )
1010 }
1011 Cast(_binding_0, ) => {
1012 Cast (
1013 _visitor.fold_expr_cast(_binding_0),
1014 )
1015 }
1016 Type(_binding_0, ) => {
1017 Type (
1018 _visitor.fold_expr_type(_binding_0),
1019 )
1020 }
1021 If(_binding_0, ) => {
1022 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001023 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001024 )
1025 }
1026 IfLet(_binding_0, ) => {
1027 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001028 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001029 )
1030 }
1031 While(_binding_0, ) => {
1032 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001033 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001034 )
1035 }
1036 WhileLet(_binding_0, ) => {
1037 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001038 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001039 )
1040 }
1041 ForLoop(_binding_0, ) => {
1042 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001043 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001044 )
1045 }
1046 Loop(_binding_0, ) => {
1047 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001048 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001049 )
1050 }
1051 Match(_binding_0, ) => {
1052 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001053 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001054 )
1055 }
1056 Closure(_binding_0, ) => {
1057 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001058 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001059 )
1060 }
1061 Block(_binding_0, ) => {
1062 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001063 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001064 )
1065 }
1066 Assign(_binding_0, ) => {
1067 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001068 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001069 )
1070 }
1071 AssignOp(_binding_0, ) => {
1072 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001073 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001074 )
1075 }
1076 Field(_binding_0, ) => {
1077 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001078 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001079 )
1080 }
1081 TupField(_binding_0, ) => {
1082 TupField (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001083 full!(_visitor.fold_expr_tup_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001084 )
1085 }
1086 Index(_binding_0, ) => {
1087 Index (
1088 _visitor.fold_expr_index(_binding_0),
1089 )
1090 }
1091 Range(_binding_0, ) => {
1092 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001093 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001094 )
1095 }
1096 Path(_binding_0, ) => {
1097 Path (
1098 _visitor.fold_expr_path(_binding_0),
1099 )
1100 }
1101 AddrOf(_binding_0, ) => {
1102 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001103 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001104 )
1105 }
1106 Break(_binding_0, ) => {
1107 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001108 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001109 )
1110 }
1111 Continue(_binding_0, ) => {
1112 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001113 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001114 )
1115 }
1116 Ret(_binding_0, ) => {
1117 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001118 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001119 )
1120 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001121 Macro(_binding_0, ) => {
1122 Macro (
1123 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001124 )
1125 }
1126 Struct(_binding_0, ) => {
1127 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001128 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001129 )
1130 }
1131 Repeat(_binding_0, ) => {
1132 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001133 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001134 )
1135 }
1136 Paren(_binding_0, ) => {
1137 Paren (
1138 _visitor.fold_expr_paren(_binding_0),
1139 )
1140 }
1141 Group(_binding_0, ) => {
1142 Group (
1143 _visitor.fold_expr_group(_binding_0),
1144 )
1145 }
1146 Try(_binding_0, ) => {
1147 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001148 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001149 )
1150 }
1151 Catch(_binding_0, ) => {
1152 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001153 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001154 )
1155 }
1156 Yield(_binding_0, ) => {
1157 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001158 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001159 )
1160 }
1161 }
1162}
1163# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001164pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001165 ExprLoop {
1166 body: _visitor.fold_block(_i . body),
1167 label: _i . label,
1168 loop_token: _i . loop_token,
1169 colon_token: _i . colon_token,
1170 }
1171}
1172# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001173pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001174 ExprMatch {
1175 match_token: _i . match_token,
1176 brace_token: _i . brace_token,
1177 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1178 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1179 }
1180}
1181# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001182pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001183 ExprMethodCall {
1184 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1185 method: _i . method,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001186 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001187 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1188 paren_token: _i . paren_token,
1189 dot_token: _i . dot_token,
1190 lt_token: _i . lt_token,
1191 colon2_token: _i . colon2_token,
1192 gt_token: _i . gt_token,
1193 }
1194}
1195
Nika Layzella6f46c42017-10-26 15:26:16 -04001196pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001197 ExprParen {
1198 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1199 paren_token: _i . paren_token,
1200 }
1201}
1202
Nika Layzella6f46c42017-10-26 15:26:16 -04001203pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001204 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001205 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001206 path: _visitor.fold_path(_i . path),
1207 }
1208}
1209# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001210pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001211 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001212 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1213 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001214 limits: _visitor.fold_range_limits(_i . limits),
1215 }
1216}
1217# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001218pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001219 ExprRepeat {
1220 bracket_token: _i . bracket_token,
1221 semi_token: _i . semi_token,
1222 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1223 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1224 }
1225}
1226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001227pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001228 ExprRet {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001229 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001230 return_token: _i . return_token,
1231 }
1232}
1233# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001234pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001235 ExprStruct {
1236 path: _visitor.fold_path(_i . path),
1237 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001238 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001239 dot2_token: _i . dot2_token,
1240 brace_token: _i . brace_token,
1241 }
1242}
1243# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001244pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001245 ExprTry {
1246 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1247 question_token: _i . question_token,
1248 }
1249}
1250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001251pub fn fold_expr_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTup) -> ExprTup {
Nika Layzell27726662017-10-24 23:16:35 -04001252 ExprTup {
1253 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1254 paren_token: _i . paren_token,
1255 lone_comma: _i . lone_comma,
1256 }
1257}
1258# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001259pub fn fold_expr_tup_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTupField) -> ExprTupField {
Nika Layzell27726662017-10-24 23:16:35 -04001260 ExprTupField {
1261 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1262 field: _i . field,
1263 dot_token: _i . dot_token,
1264 }
1265}
1266
Nika Layzella6f46c42017-10-26 15:26:16 -04001267pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001268 ExprType {
1269 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1270 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001271 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001272 }
1273}
1274
Nika Layzella6f46c42017-10-26 15:26:16 -04001275pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001276 ExprUnary {
1277 op: _visitor.fold_un_op(_i . op),
1278 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1279 }
1280}
1281# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001282pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001283 ExprWhile {
1284 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1285 body: _visitor.fold_block(_i . body),
1286 label: _i . label,
1287 colon_token: _i . colon_token,
1288 while_token: _i . while_token,
1289 }
1290}
1291# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001292pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001293 ExprWhileLet {
1294 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1295 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1296 body: _visitor.fold_block(_i . body),
1297 label: _i . label,
1298 colon_token: _i . colon_token,
1299 while_token: _i . while_token,
1300 let_token: _i . let_token,
1301 eq_token: _i . eq_token,
1302 }
1303}
1304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001305pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001306 ExprYield {
1307 yield_token: _i . yield_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001308 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001309 }
1310}
1311
Nika Layzella6f46c42017-10-26 15:26:16 -04001312pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001313 Field {
1314 ident: _i . ident,
1315 vis: _visitor.fold_visibility(_i . vis),
1316 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001317 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001318 colon_token: _i . colon_token,
1319 }
1320}
1321# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001322pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001323 FieldPat {
1324 ident: _i . ident,
1325 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1326 is_shorthand: _i . is_shorthand,
1327 colon_token: _i . colon_token,
1328 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1329 }
1330}
1331# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001332pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001333 FieldValue {
1334 ident: _i . ident,
1335 expr: _visitor.fold_expr(_i . expr),
1336 is_shorthand: _i . is_shorthand,
1337 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1338 colon_token: _i . colon_token,
1339 }
1340}
1341# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001342pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001343 File {
1344 shebang: _i . shebang,
1345 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1346 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1347 }
1348}
1349# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001350pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001351 use ::FnArg::*;
1352 match _i {
1353 SelfRef(_binding_0, ) => {
1354 SelfRef (
1355 _visitor.fold_arg_self_ref(_binding_0),
1356 )
1357 }
1358 SelfValue(_binding_0, ) => {
1359 SelfValue (
1360 _visitor.fold_arg_self(_binding_0),
1361 )
1362 }
1363 Captured(_binding_0, ) => {
1364 Captured (
1365 _visitor.fold_arg_captured(_binding_0),
1366 )
1367 }
1368 Ignored(_binding_0, ) => {
1369 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001370 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001371 )
1372 }
1373 }
1374}
1375# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001376pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001377 FnDecl {
1378 fn_token: _i . fn_token,
1379 paren_token: _i . paren_token,
1380 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001381 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001382 generics: _visitor.fold_generics(_i . generics),
1383 variadic: _i . variadic,
1384 dot_tokens: _i . dot_tokens,
1385 }
1386}
1387# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001388pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001389 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001390 match _i {
1391 Fn(_binding_0, ) => {
1392 Fn (
1393 _visitor.fold_foreign_item_fn(_binding_0),
1394 )
1395 }
1396 Static(_binding_0, ) => {
1397 Static (
1398 _visitor.fold_foreign_item_static(_binding_0),
1399 )
1400 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001401 Type(_binding_0, ) => {
1402 Type (
1403 _visitor.fold_foreign_item_type(_binding_0),
1404 )
1405 }
Nika Layzell27726662017-10-24 23:16:35 -04001406 }
1407}
1408# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001409pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1410 ForeignItemFn {
1411 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1412 vis: _visitor.fold_visibility(_i . vis),
1413 ident: _i . ident,
1414 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1415 semi_token: _i . semi_token,
1416 }
1417}
1418# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001419pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001420 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001421 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1422 vis: _visitor.fold_visibility(_i . vis),
Nika Layzell27726662017-10-24 23:16:35 -04001423 static_token: _i . static_token,
Nika Layzell27726662017-10-24 23:16:35 -04001424 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay8894f602017-11-11 12:11:04 -08001425 ident: _i . ident,
1426 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001427 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnay8894f602017-11-11 12:11:04 -08001428 semi_token: _i . semi_token,
Nika Layzell27726662017-10-24 23:16:35 -04001429 }
1430}
David Tolnay199bcbb2017-11-12 10:33:52 -08001431# [ cfg ( feature = "full" ) ]
1432pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1433 ForeignItemType {
1434 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1435 vis: _visitor.fold_visibility(_i . vis),
1436 type_token: _i . type_token,
1437 ident: _i . ident,
1438 semi_token: _i . semi_token,
1439 }
1440}
Nika Layzell27726662017-10-24 23:16:35 -04001441
David Tolnayc2f1aba2017-11-12 20:29:22 -08001442pub fn fold_generic_param<V: Folder + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1443 use ::GenericParam::*;
1444 match _i {
1445 Lifetime(_binding_0, ) => {
1446 Lifetime (
1447 _visitor.fold_lifetime_def(_binding_0),
1448 )
1449 }
1450 Type(_binding_0, ) => {
1451 Type (
1452 _visitor.fold_type_param(_binding_0),
1453 )
1454 }
1455 }
1456}
1457
Nika Layzella6f46c42017-10-26 15:26:16 -04001458pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001459 Generics {
1460 lt_token: _i . lt_token,
David Tolnayc2f1aba2017-11-12 20:29:22 -08001461 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001462 gt_token: _i . gt_token,
Nika Layzell27726662017-10-24 23:16:35 -04001463 where_clause: _visitor.fold_where_clause(_i . where_clause),
1464 }
1465}
1466# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001467pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001468 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001469 match _i {
1470 Const(_binding_0, ) => {
1471 Const (
1472 _visitor.fold_impl_item_const(_binding_0),
1473 )
1474 }
1475 Method(_binding_0, ) => {
1476 Method (
1477 _visitor.fold_impl_item_method(_binding_0),
1478 )
1479 }
1480 Type(_binding_0, ) => {
1481 Type (
1482 _visitor.fold_impl_item_type(_binding_0),
1483 )
1484 }
1485 Macro(_binding_0, ) => {
1486 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001487 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001488 )
1489 }
1490 }
1491}
1492# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001493pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1494 ImplItemConst {
1495 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1496 vis: _visitor.fold_visibility(_i . vis),
1497 defaultness: _visitor.fold_defaultness(_i . defaultness),
1498 const_token: _i . const_token,
1499 ident: _i . ident,
1500 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001501 ty: _visitor.fold_type(_i . ty),
David Tolnay857628c2017-11-11 12:25:31 -08001502 eq_token: _i . eq_token,
1503 expr: _visitor.fold_expr(_i . expr),
1504 semi_token: _i . semi_token,
1505 }
1506}
1507# [ cfg ( feature = "full" ) ]
1508pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1509 ImplItemMacro {
1510 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1511 mac: _visitor.fold_macro(_i . mac),
1512 }
1513}
1514# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001515pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001516 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001517 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001518 vis: _visitor.fold_visibility(_i . vis),
1519 defaultness: _visitor.fold_defaultness(_i . defaultness),
1520 sig: _visitor.fold_method_sig(_i . sig),
1521 block: _visitor.fold_block(_i . block),
1522 }
1523}
1524# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001525pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001526 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001527 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001528 vis: _visitor.fold_visibility(_i . vis),
1529 defaultness: _visitor.fold_defaultness(_i . defaultness),
1530 type_token: _i . type_token,
1531 ident: _i . ident,
1532 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001533 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001534 semi_token: _i . semi_token,
1535 }
1536}
1537# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001538pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001539 use ::ImplPolarity::*;
1540 match _i {
1541 Positive => { Positive }
1542 Negative(_binding_0, ) => {
1543 Negative (
1544 _binding_0,
1545 )
1546 }
1547 }
1548}
1549# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001550pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001551 use ::InPlaceKind::*;
1552 match _i {
1553 Arrow(_binding_0, ) => {
1554 Arrow (
1555 _binding_0,
1556 )
1557 }
1558 In(_binding_0, ) => {
1559 In (
1560 _binding_0,
1561 )
1562 }
1563 }
1564}
1565# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001566pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001567 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001568 match _i {
1569 ExternCrate(_binding_0, ) => {
1570 ExternCrate (
1571 _visitor.fold_item_extern_crate(_binding_0),
1572 )
1573 }
1574 Use(_binding_0, ) => {
1575 Use (
1576 _visitor.fold_item_use(_binding_0),
1577 )
1578 }
1579 Static(_binding_0, ) => {
1580 Static (
1581 _visitor.fold_item_static(_binding_0),
1582 )
1583 }
1584 Const(_binding_0, ) => {
1585 Const (
1586 _visitor.fold_item_const(_binding_0),
1587 )
1588 }
1589 Fn(_binding_0, ) => {
1590 Fn (
1591 _visitor.fold_item_fn(_binding_0),
1592 )
1593 }
1594 Mod(_binding_0, ) => {
1595 Mod (
1596 _visitor.fold_item_mod(_binding_0),
1597 )
1598 }
1599 ForeignMod(_binding_0, ) => {
1600 ForeignMod (
1601 _visitor.fold_item_foreign_mod(_binding_0),
1602 )
1603 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001604 Type(_binding_0, ) => {
1605 Type (
1606 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001607 )
1608 }
1609 Enum(_binding_0, ) => {
1610 Enum (
1611 _visitor.fold_item_enum(_binding_0),
1612 )
1613 }
1614 Struct(_binding_0, ) => {
1615 Struct (
1616 _visitor.fold_item_struct(_binding_0),
1617 )
1618 }
1619 Union(_binding_0, ) => {
1620 Union (
1621 _visitor.fold_item_union(_binding_0),
1622 )
1623 }
1624 Trait(_binding_0, ) => {
1625 Trait (
1626 _visitor.fold_item_trait(_binding_0),
1627 )
1628 }
1629 DefaultImpl(_binding_0, ) => {
1630 DefaultImpl (
1631 _visitor.fold_item_default_impl(_binding_0),
1632 )
1633 }
1634 Impl(_binding_0, ) => {
1635 Impl (
1636 _visitor.fold_item_impl(_binding_0),
1637 )
1638 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001639 Macro(_binding_0, ) => {
1640 Macro (
1641 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001642 )
1643 }
1644 }
1645}
1646# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001647pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1648 ItemConst {
1649 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1650 vis: _visitor.fold_visibility(_i . vis),
1651 const_token: _i . const_token,
1652 ident: _i . ident,
1653 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001654 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001655 eq_token: _i . eq_token,
1656 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1657 semi_token: _i . semi_token,
1658 }
1659}
1660# [ cfg ( feature = "full" ) ]
1661pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1662 ItemDefaultImpl {
1663 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1664 unsafety: _visitor.fold_unsafety(_i . unsafety),
1665 impl_token: _i . impl_token,
1666 path: _visitor.fold_path(_i . path),
1667 for_token: _i . for_token,
1668 dot2_token: _i . dot2_token,
1669 brace_token: _i . brace_token,
1670 }
1671}
1672# [ cfg ( feature = "full" ) ]
1673pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1674 ItemEnum {
1675 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1676 vis: _visitor.fold_visibility(_i . vis),
1677 enum_token: _i . enum_token,
1678 ident: _i . ident,
1679 generics: _visitor.fold_generics(_i . generics),
1680 brace_token: _i . brace_token,
1681 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1682 }
1683}
1684# [ cfg ( feature = "full" ) ]
1685pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1686 ItemExternCrate {
1687 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1688 vis: _visitor.fold_visibility(_i . vis),
1689 extern_token: _i . extern_token,
1690 crate_token: _i . crate_token,
1691 ident: _i . ident,
1692 rename: _i . rename,
1693 semi_token: _i . semi_token,
1694 }
1695}
1696# [ cfg ( feature = "full" ) ]
1697pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1698 ItemFn {
1699 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1700 vis: _visitor.fold_visibility(_i . vis),
1701 constness: _visitor.fold_constness(_i . constness),
1702 unsafety: _visitor.fold_unsafety(_i . unsafety),
1703 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1704 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1705 ident: _i . ident,
1706 block: Box::new(_visitor.fold_block(* _i . block)),
1707 }
1708}
1709# [ cfg ( feature = "full" ) ]
1710pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1711 ItemForeignMod {
1712 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1713 abi: _visitor.fold_abi(_i . abi),
1714 brace_token: _i . brace_token,
1715 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1716 }
1717}
1718# [ cfg ( feature = "full" ) ]
1719pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1720 ItemImpl {
1721 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1722 defaultness: _visitor.fold_defaultness(_i . defaultness),
1723 unsafety: _visitor.fold_unsafety(_i . unsafety),
1724 impl_token: _i . impl_token,
1725 generics: _visitor.fold_generics(_i . generics),
1726 trait_: _i . trait_,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001727 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001728 brace_token: _i . brace_token,
1729 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1730 }
1731}
1732# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001733pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1734 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001735 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay99a953d2017-11-11 12:51:43 -08001736 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001737 mac: _visitor.fold_macro(_i . mac),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001738 }
1739}
1740# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001741pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001742 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001743 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001744 vis: _visitor.fold_visibility(_i . vis),
1745 mod_token: _i . mod_token,
1746 ident: _i . ident,
1747 content: _i . content,
1748 semi: _i . semi,
1749 }
1750}
1751# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001752pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001753 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001754 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001755 vis: _visitor.fold_visibility(_i . vis),
1756 static_token: _i . static_token,
1757 mutbl: _visitor.fold_mutability(_i . mutbl),
1758 ident: _i . ident,
1759 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001760 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001761 eq_token: _i . eq_token,
1762 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1763 semi_token: _i . semi_token,
1764 }
1765}
1766# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001767pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001768 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001769 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001770 vis: _visitor.fold_visibility(_i . vis),
1771 struct_token: _i . struct_token,
1772 ident: _i . ident,
1773 generics: _visitor.fold_generics(_i . generics),
1774 data: _visitor.fold_variant_data(_i . data),
1775 semi_token: _i . semi_token,
1776 }
1777}
1778# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001779pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001780 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001781 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001782 vis: _visitor.fold_visibility(_i . vis),
1783 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell0dc6e632017-11-18 12:55:25 -05001784 auto_token: _i . auto_token,
Nika Layzell27726662017-10-24 23:16:35 -04001785 trait_token: _i . trait_token,
1786 ident: _i . ident,
1787 generics: _visitor.fold_generics(_i . generics),
1788 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001789 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001790 brace_token: _i . brace_token,
1791 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1792 }
1793}
1794# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001795pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1796 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001797 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001798 vis: _visitor.fold_visibility(_i . vis),
1799 type_token: _i . type_token,
1800 ident: _i . ident,
1801 generics: _visitor.fold_generics(_i . generics),
1802 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001803 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001804 semi_token: _i . semi_token,
1805 }
1806}
1807# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001808pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001809 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001810 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001811 vis: _visitor.fold_visibility(_i . vis),
1812 union_token: _i . union_token,
1813 ident: _i . ident,
1814 generics: _visitor.fold_generics(_i . generics),
1815 data: _visitor.fold_variant_data(_i . data),
1816 }
1817}
1818# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001819pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001820 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001821 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001822 vis: _visitor.fold_visibility(_i . vis),
1823 use_token: _i . use_token,
1824 path: Box::new(_visitor.fold_view_path(* _i . path)),
1825 semi_token: _i . semi_token,
1826 }
1827}
1828
Nika Layzella6f46c42017-10-26 15:26:16 -04001829pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001830 LifetimeDef {
1831 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1832 lifetime: _i . lifetime,
1833 colon_token: _i . colon_token,
1834 bounds: _i . bounds,
1835 }
1836}
1837# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001838pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001839 Local {
1840 let_token: _i . let_token,
1841 colon_token: _i . colon_token,
1842 eq_token: _i . eq_token,
1843 semi_token: _i . semi_token,
1844 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001845 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001846 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001847 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1848 }
1849}
Nika Layzell27726662017-10-24 23:16:35 -04001850# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001851pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
Nika Layzell27726662017-10-24 23:16:35 -04001852 use ::MacStmtStyle::*;
1853 match _i {
1854 Semicolon(_binding_0, ) => {
1855 Semicolon (
1856 _binding_0,
1857 )
1858 }
1859 Braces => { Braces }
1860 NoBraces => { NoBraces }
1861 }
1862}
1863
David Tolnaydecf28d2017-11-11 11:56:45 -08001864pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1865 Macro {
1866 path: _visitor.fold_path(_i . path),
1867 bang_token: _i . bang_token,
David Tolnaydecf28d2017-11-11 11:56:45 -08001868 tokens: _i . tokens,
1869 }
1870}
1871
Nika Layzella6f46c42017-10-26 15:26:16 -04001872pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001873 use ::MetaItem::*;
1874 match _i {
1875 Term(_binding_0, ) => {
1876 Term (
1877 _binding_0,
1878 )
1879 }
1880 List(_binding_0, ) => {
1881 List (
1882 _visitor.fold_meta_item_list(_binding_0),
1883 )
1884 }
1885 NameValue(_binding_0, ) => {
1886 NameValue (
1887 _visitor.fold_meta_name_value(_binding_0),
1888 )
1889 }
1890 }
1891}
1892
Nika Layzella6f46c42017-10-26 15:26:16 -04001893pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001894 MetaItemList {
1895 ident: _i . ident,
1896 paren_token: _i . paren_token,
1897 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1898 }
1899}
1900
Nika Layzella6f46c42017-10-26 15:26:16 -04001901pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001902 MetaNameValue {
1903 ident: _i . ident,
1904 eq_token: _i . eq_token,
1905 lit: _i . lit,
1906 }
1907}
1908# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001909pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001910 MethodSig {
1911 constness: _visitor.fold_constness(_i . constness),
1912 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001913 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001914 ident: _i . ident,
1915 decl: _visitor.fold_fn_decl(_i . decl),
1916 }
1917}
1918
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001919pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1920 MutType {
1921 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001922 mutability: _visitor.fold_mutability(_i . mutability),
1923 }
1924}
1925
Nika Layzella6f46c42017-10-26 15:26:16 -04001926pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04001927 use ::Mutability::*;
1928 match _i {
1929 Mutable(_binding_0, ) => {
1930 Mutable (
1931 _binding_0,
1932 )
1933 }
1934 Immutable => { Immutable }
1935 }
1936}
1937
Nika Layzella6f46c42017-10-26 15:26:16 -04001938pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001939 use ::NestedMetaItem::*;
1940 match _i {
1941 MetaItem(_binding_0, ) => {
1942 MetaItem (
1943 _visitor.fold_meta_item(_binding_0),
1944 )
1945 }
1946 Literal(_binding_0, ) => {
1947 Literal (
1948 _binding_0,
1949 )
1950 }
1951 }
1952}
1953
Nika Layzella6f46c42017-10-26 15:26:16 -04001954pub fn fold_parenthesized_parameter_data<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedParameterData) -> ParenthesizedParameterData {
Nika Layzell27726662017-10-24 23:16:35 -04001955 ParenthesizedParameterData {
1956 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001957 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001958 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001959 }
1960}
1961# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001962pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04001963 use ::Pat::*;
1964 match _i {
1965 Wild(_binding_0, ) => {
1966 Wild (
1967 _visitor.fold_pat_wild(_binding_0),
1968 )
1969 }
1970 Ident(_binding_0, ) => {
1971 Ident (
1972 _visitor.fold_pat_ident(_binding_0),
1973 )
1974 }
1975 Struct(_binding_0, ) => {
1976 Struct (
1977 _visitor.fold_pat_struct(_binding_0),
1978 )
1979 }
1980 TupleStruct(_binding_0, ) => {
1981 TupleStruct (
1982 _visitor.fold_pat_tuple_struct(_binding_0),
1983 )
1984 }
1985 Path(_binding_0, ) => {
1986 Path (
1987 _visitor.fold_pat_path(_binding_0),
1988 )
1989 }
1990 Tuple(_binding_0, ) => {
1991 Tuple (
1992 _visitor.fold_pat_tuple(_binding_0),
1993 )
1994 }
1995 Box(_binding_0, ) => {
1996 Box (
1997 _visitor.fold_pat_box(_binding_0),
1998 )
1999 }
2000 Ref(_binding_0, ) => {
2001 Ref (
2002 _visitor.fold_pat_ref(_binding_0),
2003 )
2004 }
2005 Lit(_binding_0, ) => {
2006 Lit (
2007 _visitor.fold_pat_lit(_binding_0),
2008 )
2009 }
2010 Range(_binding_0, ) => {
2011 Range (
2012 _visitor.fold_pat_range(_binding_0),
2013 )
2014 }
2015 Slice(_binding_0, ) => {
2016 Slice (
2017 _visitor.fold_pat_slice(_binding_0),
2018 )
2019 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002020 Macro(_binding_0, ) => {
2021 Macro (
2022 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002023 )
2024 }
2025 }
2026}
2027# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002028pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002029 PatBox {
2030 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2031 box_token: _i . box_token,
2032 }
2033}
2034# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002035pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002036 PatIdent {
2037 mode: _visitor.fold_binding_mode(_i . mode),
2038 ident: _i . ident,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002039 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002040 at_token: _i . at_token,
2041 }
2042}
2043# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002044pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002045 PatLit {
2046 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2047 }
2048}
2049# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002050pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002051 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002052 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002053 path: _visitor.fold_path(_i . path),
2054 }
2055}
2056# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002057pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002058 PatRange {
2059 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2060 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2061 limits: _visitor.fold_range_limits(_i . limits),
2062 }
2063}
2064# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002065pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002066 PatRef {
2067 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2068 mutbl: _visitor.fold_mutability(_i . mutbl),
2069 and_token: _i . and_token,
2070 }
2071}
2072# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002073pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002074 PatSlice {
2075 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002076 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002077 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2078 dot2_token: _i . dot2_token,
2079 comma_token: _i . comma_token,
2080 bracket_token: _i . bracket_token,
2081 }
2082}
2083# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002084pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002085 PatStruct {
2086 path: _visitor.fold_path(_i . path),
2087 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2088 brace_token: _i . brace_token,
2089 dot2_token: _i . dot2_token,
2090 }
2091}
2092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002093pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002094 PatTuple {
2095 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
2096 dots_pos: _i . dots_pos,
2097 paren_token: _i . paren_token,
2098 dot2_token: _i . dot2_token,
2099 comma_token: _i . comma_token,
2100 }
2101}
2102# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002103pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002104 PatTupleStruct {
2105 path: _visitor.fold_path(_i . path),
2106 pat: _visitor.fold_pat_tuple(_i . pat),
2107 }
2108}
2109# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002110pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002111 PatWild {
2112 underscore_token: _i . underscore_token,
2113 }
2114}
2115
Nika Layzella6f46c42017-10-26 15:26:16 -04002116pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002117 Path {
2118 leading_colon: _i . leading_colon,
2119 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_path_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: PathGlob) -> PathGlob {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PathGlob {
2125 path: _visitor.fold_path(_i . path),
2126 colon2_token: _i . colon2_token,
2127 star_token: _i . star_token,
2128 }
2129}
2130# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_path_list<V: Folder + ?Sized>(_visitor: &mut V, _i: PathList) -> PathList {
Nika Layzell27726662017-10-24 23:16:35 -04002132 PathList {
2133 path: _visitor.fold_path(_i . path),
2134 colon2_token: _i . colon2_token,
2135 brace_token: _i . brace_token,
2136 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_path_list_item(it) }),
2137 }
2138}
2139# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002140pub fn fold_path_list_item<V: Folder + ?Sized>(_visitor: &mut V, _i: PathListItem) -> PathListItem {
Nika Layzell27726662017-10-24 23:16:35 -04002141 PathListItem {
2142 name: _i . name,
2143 rename: _i . rename,
2144 as_token: _i . as_token,
2145 }
2146}
2147
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_path_parameters<V: Folder + ?Sized>(_visitor: &mut V, _i: PathParameters) -> PathParameters {
Nika Layzell27726662017-10-24 23:16:35 -04002149 use ::PathParameters::*;
2150 match _i {
2151 None => { None }
2152 AngleBracketed(_binding_0, ) => {
2153 AngleBracketed (
2154 _visitor.fold_angle_bracketed_parameter_data(_binding_0),
2155 )
2156 }
2157 Parenthesized(_binding_0, ) => {
2158 Parenthesized (
2159 _visitor.fold_parenthesized_parameter_data(_binding_0),
2160 )
2161 }
2162 }
2163}
2164
Nika Layzella6f46c42017-10-26 15:26:16 -04002165pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002166 PathSegment {
2167 ident: _i . ident,
2168 parameters: _visitor.fold_path_parameters(_i . parameters),
2169 }
2170}
2171# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002172pub fn fold_path_simple<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSimple) -> PathSimple {
Nika Layzell27726662017-10-24 23:16:35 -04002173 PathSimple {
2174 path: _visitor.fold_path(_i . path),
2175 as_token: _i . as_token,
2176 rename: _i . rename,
2177 }
2178}
2179
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002181 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002182 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002183 trait_ref: _visitor.fold_path(_i . trait_ref),
2184 }
2185}
2186
Nika Layzella6f46c42017-10-26 15:26:16 -04002187pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002188 QSelf {
2189 lt_token: _i . lt_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002190 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002191 position: _i . position,
2192 as_token: _i . as_token,
2193 gt_token: _i . gt_token,
2194 }
2195}
2196# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002197pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002198 use ::RangeLimits::*;
2199 match _i {
2200 HalfOpen(_binding_0, ) => {
2201 HalfOpen (
2202 _binding_0,
2203 )
2204 }
2205 Closed(_binding_0, ) => {
2206 Closed (
2207 _binding_0,
2208 )
2209 }
2210 }
2211}
David Tolnayf93b90d2017-11-11 19:21:26 -08002212
2213pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2214 use ::ReturnType::*;
2215 match _i {
2216 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002217 Type(_binding_0, _binding_1, ) => {
2218 Type (
2219 _visitor.fold_type(_binding_0),
David Tolnayf93b90d2017-11-11 19:21:26 -08002220 _binding_1,
2221 )
2222 }
2223 }
2224}
Nika Layzell27726662017-10-24 23:16:35 -04002225# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002226pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002227 use ::Stmt::*;
2228 match _i {
2229 Local(_binding_0, ) => {
2230 Local (
2231 Box::new(_visitor.fold_local(* _binding_0)),
2232 )
2233 }
2234 Item(_binding_0, ) => {
2235 Item (
2236 Box::new(_visitor.fold_item(* _binding_0)),
2237 )
2238 }
2239 Expr(_binding_0, ) => {
2240 Expr (
2241 Box::new(_visitor.fold_expr(* _binding_0)),
2242 )
2243 }
2244 Semi(_binding_0, _binding_1, ) => {
2245 Semi (
2246 Box::new(_visitor.fold_expr(* _binding_0)),
2247 _binding_1,
2248 )
2249 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002250 Macro(_binding_0, ) => {
2251 Macro (
Nika Layzell27726662017-10-24 23:16:35 -04002252 _binding_0,
2253 )
2254 }
2255 }
2256}
2257
Nika Layzella6f46c42017-10-26 15:26:16 -04002258pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002259 use ::TraitBoundModifier::*;
2260 match _i {
2261 None => { None }
2262 Maybe(_binding_0, ) => {
2263 Maybe (
2264 _binding_0,
2265 )
2266 }
2267 }
2268}
2269# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002270pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002271 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002272 match _i {
2273 Const(_binding_0, ) => {
2274 Const (
2275 _visitor.fold_trait_item_const(_binding_0),
2276 )
2277 }
2278 Method(_binding_0, ) => {
2279 Method (
2280 _visitor.fold_trait_item_method(_binding_0),
2281 )
2282 }
2283 Type(_binding_0, ) => {
2284 Type (
2285 _visitor.fold_trait_item_type(_binding_0),
2286 )
2287 }
2288 Macro(_binding_0, ) => {
2289 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002290 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002291 )
2292 }
2293 }
2294}
2295# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002296pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2297 TraitItemConst {
2298 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2299 const_token: _i . const_token,
2300 ident: _i . ident,
2301 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002302 ty: _visitor.fold_type(_i . ty),
David Tolnayda705bd2017-11-10 21:58:05 -08002303 default: _i . default,
2304 semi_token: _i . semi_token,
2305 }
2306}
2307# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002308pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2309 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002310 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002311 mac: _visitor.fold_macro(_i . mac),
David Tolnayda705bd2017-11-10 21:58:05 -08002312 }
2313}
2314# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002315pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002316 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002317 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002318 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002319 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002320 semi_token: _i . semi_token,
2321 }
2322}
2323# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002324pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002325 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002326 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002327 type_token: _i . type_token,
2328 ident: _i . ident,
2329 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002330 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002331 default: _i . default,
2332 semi_token: _i . semi_token,
2333 }
2334}
2335
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002336pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2337 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002338 match _i {
2339 Slice(_binding_0, ) => {
2340 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002341 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002342 )
2343 }
2344 Array(_binding_0, ) => {
2345 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002346 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002347 )
2348 }
2349 Ptr(_binding_0, ) => {
2350 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002351 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002352 )
2353 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002354 Reference(_binding_0, ) => {
2355 Reference (
2356 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002357 )
2358 }
2359 BareFn(_binding_0, ) => {
2360 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002361 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002362 )
2363 }
2364 Never(_binding_0, ) => {
2365 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002366 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002367 )
2368 }
2369 Tup(_binding_0, ) => {
2370 Tup (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002371 _visitor.fold_type_tup(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002372 )
2373 }
2374 Path(_binding_0, ) => {
2375 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002376 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002377 )
2378 }
2379 TraitObject(_binding_0, ) => {
2380 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002381 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002382 )
2383 }
2384 ImplTrait(_binding_0, ) => {
2385 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002386 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002387 )
2388 }
2389 Paren(_binding_0, ) => {
2390 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002391 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002392 )
2393 }
2394 Group(_binding_0, ) => {
2395 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002396 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002397 )
2398 }
2399 Infer(_binding_0, ) => {
2400 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002401 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002402 )
2403 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002404 Macro(_binding_0, ) => {
2405 Macro (
2406 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002407 )
2408 }
2409 }
2410}
2411
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002412pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2413 TypeArray {
Nika Layzell27726662017-10-24 23:16:35 -04002414 bracket_token: _i . bracket_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002415 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002416 semi_token: _i . semi_token,
2417 amt: _visitor.fold_expr(_i . amt),
2418 }
2419}
2420
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002421pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2422 TypeBareFn {
2423 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002424 }
2425}
2426
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002427pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2428 TypeBinding {
2429 ident: _i . ident,
2430 eq_token: _i . eq_token,
2431 ty: _visitor.fold_type(_i . ty),
2432 }
2433}
2434
2435pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2436 TypeGroup {
Nika Layzell27726662017-10-24 23:16:35 -04002437 group_token: _i . group_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002438 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002439 }
2440}
2441
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002442pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2443 TypeImplTrait {
Nika Layzell27726662017-10-24 23:16:35 -04002444 impl_token: _i . impl_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002445 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002446 }
2447}
2448
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2450 TypeInfer {
Nika Layzell27726662017-10-24 23:16:35 -04002451 underscore_token: _i . underscore_token,
2452 }
2453}
2454
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2456 TypeNever {
Nika Layzell27726662017-10-24 23:16:35 -04002457 bang_token: _i . bang_token,
2458 }
2459}
2460
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002461pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2462 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002463 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2464 ident: _i . ident,
2465 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002466 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002467 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002468 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002469 }
2470}
2471
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002472pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2473 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002474 match _i {
2475 Trait(_binding_0, _binding_1, ) => {
2476 Trait (
2477 _visitor.fold_poly_trait_ref(_binding_0),
2478 _visitor.fold_trait_bound_modifier(_binding_1),
2479 )
2480 }
2481 Region(_binding_0, ) => {
2482 Region (
2483 _binding_0,
2484 )
2485 }
2486 }
2487}
2488
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002489pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2490 TypeParen {
Nika Layzell27726662017-10-24 23:16:35 -04002491 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002492 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002493 }
2494}
2495
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002496pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2497 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002498 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002499 path: _visitor.fold_path(_i . path),
2500 }
2501}
2502
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002503pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2504 TypePtr {
Nika Layzell27726662017-10-24 23:16:35 -04002505 star_token: _i . star_token,
2506 const_token: _i . const_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002507 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002508 }
2509}
2510
David Tolnay0a89b4d2017-11-13 00:55:45 -08002511pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2512 TypeReference {
Nika Layzell27726662017-10-24 23:16:35 -04002513 and_token: _i . and_token,
2514 lifetime: _i . lifetime,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002515 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002516 }
2517}
2518
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002519pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2520 TypeSlice {
2521 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002522 bracket_token: _i . bracket_token,
2523 }
2524}
2525
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002526pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2527 TypeTraitObject {
2528 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002529 }
2530}
2531
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002532pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
2533 TypeTup {
Nika Layzell27726662017-10-24 23:16:35 -04002534 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002535 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002536 lone_comma: _i . lone_comma,
2537 }
2538}
2539
Nika Layzella6f46c42017-10-26 15:26:16 -04002540pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002541 use ::UnOp::*;
2542 match _i {
2543 Deref(_binding_0, ) => {
2544 Deref (
2545 _binding_0,
2546 )
2547 }
2548 Not(_binding_0, ) => {
2549 Not (
2550 _binding_0,
2551 )
2552 }
2553 Neg(_binding_0, ) => {
2554 Neg (
2555 _binding_0,
2556 )
2557 }
2558 }
2559}
2560
Nika Layzella6f46c42017-10-26 15:26:16 -04002561pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002562 use ::Unsafety::*;
2563 match _i {
2564 Unsafe(_binding_0, ) => {
2565 Unsafe (
2566 _binding_0,
2567 )
2568 }
2569 Normal => { Normal }
2570 }
2571}
2572
Nika Layzella6f46c42017-10-26 15:26:16 -04002573pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002574 Variant {
2575 ident: _i . ident,
2576 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2577 data: _visitor.fold_variant_data(_i . data),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002578 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002579 eq_token: _i . eq_token,
2580 }
2581}
2582
Nika Layzella6f46c42017-10-26 15:26:16 -04002583pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002584 use ::VariantData::*;
2585 match _i {
2586 Struct(_binding_0, _binding_1, ) => {
2587 Struct (
2588 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2589 _binding_1,
2590 )
2591 }
2592 Tuple(_binding_0, _binding_1, ) => {
2593 Tuple (
2594 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2595 _binding_1,
2596 )
2597 }
2598 Unit => { Unit }
2599 }
2600}
2601# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002602pub fn fold_view_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ViewPath) -> ViewPath {
Nika Layzell27726662017-10-24 23:16:35 -04002603 use ::ViewPath::*;
2604 match _i {
2605 Simple(_binding_0, ) => {
2606 Simple (
2607 _visitor.fold_path_simple(_binding_0),
2608 )
2609 }
2610 Glob(_binding_0, ) => {
2611 Glob (
2612 _visitor.fold_path_glob(_binding_0),
2613 )
2614 }
2615 List(_binding_0, ) => {
2616 List (
2617 _visitor.fold_path_list(_binding_0),
2618 )
2619 }
2620 }
2621}
2622
Nika Layzella6f46c42017-10-26 15:26:16 -04002623pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002624 VisCrate {
2625 pub_token: _i . pub_token,
2626 paren_token: _i . paren_token,
2627 crate_token: _i . crate_token,
2628 }
2629}
2630
Nika Layzella6f46c42017-10-26 15:26:16 -04002631pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002632 VisInherited {
2633 }
2634}
2635
Nika Layzella6f46c42017-10-26 15:26:16 -04002636pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002637 VisPublic {
2638 pub_token: _i . pub_token,
2639 }
2640}
2641
Nika Layzella6f46c42017-10-26 15:26:16 -04002642pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002643 VisRestricted {
2644 pub_token: _i . pub_token,
2645 paren_token: _i . paren_token,
2646 in_token: _i . in_token,
2647 path: Box::new(_visitor.fold_path(* _i . path)),
2648 }
2649}
2650
Nika Layzella6f46c42017-10-26 15:26:16 -04002651pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002652 use ::Visibility::*;
2653 match _i {
2654 Public(_binding_0, ) => {
2655 Public (
2656 _visitor.fold_vis_public(_binding_0),
2657 )
2658 }
2659 Crate(_binding_0, ) => {
2660 Crate (
2661 _visitor.fold_vis_crate(_binding_0),
2662 )
2663 }
2664 Restricted(_binding_0, ) => {
2665 Restricted (
2666 _visitor.fold_vis_restricted(_binding_0),
2667 )
2668 }
2669 Inherited(_binding_0, ) => {
2670 Inherited (
2671 _visitor.fold_vis_inherited(_binding_0),
2672 )
2673 }
2674 }
2675}
2676
Nika Layzella6f46c42017-10-26 15:26:16 -04002677pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002678 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002679 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002680 bounded_ty: _visitor.fold_type(_i . bounded_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002681 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002682 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002683 }
2684}
2685
Nika Layzella6f46c42017-10-26 15:26:16 -04002686pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002687 WhereClause {
2688 where_token: _i . where_token,
2689 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2690 }
2691}
2692
Nika Layzella6f46c42017-10-26 15:26:16 -04002693pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002694 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002695 lhs_ty: _visitor.fold_type(_i . lhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002696 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002697 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002698 }
2699}
2700
Nika Layzella6f46c42017-10-26 15:26:16 -04002701pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002702 use ::WherePredicate::*;
2703 match _i {
2704 BoundPredicate(_binding_0, ) => {
2705 BoundPredicate (
2706 _visitor.fold_where_bound_predicate(_binding_0),
2707 )
2708 }
2709 RegionPredicate(_binding_0, ) => {
2710 RegionPredicate (
2711 _visitor.fold_where_region_predicate(_binding_0),
2712 )
2713 }
2714 EqPredicate(_binding_0, ) => {
2715 EqPredicate (
2716 _visitor.fold_where_eq_predicate(_binding_0),
2717 )
2718 }
2719 }
2720}
2721
Nika Layzella6f46c42017-10-26 15:26:16 -04002722pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002723 WhereRegionPredicate {
2724 lifetime: _i . lifetime,
2725 colon_token: _i . colon_token,
2726 bounds: _i . bounds,
2727 }
2728}
2729