blob: a03ed316dfd7600ccc68514b108ef63697f106aa [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
Nika Layzella6f46c42017-10-26 15:26:16 -0400205fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400206# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400207fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400209fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400210# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -0800211fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400212# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400213fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400214# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400215fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400216# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400217fn fold_impl_polarity(&mut self, i: ImplPolarity) -> ImplPolarity { fold_impl_polarity(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400218# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400219fn fold_in_place_kind(&mut self, i: InPlaceKind) -> InPlaceKind { fold_in_place_kind(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400220# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400221fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400222# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400223fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400225fn fold_item_default_impl(&mut self, i: ItemDefaultImpl) -> ItemDefaultImpl { fold_item_default_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400226# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400227fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400228# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400229fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400230# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400231fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400232# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400233fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400234# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400235fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400236# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800237fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400238# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400239fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400240# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400241fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400242# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400243fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400244# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400245fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400246# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800247fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400249fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400250# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400251fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400252
Nika Layzella6f46c42017-10-26 15:26:16 -0400253fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400254# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400255fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400257fn fold_mac_stmt_style(&mut self, i: MacStmtStyle) -> MacStmtStyle { fold_mac_stmt_style(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400258
David Tolnaydecf28d2017-11-11 11:56:45 -0800259fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
260
Nika Layzella6f46c42017-10-26 15:26:16 -0400261fn fold_meta_item(&mut self, i: MetaItem) -> MetaItem { fold_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400262
Nika Layzella6f46c42017-10-26 15:26:16 -0400263fn fold_meta_item_list(&mut self, i: MetaItemList) -> MetaItemList { fold_meta_item_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400264
Nika Layzella6f46c42017-10-26 15:26:16 -0400265fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400266# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400267fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400268
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800269fn fold_mut_type(&mut self, i: MutType) -> MutType { fold_mut_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400270
Nika Layzella6f46c42017-10-26 15:26:16 -0400271fn fold_mutability(&mut self, i: Mutability) -> Mutability { fold_mutability(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400272
Nika Layzella6f46c42017-10-26 15:26:16 -0400273fn fold_nested_meta_item(&mut self, i: NestedMetaItem) -> NestedMetaItem { fold_nested_meta_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400274
Nika Layzella6f46c42017-10-26 15:26:16 -0400275fn fold_parenthesized_parameter_data(&mut self, i: ParenthesizedParameterData) -> ParenthesizedParameterData { fold_parenthesized_parameter_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400276# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400277fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400278# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400279fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400280# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400281fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400282# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400283fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400284# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400285fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400286# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400287fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400288# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400289fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400290# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400291fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400292# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400293fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400294# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400295fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400296# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400297fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400298# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400299fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400300
Nika Layzella6f46c42017-10-26 15:26:16 -0400301fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400303fn fold_path_glob(&mut self, i: PathGlob) -> PathGlob { fold_path_glob(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400304# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400305fn fold_path_list(&mut self, i: PathList) -> PathList { fold_path_list(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400307fn fold_path_list_item(&mut self, i: PathListItem) -> PathListItem { fold_path_list_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400308
Nika Layzella6f46c42017-10-26 15:26:16 -0400309fn fold_path_parameters(&mut self, i: PathParameters) -> PathParameters { fold_path_parameters(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400310
Nika Layzella6f46c42017-10-26 15:26:16 -0400311fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400312# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400313fn fold_path_simple(&mut self, i: PathSimple) -> PathSimple { fold_path_simple(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400314
Nika Layzella6f46c42017-10-26 15:26:16 -0400315fn fold_poly_trait_ref(&mut self, i: PolyTraitRef) -> PolyTraitRef { fold_poly_trait_ref(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400316
Nika Layzella6f46c42017-10-26 15:26:16 -0400317fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400318# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400319fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
David Tolnayf93b90d2017-11-11 19:21:26 -0800320
321fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400322# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400323fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400324
Nika Layzella6f46c42017-10-26 15:26:16 -0400325fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400326# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400327fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400328# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400329fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400330# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -0800331fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400332# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400333fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400334# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400335fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400336
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800337fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400338
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800339fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400340
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800341fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400342
Nika Layzella6f46c42017-10-26 15:26:16 -0400343fn fold_type_binding(&mut self, i: TypeBinding) -> TypeBinding { fold_type_binding(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400344
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800345fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
346
347fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
348
349fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
350
351fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
352
353fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
354
355fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
356
357fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
358
359fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
360
361fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
362
David Tolnay0a89b4d2017-11-13 00:55:45 -0800363fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800364
365fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
366
367fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
368
369fn fold_type_tup(&mut self, i: TypeTup) -> TypeTup { fold_type_tup(self, i) }
370
Nika Layzella6f46c42017-10-26 15:26:16 -0400371fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400372
Nika Layzella6f46c42017-10-26 15:26:16 -0400373fn fold_unsafety(&mut self, i: Unsafety) -> Unsafety { fold_unsafety(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400374
Nika Layzella6f46c42017-10-26 15:26:16 -0400375fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400376
Nika Layzella6f46c42017-10-26 15:26:16 -0400377fn fold_variant_data(&mut self, i: VariantData) -> VariantData { fold_variant_data(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400378# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400379fn fold_view_path(&mut self, i: ViewPath) -> ViewPath { fold_view_path(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400380
Nika Layzella6f46c42017-10-26 15:26:16 -0400381fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400382
Nika Layzella6f46c42017-10-26 15:26:16 -0400383fn fold_vis_inherited(&mut self, i: VisInherited) -> VisInherited { fold_vis_inherited(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400384
Nika Layzella6f46c42017-10-26 15:26:16 -0400385fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400386
Nika Layzella6f46c42017-10-26 15:26:16 -0400387fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400388
Nika Layzella6f46c42017-10-26 15:26:16 -0400389fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400390
Nika Layzella6f46c42017-10-26 15:26:16 -0400391fn fold_where_bound_predicate(&mut self, i: WhereBoundPredicate) -> WhereBoundPredicate { fold_where_bound_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400392
Nika Layzella6f46c42017-10-26 15:26:16 -0400393fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400394
Nika Layzella6f46c42017-10-26 15:26:16 -0400395fn fold_where_eq_predicate(&mut self, i: WhereEqPredicate) -> WhereEqPredicate { fold_where_eq_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400396
Nika Layzella6f46c42017-10-26 15:26:16 -0400397fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400398
Nika Layzella6f46c42017-10-26 15:26:16 -0400399fn fold_where_region_predicate(&mut self, i: WhereRegionPredicate) -> WhereRegionPredicate { fold_where_region_predicate(self, i) }
Nika Layzell27726662017-10-24 23:16:35 -0400400
401}
402
403
Nika Layzella6f46c42017-10-26 15:26:16 -0400404pub fn fold_abi<V: Folder + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
Nika Layzell27726662017-10-24 23:16:35 -0400405 Abi {
406 extern_token: _i . extern_token,
407 kind: _visitor.fold_abi_kind(_i . kind),
408 }
409}
410
Nika Layzella6f46c42017-10-26 15:26:16 -0400411pub fn fold_abi_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: AbiKind) -> AbiKind {
Nika Layzell27726662017-10-24 23:16:35 -0400412 use ::AbiKind::*;
413 match _i {
414 Named(_binding_0, ) => {
415 Named (
416 _binding_0,
417 )
418 }
419 Default => { Default }
420 }
421}
422
Nika Layzella6f46c42017-10-26 15:26:16 -0400423pub fn fold_angle_bracketed_parameter_data<V: Folder + ?Sized>(_visitor: &mut V, _i: AngleBracketedParameterData) -> AngleBracketedParameterData {
Nika Layzell27726662017-10-24 23:16:35 -0400424 AngleBracketedParameterData {
425 turbofish: _i . turbofish,
426 lt_token: _i . lt_token,
427 lifetimes: _i . lifetimes,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800428 types: FoldHelper::lift(_i . types, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400429 bindings: FoldHelper::lift(_i . bindings, |it| { _visitor.fold_type_binding(it) }),
430 gt_token: _i . gt_token,
431 }
432}
433# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400434pub fn fold_arg_captured<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
Nika Layzell27726662017-10-24 23:16:35 -0400435 ArgCaptured {
436 pat: _visitor.fold_pat(_i . pat),
437 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800438 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400439 }
440}
441# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400442pub fn fold_arg_self<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
Nika Layzell27726662017-10-24 23:16:35 -0400443 ArgSelf {
444 mutbl: _visitor.fold_mutability(_i . mutbl),
445 self_token: _i . self_token,
446 }
447}
448# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400449pub fn fold_arg_self_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
Nika Layzell27726662017-10-24 23:16:35 -0400450 ArgSelfRef {
451 and_token: _i . and_token,
452 self_token: _i . self_token,
453 lifetime: _i . lifetime,
454 mutbl: _visitor.fold_mutability(_i . mutbl),
455 }
456}
457# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400458pub fn fold_arm<V: Folder + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
Nika Layzell27726662017-10-24 23:16:35 -0400459 Arm {
460 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
461 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
462 if_token: _i . if_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400463 guard: (_i . guard).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400464 rocket_token: _i . rocket_token,
465 body: Box::new(_visitor.fold_expr(* _i . body)),
466 comma: _i . comma,
467 }
468}
469
Nika Layzella6f46c42017-10-26 15:26:16 -0400470pub fn fold_attr_style<V: Folder + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
Nika Layzell27726662017-10-24 23:16:35 -0400471 use ::AttrStyle::*;
472 match _i {
473 Outer => { Outer }
474 Inner(_binding_0, ) => {
475 Inner (
476 _binding_0,
477 )
478 }
479 }
480}
481
Nika Layzella6f46c42017-10-26 15:26:16 -0400482pub fn fold_attribute<V: Folder + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
Nika Layzell27726662017-10-24 23:16:35 -0400483 Attribute {
484 style: _visitor.fold_attr_style(_i . style),
485 pound_token: _i . pound_token,
486 bracket_token: _i . bracket_token,
487 path: _visitor.fold_path(_i . path),
488 tts: _i . tts,
489 is_sugared_doc: _i . is_sugared_doc,
490 }
491}
492
Nika Layzella6f46c42017-10-26 15:26:16 -0400493pub fn fold_bare_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
Nika Layzell27726662017-10-24 23:16:35 -0400494 BareFnArg {
495 name: _i . name,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800496 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -0400497 }
498}
499
Nika Layzella6f46c42017-10-26 15:26:16 -0400500pub fn fold_bare_fn_arg_name<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
Nika Layzell27726662017-10-24 23:16:35 -0400501 use ::BareFnArgName::*;
502 match _i {
503 Named(_binding_0, ) => {
504 Named (
505 _binding_0,
506 )
507 }
508 Wild(_binding_0, ) => {
509 Wild (
510 _binding_0,
511 )
512 }
513 }
514}
515
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800516pub fn fold_bare_fn_type<V: Folder + ?Sized>(_visitor: &mut V, _i: BareFnType) -> BareFnType {
517 BareFnType {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400518 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400519 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400520 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -0400521 fn_token: _i . fn_token,
522 paren_token: _i . paren_token,
523 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
524 variadic: _i . variadic,
David Tolnayf93b90d2017-11-11 19:21:26 -0800525 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -0400526 }
527}
528
Nika Layzella6f46c42017-10-26 15:26:16 -0400529pub fn fold_bin_op<V: Folder + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
Nika Layzell27726662017-10-24 23:16:35 -0400530 use ::BinOp::*;
531 match _i {
532 Add(_binding_0, ) => {
533 Add (
534 _binding_0,
535 )
536 }
537 Sub(_binding_0, ) => {
538 Sub (
539 _binding_0,
540 )
541 }
542 Mul(_binding_0, ) => {
543 Mul (
544 _binding_0,
545 )
546 }
547 Div(_binding_0, ) => {
548 Div (
549 _binding_0,
550 )
551 }
552 Rem(_binding_0, ) => {
553 Rem (
554 _binding_0,
555 )
556 }
557 And(_binding_0, ) => {
558 And (
559 _binding_0,
560 )
561 }
562 Or(_binding_0, ) => {
563 Or (
564 _binding_0,
565 )
566 }
567 BitXor(_binding_0, ) => {
568 BitXor (
569 _binding_0,
570 )
571 }
572 BitAnd(_binding_0, ) => {
573 BitAnd (
574 _binding_0,
575 )
576 }
577 BitOr(_binding_0, ) => {
578 BitOr (
579 _binding_0,
580 )
581 }
582 Shl(_binding_0, ) => {
583 Shl (
584 _binding_0,
585 )
586 }
587 Shr(_binding_0, ) => {
588 Shr (
589 _binding_0,
590 )
591 }
592 Eq(_binding_0, ) => {
593 Eq (
594 _binding_0,
595 )
596 }
597 Lt(_binding_0, ) => {
598 Lt (
599 _binding_0,
600 )
601 }
602 Le(_binding_0, ) => {
603 Le (
604 _binding_0,
605 )
606 }
607 Ne(_binding_0, ) => {
608 Ne (
609 _binding_0,
610 )
611 }
612 Ge(_binding_0, ) => {
613 Ge (
614 _binding_0,
615 )
616 }
617 Gt(_binding_0, ) => {
618 Gt (
619 _binding_0,
620 )
621 }
622 AddEq(_binding_0, ) => {
623 AddEq (
624 _binding_0,
625 )
626 }
627 SubEq(_binding_0, ) => {
628 SubEq (
629 _binding_0,
630 )
631 }
632 MulEq(_binding_0, ) => {
633 MulEq (
634 _binding_0,
635 )
636 }
637 DivEq(_binding_0, ) => {
638 DivEq (
639 _binding_0,
640 )
641 }
642 RemEq(_binding_0, ) => {
643 RemEq (
644 _binding_0,
645 )
646 }
647 BitXorEq(_binding_0, ) => {
648 BitXorEq (
649 _binding_0,
650 )
651 }
652 BitAndEq(_binding_0, ) => {
653 BitAndEq (
654 _binding_0,
655 )
656 }
657 BitOrEq(_binding_0, ) => {
658 BitOrEq (
659 _binding_0,
660 )
661 }
662 ShlEq(_binding_0, ) => {
663 ShlEq (
664 _binding_0,
665 )
666 }
667 ShrEq(_binding_0, ) => {
668 ShrEq (
669 _binding_0,
670 )
671 }
672 }
673}
674# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400675pub fn fold_binding_mode<V: Folder + ?Sized>(_visitor: &mut V, _i: BindingMode) -> BindingMode {
Nika Layzell27726662017-10-24 23:16:35 -0400676 use ::BindingMode::*;
677 match _i {
678 ByRef(_binding_0, _binding_1, ) => {
679 ByRef (
680 _binding_0,
681 _visitor.fold_mutability(_binding_1),
682 )
683 }
684 ByValue(_binding_0, ) => {
685 ByValue (
686 _visitor.fold_mutability(_binding_0),
687 )
688 }
689 }
690}
691# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400692pub fn fold_block<V: Folder + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
Nika Layzell27726662017-10-24 23:16:35 -0400693 Block {
694 brace_token: _i . brace_token,
695 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
696 }
697}
698
Nika Layzella6f46c42017-10-26 15:26:16 -0400699pub fn fold_body<V: Folder + ?Sized>(_visitor: &mut V, _i: Body) -> Body {
Nika Layzell27726662017-10-24 23:16:35 -0400700 use ::Body::*;
701 match _i {
702 Enum(_binding_0, ) => {
703 Enum (
704 _visitor.fold_body_enum(_binding_0),
705 )
706 }
707 Struct(_binding_0, ) => {
708 Struct (
709 _visitor.fold_body_struct(_binding_0),
710 )
711 }
712 }
713}
714
Nika Layzella6f46c42017-10-26 15:26:16 -0400715pub fn fold_body_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyEnum) -> BodyEnum {
Nika Layzell27726662017-10-24 23:16:35 -0400716 BodyEnum {
717 enum_token: _i . enum_token,
718 brace_token: _i . brace_token,
719 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
720 }
721}
722
Nika Layzella6f46c42017-10-26 15:26:16 -0400723pub fn fold_body_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: BodyStruct) -> BodyStruct {
Nika Layzell27726662017-10-24 23:16:35 -0400724 BodyStruct {
725 data: _visitor.fold_variant_data(_i . data),
726 struct_token: _i . struct_token,
727 semi_token: _i . semi_token,
728 }
729}
730
Nika Layzella6f46c42017-10-26 15:26:16 -0400731pub fn fold_bound_lifetimes<V: Folder + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
Nika Layzell27726662017-10-24 23:16:35 -0400732 BoundLifetimes {
733 for_token: _i . for_token,
734 lt_token: _i . lt_token,
735 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
736 gt_token: _i . gt_token,
737 }
738}
739# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400740pub fn fold_capture_by<V: Folder + ?Sized>(_visitor: &mut V, _i: CaptureBy) -> CaptureBy {
Nika Layzell27726662017-10-24 23:16:35 -0400741 use ::CaptureBy::*;
742 match _i {
743 Value(_binding_0, ) => {
744 Value (
745 _binding_0,
746 )
747 }
748 Ref => { Ref }
749 }
750}
751# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400752pub fn fold_constness<V: Folder + ?Sized>(_visitor: &mut V, _i: Constness) -> Constness {
Nika Layzell27726662017-10-24 23:16:35 -0400753 use ::Constness::*;
754 match _i {
755 Const(_binding_0, ) => {
756 Const (
757 _binding_0,
758 )
759 }
760 NotConst => { NotConst }
761 }
762}
763# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400764pub fn fold_defaultness<V: Folder + ?Sized>(_visitor: &mut V, _i: Defaultness) -> Defaultness {
Nika Layzell27726662017-10-24 23:16:35 -0400765 use ::Defaultness::*;
766 match _i {
767 Default(_binding_0, ) => {
768 Default (
769 _binding_0,
770 )
771 }
772 Final => { Final }
773 }
774}
775
Nika Layzella6f46c42017-10-26 15:26:16 -0400776pub fn fold_derive_input<V: Folder + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
Nika Layzell27726662017-10-24 23:16:35 -0400777 DeriveInput {
778 ident: _i . ident,
779 vis: _visitor.fold_visibility(_i . vis),
780 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
781 generics: _visitor.fold_generics(_i . generics),
782 body: _visitor.fold_body(_i . body),
783 }
784}
785
Nika Layzella6f46c42017-10-26 15:26:16 -0400786pub fn fold_expr<V: Folder + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
Nika Layzell27726662017-10-24 23:16:35 -0400787 Expr {
788 node: _visitor.fold_expr_kind(_i . node),
789 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
790 }
791}
792# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400793pub fn fold_expr_addr_of<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
Nika Layzell27726662017-10-24 23:16:35 -0400794 ExprAddrOf {
795 and_token: _i . and_token,
796 mutbl: _visitor.fold_mutability(_i . mutbl),
797 expr: Box::new(_visitor.fold_expr(* _i . expr)),
798 }
799}
800# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400801pub fn fold_expr_array<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
Nika Layzell27726662017-10-24 23:16:35 -0400802 ExprArray {
803 exprs: FoldHelper::lift(_i . exprs, |it| { _visitor.fold_expr(it) }),
804 bracket_token: _i . bracket_token,
805 }
806}
807# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400808pub fn fold_expr_assign<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
Nika Layzell27726662017-10-24 23:16:35 -0400809 ExprAssign {
810 left: Box::new(_visitor.fold_expr(* _i . left)),
811 right: Box::new(_visitor.fold_expr(* _i . right)),
812 eq_token: _i . eq_token,
813 }
814}
815# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400816pub fn fold_expr_assign_op<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
Nika Layzell27726662017-10-24 23:16:35 -0400817 ExprAssignOp {
818 op: _visitor.fold_bin_op(_i . op),
819 left: Box::new(_visitor.fold_expr(* _i . left)),
820 right: Box::new(_visitor.fold_expr(* _i . right)),
821 }
822}
823
Nika Layzella6f46c42017-10-26 15:26:16 -0400824pub fn fold_expr_binary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
Nika Layzell27726662017-10-24 23:16:35 -0400825 ExprBinary {
826 op: _visitor.fold_bin_op(_i . op),
827 left: Box::new(_visitor.fold_expr(* _i . left)),
828 right: Box::new(_visitor.fold_expr(* _i . right)),
829 }
830}
831# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400832pub fn fold_expr_block<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
Nika Layzell27726662017-10-24 23:16:35 -0400833 ExprBlock {
834 unsafety: _visitor.fold_unsafety(_i . unsafety),
835 block: _visitor.fold_block(_i . block),
836 }
837}
838# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400839pub fn fold_expr_box<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
Nika Layzell27726662017-10-24 23:16:35 -0400840 ExprBox {
841 expr: Box::new(_visitor.fold_expr(* _i . expr)),
842 box_token: _i . box_token,
843 }
844}
845# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400846pub fn fold_expr_break<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
Nika Layzell27726662017-10-24 23:16:35 -0400847 ExprBreak {
848 label: _i . label,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400849 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400850 break_token: _i . break_token,
851 }
852}
853
Nika Layzella6f46c42017-10-26 15:26:16 -0400854pub fn fold_expr_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
Nika Layzell27726662017-10-24 23:16:35 -0400855 ExprCall {
856 func: Box::new(_visitor.fold_expr(* _i . func)),
857 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
858 paren_token: _i . paren_token,
859 }
860}
861
Nika Layzella6f46c42017-10-26 15:26:16 -0400862pub fn fold_expr_cast<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
Nika Layzell27726662017-10-24 23:16:35 -0400863 ExprCast {
864 expr: Box::new(_visitor.fold_expr(* _i . expr)),
865 as_token: _i . as_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -0800866 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -0400867 }
868}
869# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400870pub fn fold_expr_catch<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
Nika Layzell27726662017-10-24 23:16:35 -0400871 ExprCatch {
872 do_token: _i . do_token,
873 catch_token: _i . catch_token,
874 block: _visitor.fold_block(_i . block),
875 }
876}
877# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400878pub fn fold_expr_closure<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
Nika Layzell27726662017-10-24 23:16:35 -0400879 ExprClosure {
880 capture: _visitor.fold_capture_by(_i . capture),
881 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
882 body: Box::new(_visitor.fold_expr(* _i . body)),
883 or1_token: _i . or1_token,
884 or2_token: _i . or2_token,
885 }
886}
887# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400888pub fn fold_expr_continue<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
Nika Layzell27726662017-10-24 23:16:35 -0400889 ExprContinue {
890 label: _i . label,
891 continue_token: _i . continue_token,
892 }
893}
894# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400895pub fn fold_expr_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
Nika Layzell27726662017-10-24 23:16:35 -0400896 ExprField {
897 expr: Box::new(_visitor.fold_expr(* _i . expr)),
898 field: _i . field,
899 dot_token: _i . dot_token,
900 }
901}
902# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400903pub fn fold_expr_for_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
Nika Layzell27726662017-10-24 23:16:35 -0400904 ExprForLoop {
905 pat: Box::new(_visitor.fold_pat(* _i . pat)),
906 expr: Box::new(_visitor.fold_expr(* _i . expr)),
907 body: _visitor.fold_block(_i . body),
908 label: _i . label,
909 for_token: _i . for_token,
910 colon_token: _i . colon_token,
911 in_token: _i . in_token,
912 }
913}
914
Nika Layzella6f46c42017-10-26 15:26:16 -0400915pub fn fold_expr_group<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
Nika Layzell27726662017-10-24 23:16:35 -0400916 ExprGroup {
917 expr: Box::new(_visitor.fold_expr(* _i . expr)),
918 group_token: _i . group_token,
919 }
920}
921# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400922pub fn fold_expr_if<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
Nika Layzell27726662017-10-24 23:16:35 -0400923 ExprIf {
924 cond: Box::new(_visitor.fold_expr(* _i . cond)),
925 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400926 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400927 if_token: _i . if_token,
928 else_token: _i . else_token,
929 }
930}
931# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400932pub fn fold_expr_if_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
Nika Layzell27726662017-10-24 23:16:35 -0400933 ExprIfLet {
934 pat: Box::new(_visitor.fold_pat(* _i . pat)),
935 expr: Box::new(_visitor.fold_expr(* _i . expr)),
936 if_true: _visitor.fold_block(_i . if_true),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400937 if_false: (_i . if_false).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -0400938 if_token: _i . if_token,
939 let_token: _i . let_token,
940 eq_token: _i . eq_token,
941 else_token: _i . else_token,
942 }
943}
944# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -0400945pub fn fold_expr_in_place<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
Nika Layzell27726662017-10-24 23:16:35 -0400946 ExprInPlace {
947 place: Box::new(_visitor.fold_expr(* _i . place)),
948 kind: _visitor.fold_in_place_kind(_i . kind),
949 value: Box::new(_visitor.fold_expr(* _i . value)),
950 }
951}
952
Nika Layzella6f46c42017-10-26 15:26:16 -0400953pub fn fold_expr_index<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
Nika Layzell27726662017-10-24 23:16:35 -0400954 ExprIndex {
955 expr: Box::new(_visitor.fold_expr(* _i . expr)),
956 index: Box::new(_visitor.fold_expr(* _i . index)),
957 bracket_token: _i . bracket_token,
958 }
959}
960
Nika Layzella6f46c42017-10-26 15:26:16 -0400961pub fn fold_expr_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprKind) -> ExprKind {
Nika Layzell27726662017-10-24 23:16:35 -0400962 use ::ExprKind::*;
963 match _i {
964 Box(_binding_0, ) => {
965 Box (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400966 full!(_visitor.fold_expr_box(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400967 )
968 }
969 InPlace(_binding_0, ) => {
970 InPlace (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400971 full!(_visitor.fold_expr_in_place(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400972 )
973 }
974 Array(_binding_0, ) => {
975 Array (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400976 full!(_visitor.fold_expr_array(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400977 )
978 }
979 Call(_binding_0, ) => {
980 Call (
981 _visitor.fold_expr_call(_binding_0),
982 )
983 }
984 MethodCall(_binding_0, ) => {
985 MethodCall (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400986 full!(_visitor.fold_expr_method_call(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400987 )
988 }
989 Tup(_binding_0, ) => {
990 Tup (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -0400991 full!(_visitor.fold_expr_tup(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -0400992 )
993 }
994 Binary(_binding_0, ) => {
995 Binary (
996 _visitor.fold_expr_binary(_binding_0),
997 )
998 }
999 Unary(_binding_0, ) => {
1000 Unary (
1001 _visitor.fold_expr_unary(_binding_0),
1002 )
1003 }
1004 Lit(_binding_0, ) => {
1005 Lit (
1006 _binding_0,
1007 )
1008 }
1009 Cast(_binding_0, ) => {
1010 Cast (
1011 _visitor.fold_expr_cast(_binding_0),
1012 )
1013 }
1014 Type(_binding_0, ) => {
1015 Type (
1016 _visitor.fold_expr_type(_binding_0),
1017 )
1018 }
1019 If(_binding_0, ) => {
1020 If (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001021 full!(_visitor.fold_expr_if(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001022 )
1023 }
1024 IfLet(_binding_0, ) => {
1025 IfLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001026 full!(_visitor.fold_expr_if_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001027 )
1028 }
1029 While(_binding_0, ) => {
1030 While (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001031 full!(_visitor.fold_expr_while(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001032 )
1033 }
1034 WhileLet(_binding_0, ) => {
1035 WhileLet (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001036 full!(_visitor.fold_expr_while_let(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001037 )
1038 }
1039 ForLoop(_binding_0, ) => {
1040 ForLoop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001041 full!(_visitor.fold_expr_for_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001042 )
1043 }
1044 Loop(_binding_0, ) => {
1045 Loop (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001046 full!(_visitor.fold_expr_loop(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001047 )
1048 }
1049 Match(_binding_0, ) => {
1050 Match (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001051 full!(_visitor.fold_expr_match(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001052 )
1053 }
1054 Closure(_binding_0, ) => {
1055 Closure (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001056 full!(_visitor.fold_expr_closure(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001057 )
1058 }
1059 Block(_binding_0, ) => {
1060 Block (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001061 full!(_visitor.fold_expr_block(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001062 )
1063 }
1064 Assign(_binding_0, ) => {
1065 Assign (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001066 full!(_visitor.fold_expr_assign(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001067 )
1068 }
1069 AssignOp(_binding_0, ) => {
1070 AssignOp (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001071 full!(_visitor.fold_expr_assign_op(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001072 )
1073 }
1074 Field(_binding_0, ) => {
1075 Field (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001076 full!(_visitor.fold_expr_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001077 )
1078 }
1079 TupField(_binding_0, ) => {
1080 TupField (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001081 full!(_visitor.fold_expr_tup_field(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001082 )
1083 }
1084 Index(_binding_0, ) => {
1085 Index (
1086 _visitor.fold_expr_index(_binding_0),
1087 )
1088 }
1089 Range(_binding_0, ) => {
1090 Range (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001091 full!(_visitor.fold_expr_range(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001092 )
1093 }
1094 Path(_binding_0, ) => {
1095 Path (
1096 _visitor.fold_expr_path(_binding_0),
1097 )
1098 }
1099 AddrOf(_binding_0, ) => {
1100 AddrOf (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001101 full!(_visitor.fold_expr_addr_of(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001102 )
1103 }
1104 Break(_binding_0, ) => {
1105 Break (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001106 full!(_visitor.fold_expr_break(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001107 )
1108 }
1109 Continue(_binding_0, ) => {
1110 Continue (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001111 full!(_visitor.fold_expr_continue(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001112 )
1113 }
1114 Ret(_binding_0, ) => {
1115 Ret (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001116 full!(_visitor.fold_expr_ret(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001117 )
1118 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001119 Macro(_binding_0, ) => {
1120 Macro (
1121 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001122 )
1123 }
1124 Struct(_binding_0, ) => {
1125 Struct (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001126 full!(_visitor.fold_expr_struct(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001127 )
1128 }
1129 Repeat(_binding_0, ) => {
1130 Repeat (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001131 full!(_visitor.fold_expr_repeat(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001132 )
1133 }
1134 Paren(_binding_0, ) => {
1135 Paren (
1136 _visitor.fold_expr_paren(_binding_0),
1137 )
1138 }
1139 Group(_binding_0, ) => {
1140 Group (
1141 _visitor.fold_expr_group(_binding_0),
1142 )
1143 }
1144 Try(_binding_0, ) => {
1145 Try (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001146 full!(_visitor.fold_expr_try(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001147 )
1148 }
1149 Catch(_binding_0, ) => {
1150 Catch (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001151 full!(_visitor.fold_expr_catch(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001152 )
1153 }
1154 Yield(_binding_0, ) => {
1155 Yield (
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001156 full!(_visitor.fold_expr_yield(_binding_0)),
Nika Layzell27726662017-10-24 23:16:35 -04001157 )
1158 }
1159 }
1160}
1161# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001162pub fn fold_expr_loop<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
Nika Layzell27726662017-10-24 23:16:35 -04001163 ExprLoop {
1164 body: _visitor.fold_block(_i . body),
1165 label: _i . label,
1166 loop_token: _i . loop_token,
1167 colon_token: _i . colon_token,
1168 }
1169}
1170# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001171pub fn fold_expr_match<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
Nika Layzell27726662017-10-24 23:16:35 -04001172 ExprMatch {
1173 match_token: _i . match_token,
1174 brace_token: _i . brace_token,
1175 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1176 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1177 }
1178}
1179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001180pub fn fold_expr_method_call<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
Nika Layzell27726662017-10-24 23:16:35 -04001181 ExprMethodCall {
1182 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1183 method: _i . method,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001184 typarams: FoldHelper::lift(_i . typarams, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001185 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1186 paren_token: _i . paren_token,
1187 dot_token: _i . dot_token,
1188 lt_token: _i . lt_token,
1189 colon2_token: _i . colon2_token,
1190 gt_token: _i . gt_token,
1191 }
1192}
1193
Nika Layzella6f46c42017-10-26 15:26:16 -04001194pub fn fold_expr_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
Nika Layzell27726662017-10-24 23:16:35 -04001195 ExprParen {
1196 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1197 paren_token: _i . paren_token,
1198 }
1199}
1200
Nika Layzella6f46c42017-10-26 15:26:16 -04001201pub fn fold_expr_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
Nika Layzell27726662017-10-24 23:16:35 -04001202 ExprPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001203 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001204 path: _visitor.fold_path(_i . path),
1205 }
1206}
1207# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001208pub fn fold_expr_range<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
Nika Layzell27726662017-10-24 23:16:35 -04001209 ExprRange {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001210 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1211 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001212 limits: _visitor.fold_range_limits(_i . limits),
1213 }
1214}
1215# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001216pub fn fold_expr_repeat<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
Nika Layzell27726662017-10-24 23:16:35 -04001217 ExprRepeat {
1218 bracket_token: _i . bracket_token,
1219 semi_token: _i . semi_token,
1220 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1221 amt: Box::new(_visitor.fold_expr(* _i . amt)),
1222 }
1223}
1224# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001225pub fn fold_expr_ret<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprRet) -> ExprRet {
Nika Layzell27726662017-10-24 23:16:35 -04001226 ExprRet {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001227 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001228 return_token: _i . return_token,
1229 }
1230}
1231# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001232pub fn fold_expr_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001233 ExprStruct {
1234 path: _visitor.fold_path(_i . path),
1235 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001236 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001237 dot2_token: _i . dot2_token,
1238 brace_token: _i . brace_token,
1239 }
1240}
1241# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001242pub fn fold_expr_try<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
Nika Layzell27726662017-10-24 23:16:35 -04001243 ExprTry {
1244 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1245 question_token: _i . question_token,
1246 }
1247}
1248# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001249pub fn fold_expr_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTup) -> ExprTup {
Nika Layzell27726662017-10-24 23:16:35 -04001250 ExprTup {
1251 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1252 paren_token: _i . paren_token,
1253 lone_comma: _i . lone_comma,
1254 }
1255}
1256# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001257pub fn fold_expr_tup_field<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprTupField) -> ExprTupField {
Nika Layzell27726662017-10-24 23:16:35 -04001258 ExprTupField {
1259 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1260 field: _i . field,
1261 dot_token: _i . dot_token,
1262 }
1263}
1264
Nika Layzella6f46c42017-10-26 15:26:16 -04001265pub fn fold_expr_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
Nika Layzell27726662017-10-24 23:16:35 -04001266 ExprType {
1267 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1268 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001269 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001270 }
1271}
1272
Nika Layzella6f46c42017-10-26 15:26:16 -04001273pub fn fold_expr_unary<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
Nika Layzell27726662017-10-24 23:16:35 -04001274 ExprUnary {
1275 op: _visitor.fold_un_op(_i . op),
1276 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1277 }
1278}
1279# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001280pub fn fold_expr_while<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
Nika Layzell27726662017-10-24 23:16:35 -04001281 ExprWhile {
1282 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1283 body: _visitor.fold_block(_i . body),
1284 label: _i . label,
1285 colon_token: _i . colon_token,
1286 while_token: _i . while_token,
1287 }
1288}
1289# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001290pub fn fold_expr_while_let<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
Nika Layzell27726662017-10-24 23:16:35 -04001291 ExprWhileLet {
1292 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1293 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1294 body: _visitor.fold_block(_i . body),
1295 label: _i . label,
1296 colon_token: _i . colon_token,
1297 while_token: _i . while_token,
1298 let_token: _i . let_token,
1299 eq_token: _i . eq_token,
1300 }
1301}
1302# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001303pub fn fold_expr_yield<V: Folder + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
Nika Layzell27726662017-10-24 23:16:35 -04001304 ExprYield {
1305 yield_token: _i . yield_token,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001306 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001307 }
1308}
1309
Nika Layzella6f46c42017-10-26 15:26:16 -04001310pub fn fold_field<V: Folder + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
Nika Layzell27726662017-10-24 23:16:35 -04001311 Field {
1312 ident: _i . ident,
1313 vis: _visitor.fold_visibility(_i . vis),
1314 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001315 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001316 colon_token: _i . colon_token,
1317 }
1318}
1319# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001320pub fn fold_field_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
Nika Layzell27726662017-10-24 23:16:35 -04001321 FieldPat {
1322 ident: _i . ident,
1323 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1324 is_shorthand: _i . is_shorthand,
1325 colon_token: _i . colon_token,
1326 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1327 }
1328}
1329# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001330pub fn fold_field_value<V: Folder + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
Nika Layzell27726662017-10-24 23:16:35 -04001331 FieldValue {
1332 ident: _i . ident,
1333 expr: _visitor.fold_expr(_i . expr),
1334 is_shorthand: _i . is_shorthand,
1335 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1336 colon_token: _i . colon_token,
1337 }
1338}
1339# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001340pub fn fold_file<V: Folder + ?Sized>(_visitor: &mut V, _i: File) -> File {
Nika Layzell27726662017-10-24 23:16:35 -04001341 File {
1342 shebang: _i . shebang,
1343 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1344 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1345 }
1346}
1347# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001348pub fn fold_fn_arg<V: Folder + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
Nika Layzell27726662017-10-24 23:16:35 -04001349 use ::FnArg::*;
1350 match _i {
1351 SelfRef(_binding_0, ) => {
1352 SelfRef (
1353 _visitor.fold_arg_self_ref(_binding_0),
1354 )
1355 }
1356 SelfValue(_binding_0, ) => {
1357 SelfValue (
1358 _visitor.fold_arg_self(_binding_0),
1359 )
1360 }
1361 Captured(_binding_0, ) => {
1362 Captured (
1363 _visitor.fold_arg_captured(_binding_0),
1364 )
1365 }
1366 Ignored(_binding_0, ) => {
1367 Ignored (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001368 _visitor.fold_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001369 )
1370 }
1371 }
1372}
1373# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001374pub fn fold_fn_decl<V: Folder + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
Nika Layzell27726662017-10-24 23:16:35 -04001375 FnDecl {
1376 fn_token: _i . fn_token,
1377 paren_token: _i . paren_token,
1378 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001379 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001380 generics: _visitor.fold_generics(_i . generics),
1381 variadic: _i . variadic,
1382 dot_tokens: _i . dot_tokens,
1383 }
1384}
1385# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001386pub fn fold_foreign_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
David Tolnay8894f602017-11-11 12:11:04 -08001387 use ::ForeignItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001388 match _i {
1389 Fn(_binding_0, ) => {
1390 Fn (
1391 _visitor.fold_foreign_item_fn(_binding_0),
1392 )
1393 }
1394 Static(_binding_0, ) => {
1395 Static (
1396 _visitor.fold_foreign_item_static(_binding_0),
1397 )
1398 }
David Tolnay199bcbb2017-11-12 10:33:52 -08001399 Type(_binding_0, ) => {
1400 Type (
1401 _visitor.fold_foreign_item_type(_binding_0),
1402 )
1403 }
Nika Layzell27726662017-10-24 23:16:35 -04001404 }
1405}
1406# [ cfg ( feature = "full" ) ]
David Tolnay8894f602017-11-11 12:11:04 -08001407pub fn fold_foreign_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1408 ForeignItemFn {
1409 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1410 vis: _visitor.fold_visibility(_i . vis),
1411 ident: _i . ident,
1412 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1413 semi_token: _i . semi_token,
1414 }
1415}
1416# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001417pub fn fold_foreign_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001418 ForeignItemStatic {
David Tolnay8894f602017-11-11 12:11:04 -08001419 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1420 vis: _visitor.fold_visibility(_i . vis),
Nika Layzell27726662017-10-24 23:16:35 -04001421 static_token: _i . static_token,
Nika Layzell27726662017-10-24 23:16:35 -04001422 mutbl: _visitor.fold_mutability(_i . mutbl),
David Tolnay8894f602017-11-11 12:11:04 -08001423 ident: _i . ident,
1424 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001425 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnay8894f602017-11-11 12:11:04 -08001426 semi_token: _i . semi_token,
Nika Layzell27726662017-10-24 23:16:35 -04001427 }
1428}
David Tolnay199bcbb2017-11-12 10:33:52 -08001429# [ cfg ( feature = "full" ) ]
1430pub fn fold_foreign_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1431 ForeignItemType {
1432 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1433 vis: _visitor.fold_visibility(_i . vis),
1434 type_token: _i . type_token,
1435 ident: _i . ident,
1436 semi_token: _i . semi_token,
1437 }
1438}
Nika Layzell27726662017-10-24 23:16:35 -04001439
Nika Layzella6f46c42017-10-26 15:26:16 -04001440pub fn fold_generics<V: Folder + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
Nika Layzell27726662017-10-24 23:16:35 -04001441 Generics {
1442 lt_token: _i . lt_token,
1443 gt_token: _i . gt_token,
1444 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001445 ty_params: FoldHelper::lift(_i . ty_params, |it| { _visitor.fold_type_param(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001446 where_clause: _visitor.fold_where_clause(_i . where_clause),
1447 }
1448}
1449# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001450pub fn fold_impl_item<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
David Tolnay857628c2017-11-11 12:25:31 -08001451 use ::ImplItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04001452 match _i {
1453 Const(_binding_0, ) => {
1454 Const (
1455 _visitor.fold_impl_item_const(_binding_0),
1456 )
1457 }
1458 Method(_binding_0, ) => {
1459 Method (
1460 _visitor.fold_impl_item_method(_binding_0),
1461 )
1462 }
1463 Type(_binding_0, ) => {
1464 Type (
1465 _visitor.fold_impl_item_type(_binding_0),
1466 )
1467 }
1468 Macro(_binding_0, ) => {
1469 Macro (
David Tolnay857628c2017-11-11 12:25:31 -08001470 _visitor.fold_impl_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001471 )
1472 }
1473 }
1474}
1475# [ cfg ( feature = "full" ) ]
David Tolnay857628c2017-11-11 12:25:31 -08001476pub fn fold_impl_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1477 ImplItemConst {
1478 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1479 vis: _visitor.fold_visibility(_i . vis),
1480 defaultness: _visitor.fold_defaultness(_i . defaultness),
1481 const_token: _i . const_token,
1482 ident: _i . ident,
1483 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001484 ty: _visitor.fold_type(_i . ty),
David Tolnay857628c2017-11-11 12:25:31 -08001485 eq_token: _i . eq_token,
1486 expr: _visitor.fold_expr(_i . expr),
1487 semi_token: _i . semi_token,
1488 }
1489}
1490# [ cfg ( feature = "full" ) ]
1491pub fn fold_impl_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1492 ImplItemMacro {
1493 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1494 mac: _visitor.fold_macro(_i . mac),
1495 }
1496}
1497# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001498pub fn fold_impl_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04001499 ImplItemMethod {
David Tolnay857628c2017-11-11 12:25:31 -08001500 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001501 vis: _visitor.fold_visibility(_i . vis),
1502 defaultness: _visitor.fold_defaultness(_i . defaultness),
1503 sig: _visitor.fold_method_sig(_i . sig),
1504 block: _visitor.fold_block(_i . block),
1505 }
1506}
1507# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001508pub fn fold_impl_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
Nika Layzell27726662017-10-24 23:16:35 -04001509 ImplItemType {
David Tolnay857628c2017-11-11 12:25:31 -08001510 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001511 vis: _visitor.fold_visibility(_i . vis),
1512 defaultness: _visitor.fold_defaultness(_i . defaultness),
1513 type_token: _i . type_token,
1514 ident: _i . ident,
1515 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001516 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001517 semi_token: _i . semi_token,
1518 }
1519}
1520# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001521pub fn fold_impl_polarity<V: Folder + ?Sized>(_visitor: &mut V, _i: ImplPolarity) -> ImplPolarity {
Nika Layzell27726662017-10-24 23:16:35 -04001522 use ::ImplPolarity::*;
1523 match _i {
1524 Positive => { Positive }
1525 Negative(_binding_0, ) => {
1526 Negative (
1527 _binding_0,
1528 )
1529 }
1530 }
1531}
1532# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001533pub fn fold_in_place_kind<V: Folder + ?Sized>(_visitor: &mut V, _i: InPlaceKind) -> InPlaceKind {
Nika Layzell27726662017-10-24 23:16:35 -04001534 use ::InPlaceKind::*;
1535 match _i {
1536 Arrow(_binding_0, ) => {
1537 Arrow (
1538 _binding_0,
1539 )
1540 }
1541 In(_binding_0, ) => {
1542 In (
1543 _binding_0,
1544 )
1545 }
1546 }
1547}
1548# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001549pub fn fold_item<V: Folder + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001550 use ::Item::*;
Nika Layzell27726662017-10-24 23:16:35 -04001551 match _i {
1552 ExternCrate(_binding_0, ) => {
1553 ExternCrate (
1554 _visitor.fold_item_extern_crate(_binding_0),
1555 )
1556 }
1557 Use(_binding_0, ) => {
1558 Use (
1559 _visitor.fold_item_use(_binding_0),
1560 )
1561 }
1562 Static(_binding_0, ) => {
1563 Static (
1564 _visitor.fold_item_static(_binding_0),
1565 )
1566 }
1567 Const(_binding_0, ) => {
1568 Const (
1569 _visitor.fold_item_const(_binding_0),
1570 )
1571 }
1572 Fn(_binding_0, ) => {
1573 Fn (
1574 _visitor.fold_item_fn(_binding_0),
1575 )
1576 }
1577 Mod(_binding_0, ) => {
1578 Mod (
1579 _visitor.fold_item_mod(_binding_0),
1580 )
1581 }
1582 ForeignMod(_binding_0, ) => {
1583 ForeignMod (
1584 _visitor.fold_item_foreign_mod(_binding_0),
1585 )
1586 }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001587 Type(_binding_0, ) => {
1588 Type (
1589 _visitor.fold_item_type(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001590 )
1591 }
1592 Enum(_binding_0, ) => {
1593 Enum (
1594 _visitor.fold_item_enum(_binding_0),
1595 )
1596 }
1597 Struct(_binding_0, ) => {
1598 Struct (
1599 _visitor.fold_item_struct(_binding_0),
1600 )
1601 }
1602 Union(_binding_0, ) => {
1603 Union (
1604 _visitor.fold_item_union(_binding_0),
1605 )
1606 }
1607 Trait(_binding_0, ) => {
1608 Trait (
1609 _visitor.fold_item_trait(_binding_0),
1610 )
1611 }
1612 DefaultImpl(_binding_0, ) => {
1613 DefaultImpl (
1614 _visitor.fold_item_default_impl(_binding_0),
1615 )
1616 }
1617 Impl(_binding_0, ) => {
1618 Impl (
1619 _visitor.fold_item_impl(_binding_0),
1620 )
1621 }
David Tolnaydecf28d2017-11-11 11:56:45 -08001622 Macro(_binding_0, ) => {
1623 Macro (
1624 _visitor.fold_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04001625 )
1626 }
1627 }
1628}
1629# [ cfg ( feature = "full" ) ]
David Tolnayc6b55bc2017-11-09 22:48:38 -08001630pub fn fold_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1631 ItemConst {
1632 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1633 vis: _visitor.fold_visibility(_i . vis),
1634 const_token: _i . const_token,
1635 ident: _i . ident,
1636 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001637 ty: Box::new(_visitor.fold_type(* _i . ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001638 eq_token: _i . eq_token,
1639 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1640 semi_token: _i . semi_token,
1641 }
1642}
1643# [ cfg ( feature = "full" ) ]
1644pub fn fold_item_default_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemDefaultImpl) -> ItemDefaultImpl {
1645 ItemDefaultImpl {
1646 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1647 unsafety: _visitor.fold_unsafety(_i . unsafety),
1648 impl_token: _i . impl_token,
1649 path: _visitor.fold_path(_i . path),
1650 for_token: _i . for_token,
1651 dot2_token: _i . dot2_token,
1652 brace_token: _i . brace_token,
1653 }
1654}
1655# [ cfg ( feature = "full" ) ]
1656pub fn fold_item_enum<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1657 ItemEnum {
1658 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1659 vis: _visitor.fold_visibility(_i . vis),
1660 enum_token: _i . enum_token,
1661 ident: _i . ident,
1662 generics: _visitor.fold_generics(_i . generics),
1663 brace_token: _i . brace_token,
1664 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1665 }
1666}
1667# [ cfg ( feature = "full" ) ]
1668pub fn fold_item_extern_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1669 ItemExternCrate {
1670 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1671 vis: _visitor.fold_visibility(_i . vis),
1672 extern_token: _i . extern_token,
1673 crate_token: _i . crate_token,
1674 ident: _i . ident,
1675 rename: _i . rename,
1676 semi_token: _i . semi_token,
1677 }
1678}
1679# [ cfg ( feature = "full" ) ]
1680pub fn fold_item_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1681 ItemFn {
1682 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1683 vis: _visitor.fold_visibility(_i . vis),
1684 constness: _visitor.fold_constness(_i . constness),
1685 unsafety: _visitor.fold_unsafety(_i . unsafety),
1686 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1687 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1688 ident: _i . ident,
1689 block: Box::new(_visitor.fold_block(* _i . block)),
1690 }
1691}
1692# [ cfg ( feature = "full" ) ]
1693pub fn fold_item_foreign_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1694 ItemForeignMod {
1695 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1696 abi: _visitor.fold_abi(_i . abi),
1697 brace_token: _i . brace_token,
1698 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1699 }
1700}
1701# [ cfg ( feature = "full" ) ]
1702pub fn fold_item_impl<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1703 ItemImpl {
1704 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1705 defaultness: _visitor.fold_defaultness(_i . defaultness),
1706 unsafety: _visitor.fold_unsafety(_i . unsafety),
1707 impl_token: _i . impl_token,
1708 generics: _visitor.fold_generics(_i . generics),
1709 trait_: _i . trait_,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001710 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001711 brace_token: _i . brace_token,
1712 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1713 }
1714}
1715# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08001716pub fn fold_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1717 ItemMacro {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001718 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnay99a953d2017-11-11 12:51:43 -08001719 ident: _i . ident,
David Tolnaydecf28d2017-11-11 11:56:45 -08001720 mac: _visitor.fold_macro(_i . mac),
David Tolnayc6b55bc2017-11-09 22:48:38 -08001721 }
1722}
1723# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001724pub fn fold_item_mod<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
Nika Layzell27726662017-10-24 23:16:35 -04001725 ItemMod {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001726 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001727 vis: _visitor.fold_visibility(_i . vis),
1728 mod_token: _i . mod_token,
1729 ident: _i . ident,
1730 content: _i . content,
1731 semi: _i . semi,
1732 }
1733}
1734# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001735pub fn fold_item_static<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
Nika Layzell27726662017-10-24 23:16:35 -04001736 ItemStatic {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001737 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001738 vis: _visitor.fold_visibility(_i . vis),
1739 static_token: _i . static_token,
1740 mutbl: _visitor.fold_mutability(_i . mutbl),
1741 ident: _i . ident,
1742 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001743 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001744 eq_token: _i . eq_token,
1745 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1746 semi_token: _i . semi_token,
1747 }
1748}
1749# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001750pub fn fold_item_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
Nika Layzell27726662017-10-24 23:16:35 -04001751 ItemStruct {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001752 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001753 vis: _visitor.fold_visibility(_i . vis),
1754 struct_token: _i . struct_token,
1755 ident: _i . ident,
1756 generics: _visitor.fold_generics(_i . generics),
1757 data: _visitor.fold_variant_data(_i . data),
1758 semi_token: _i . semi_token,
1759 }
1760}
1761# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001762pub fn fold_item_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
Nika Layzell27726662017-10-24 23:16:35 -04001763 ItemTrait {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001764 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001765 vis: _visitor.fold_visibility(_i . vis),
1766 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell0dc6e632017-11-18 12:55:25 -05001767 auto_token: _i . auto_token,
Nika Layzell27726662017-10-24 23:16:35 -04001768 trait_token: _i . trait_token,
1769 ident: _i . ident,
1770 generics: _visitor.fold_generics(_i . generics),
1771 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001772 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001773 brace_token: _i . brace_token,
1774 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1775 }
1776}
1777# [ cfg ( feature = "full" ) ]
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001778pub fn fold_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1779 ItemType {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001780 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001781 vis: _visitor.fold_visibility(_i . vis),
1782 type_token: _i . type_token,
1783 ident: _i . ident,
1784 generics: _visitor.fold_generics(_i . generics),
1785 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001786 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04001787 semi_token: _i . semi_token,
1788 }
1789}
1790# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001791pub fn fold_item_union<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
Nika Layzell27726662017-10-24 23:16:35 -04001792 ItemUnion {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001793 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001794 vis: _visitor.fold_visibility(_i . vis),
1795 union_token: _i . union_token,
1796 ident: _i . ident,
1797 generics: _visitor.fold_generics(_i . generics),
1798 data: _visitor.fold_variant_data(_i . data),
1799 }
1800}
1801# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001802pub fn fold_item_use<V: Folder + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
Nika Layzell27726662017-10-24 23:16:35 -04001803 ItemUse {
David Tolnayc6b55bc2017-11-09 22:48:38 -08001804 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001805 vis: _visitor.fold_visibility(_i . vis),
1806 use_token: _i . use_token,
1807 path: Box::new(_visitor.fold_view_path(* _i . path)),
1808 semi_token: _i . semi_token,
1809 }
1810}
1811
Nika Layzella6f46c42017-10-26 15:26:16 -04001812pub fn fold_lifetime_def<V: Folder + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
Nika Layzell27726662017-10-24 23:16:35 -04001813 LifetimeDef {
1814 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1815 lifetime: _i . lifetime,
1816 colon_token: _i . colon_token,
1817 bounds: _i . bounds,
1818 }
1819}
1820# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001821pub fn fold_local<V: Folder + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
Nika Layzell27726662017-10-24 23:16:35 -04001822 Local {
1823 let_token: _i . let_token,
1824 colon_token: _i . colon_token,
1825 eq_token: _i . eq_token,
1826 semi_token: _i . semi_token,
1827 pat: Box::new(_visitor.fold_pat(* _i . pat)),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001828 ty: (_i . ty).map(|it| { Box::new(_visitor.fold_type(* it)) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001829 init: (_i . init).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04001830 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1831 }
1832}
Nika Layzell27726662017-10-24 23:16:35 -04001833# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001834pub fn fold_mac_stmt_style<V: Folder + ?Sized>(_visitor: &mut V, _i: MacStmtStyle) -> MacStmtStyle {
Nika Layzell27726662017-10-24 23:16:35 -04001835 use ::MacStmtStyle::*;
1836 match _i {
1837 Semicolon(_binding_0, ) => {
1838 Semicolon (
1839 _binding_0,
1840 )
1841 }
1842 Braces => { Braces }
1843 NoBraces => { NoBraces }
1844 }
1845}
1846
David Tolnaydecf28d2017-11-11 11:56:45 -08001847pub fn fold_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
1848 Macro {
1849 path: _visitor.fold_path(_i . path),
1850 bang_token: _i . bang_token,
David Tolnaydecf28d2017-11-11 11:56:45 -08001851 tokens: _i . tokens,
1852 }
1853}
1854
Nika Layzella6f46c42017-10-26 15:26:16 -04001855pub fn fold_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItem) -> MetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001856 use ::MetaItem::*;
1857 match _i {
1858 Term(_binding_0, ) => {
1859 Term (
1860 _binding_0,
1861 )
1862 }
1863 List(_binding_0, ) => {
1864 List (
1865 _visitor.fold_meta_item_list(_binding_0),
1866 )
1867 }
1868 NameValue(_binding_0, ) => {
1869 NameValue (
1870 _visitor.fold_meta_name_value(_binding_0),
1871 )
1872 }
1873 }
1874}
1875
Nika Layzella6f46c42017-10-26 15:26:16 -04001876pub fn fold_meta_item_list<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaItemList) -> MetaItemList {
Nika Layzell27726662017-10-24 23:16:35 -04001877 MetaItemList {
1878 ident: _i . ident,
1879 paren_token: _i . paren_token,
1880 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta_item(it) }),
1881 }
1882}
1883
Nika Layzella6f46c42017-10-26 15:26:16 -04001884pub fn fold_meta_name_value<V: Folder + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
Nika Layzell27726662017-10-24 23:16:35 -04001885 MetaNameValue {
1886 ident: _i . ident,
1887 eq_token: _i . eq_token,
1888 lit: _i . lit,
1889 }
1890}
1891# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001892pub fn fold_method_sig<V: Folder + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
Nika Layzell27726662017-10-24 23:16:35 -04001893 MethodSig {
1894 constness: _visitor.fold_constness(_i . constness),
1895 unsafety: _visitor.fold_unsafety(_i . unsafety),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04001896 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04001897 ident: _i . ident,
1898 decl: _visitor.fold_fn_decl(_i . decl),
1899 }
1900}
1901
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001902pub fn fold_mut_type<V: Folder + ?Sized>(_visitor: &mut V, _i: MutType) -> MutType {
1903 MutType {
1904 ty: _visitor.fold_type(_i . ty),
Nika Layzell27726662017-10-24 23:16:35 -04001905 mutability: _visitor.fold_mutability(_i . mutability),
1906 }
1907}
1908
Nika Layzella6f46c42017-10-26 15:26:16 -04001909pub fn fold_mutability<V: Folder + ?Sized>(_visitor: &mut V, _i: Mutability) -> Mutability {
Nika Layzell27726662017-10-24 23:16:35 -04001910 use ::Mutability::*;
1911 match _i {
1912 Mutable(_binding_0, ) => {
1913 Mutable (
1914 _binding_0,
1915 )
1916 }
1917 Immutable => { Immutable }
1918 }
1919}
1920
Nika Layzella6f46c42017-10-26 15:26:16 -04001921pub fn fold_nested_meta_item<V: Folder + ?Sized>(_visitor: &mut V, _i: NestedMetaItem) -> NestedMetaItem {
Nika Layzell27726662017-10-24 23:16:35 -04001922 use ::NestedMetaItem::*;
1923 match _i {
1924 MetaItem(_binding_0, ) => {
1925 MetaItem (
1926 _visitor.fold_meta_item(_binding_0),
1927 )
1928 }
1929 Literal(_binding_0, ) => {
1930 Literal (
1931 _binding_0,
1932 )
1933 }
1934 }
1935}
1936
Nika Layzella6f46c42017-10-26 15:26:16 -04001937pub fn fold_parenthesized_parameter_data<V: Folder + ?Sized>(_visitor: &mut V, _i: ParenthesizedParameterData) -> ParenthesizedParameterData {
Nika Layzell27726662017-10-24 23:16:35 -04001938 ParenthesizedParameterData {
1939 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08001940 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
David Tolnayf93b90d2017-11-11 19:21:26 -08001941 output: _visitor.fold_return_type(_i . output),
Nika Layzell27726662017-10-24 23:16:35 -04001942 }
1943}
1944# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04001945pub fn fold_pat<V: Folder + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
Nika Layzell27726662017-10-24 23:16:35 -04001946 use ::Pat::*;
1947 match _i {
1948 Wild(_binding_0, ) => {
1949 Wild (
1950 _visitor.fold_pat_wild(_binding_0),
1951 )
1952 }
1953 Ident(_binding_0, ) => {
1954 Ident (
1955 _visitor.fold_pat_ident(_binding_0),
1956 )
1957 }
1958 Struct(_binding_0, ) => {
1959 Struct (
1960 _visitor.fold_pat_struct(_binding_0),
1961 )
1962 }
1963 TupleStruct(_binding_0, ) => {
1964 TupleStruct (
1965 _visitor.fold_pat_tuple_struct(_binding_0),
1966 )
1967 }
1968 Path(_binding_0, ) => {
1969 Path (
1970 _visitor.fold_pat_path(_binding_0),
1971 )
1972 }
1973 Tuple(_binding_0, ) => {
1974 Tuple (
1975 _visitor.fold_pat_tuple(_binding_0),
1976 )
1977 }
1978 Box(_binding_0, ) => {
1979 Box (
1980 _visitor.fold_pat_box(_binding_0),
1981 )
1982 }
1983 Ref(_binding_0, ) => {
1984 Ref (
1985 _visitor.fold_pat_ref(_binding_0),
1986 )
1987 }
1988 Lit(_binding_0, ) => {
1989 Lit (
1990 _visitor.fold_pat_lit(_binding_0),
1991 )
1992 }
1993 Range(_binding_0, ) => {
1994 Range (
1995 _visitor.fold_pat_range(_binding_0),
1996 )
1997 }
1998 Slice(_binding_0, ) => {
1999 Slice (
2000 _visitor.fold_pat_slice(_binding_0),
2001 )
2002 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002003 Macro(_binding_0, ) => {
2004 Macro (
2005 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002006 )
2007 }
2008 }
2009}
2010# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002011pub fn fold_pat_box<V: Folder + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
Nika Layzell27726662017-10-24 23:16:35 -04002012 PatBox {
2013 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2014 box_token: _i . box_token,
2015 }
2016}
2017# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002018pub fn fold_pat_ident<V: Folder + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
Nika Layzell27726662017-10-24 23:16:35 -04002019 PatIdent {
2020 mode: _visitor.fold_binding_mode(_i . mode),
2021 ident: _i . ident,
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002022 subpat: (_i . subpat).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002023 at_token: _i . at_token,
2024 }
2025}
2026# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002027pub fn fold_pat_lit<V: Folder + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
Nika Layzell27726662017-10-24 23:16:35 -04002028 PatLit {
2029 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2030 }
2031}
2032# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002033pub fn fold_pat_path<V: Folder + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
Nika Layzell27726662017-10-24 23:16:35 -04002034 PatPath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002035 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002036 path: _visitor.fold_path(_i . path),
2037 }
2038}
2039# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002040pub fn fold_pat_range<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
Nika Layzell27726662017-10-24 23:16:35 -04002041 PatRange {
2042 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2043 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2044 limits: _visitor.fold_range_limits(_i . limits),
2045 }
2046}
2047# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002048pub fn fold_pat_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
Nika Layzell27726662017-10-24 23:16:35 -04002049 PatRef {
2050 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2051 mutbl: _visitor.fold_mutability(_i . mutbl),
2052 and_token: _i . and_token,
2053 }
2054}
2055# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002056pub fn fold_pat_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
Nika Layzell27726662017-10-24 23:16:35 -04002057 PatSlice {
2058 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002059 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
Nika Layzell27726662017-10-24 23:16:35 -04002060 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2061 dot2_token: _i . dot2_token,
2062 comma_token: _i . comma_token,
2063 bracket_token: _i . bracket_token,
2064 }
2065}
2066# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002067pub fn fold_pat_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002068 PatStruct {
2069 path: _visitor.fold_path(_i . path),
2070 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2071 brace_token: _i . brace_token,
2072 dot2_token: _i . dot2_token,
2073 }
2074}
2075# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002076pub fn fold_pat_tuple<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
Nika Layzell27726662017-10-24 23:16:35 -04002077 PatTuple {
2078 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
2079 dots_pos: _i . dots_pos,
2080 paren_token: _i . paren_token,
2081 dot2_token: _i . dot2_token,
2082 comma_token: _i . comma_token,
2083 }
2084}
2085# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002086pub fn fold_pat_tuple_struct<V: Folder + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
Nika Layzell27726662017-10-24 23:16:35 -04002087 PatTupleStruct {
2088 path: _visitor.fold_path(_i . path),
2089 pat: _visitor.fold_pat_tuple(_i . pat),
2090 }
2091}
2092# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002093pub fn fold_pat_wild<V: Folder + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
Nika Layzell27726662017-10-24 23:16:35 -04002094 PatWild {
2095 underscore_token: _i . underscore_token,
2096 }
2097}
2098
Nika Layzella6f46c42017-10-26 15:26:16 -04002099pub fn fold_path<V: Folder + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
Nika Layzell27726662017-10-24 23:16:35 -04002100 Path {
2101 leading_colon: _i . leading_colon,
2102 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2103 }
2104}
2105# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002106pub fn fold_path_glob<V: Folder + ?Sized>(_visitor: &mut V, _i: PathGlob) -> PathGlob {
Nika Layzell27726662017-10-24 23:16:35 -04002107 PathGlob {
2108 path: _visitor.fold_path(_i . path),
2109 colon2_token: _i . colon2_token,
2110 star_token: _i . star_token,
2111 }
2112}
2113# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002114pub fn fold_path_list<V: Folder + ?Sized>(_visitor: &mut V, _i: PathList) -> PathList {
Nika Layzell27726662017-10-24 23:16:35 -04002115 PathList {
2116 path: _visitor.fold_path(_i . path),
2117 colon2_token: _i . colon2_token,
2118 brace_token: _i . brace_token,
2119 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_path_list_item(it) }),
2120 }
2121}
2122# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002123pub fn fold_path_list_item<V: Folder + ?Sized>(_visitor: &mut V, _i: PathListItem) -> PathListItem {
Nika Layzell27726662017-10-24 23:16:35 -04002124 PathListItem {
2125 name: _i . name,
2126 rename: _i . rename,
2127 as_token: _i . as_token,
2128 }
2129}
2130
Nika Layzella6f46c42017-10-26 15:26:16 -04002131pub fn fold_path_parameters<V: Folder + ?Sized>(_visitor: &mut V, _i: PathParameters) -> PathParameters {
Nika Layzell27726662017-10-24 23:16:35 -04002132 use ::PathParameters::*;
2133 match _i {
2134 None => { None }
2135 AngleBracketed(_binding_0, ) => {
2136 AngleBracketed (
2137 _visitor.fold_angle_bracketed_parameter_data(_binding_0),
2138 )
2139 }
2140 Parenthesized(_binding_0, ) => {
2141 Parenthesized (
2142 _visitor.fold_parenthesized_parameter_data(_binding_0),
2143 )
2144 }
2145 }
2146}
2147
Nika Layzella6f46c42017-10-26 15:26:16 -04002148pub fn fold_path_segment<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
Nika Layzell27726662017-10-24 23:16:35 -04002149 PathSegment {
2150 ident: _i . ident,
2151 parameters: _visitor.fold_path_parameters(_i . parameters),
2152 }
2153}
2154# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002155pub fn fold_path_simple<V: Folder + ?Sized>(_visitor: &mut V, _i: PathSimple) -> PathSimple {
Nika Layzell27726662017-10-24 23:16:35 -04002156 PathSimple {
2157 path: _visitor.fold_path(_i . path),
2158 as_token: _i . as_token,
2159 rename: _i . rename,
2160 }
2161}
2162
Nika Layzella6f46c42017-10-26 15:26:16 -04002163pub fn fold_poly_trait_ref<V: Folder + ?Sized>(_visitor: &mut V, _i: PolyTraitRef) -> PolyTraitRef {
Nika Layzell27726662017-10-24 23:16:35 -04002164 PolyTraitRef {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002165 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002166 trait_ref: _visitor.fold_path(_i . trait_ref),
2167 }
2168}
2169
Nika Layzella6f46c42017-10-26 15:26:16 -04002170pub fn fold_qself<V: Folder + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
Nika Layzell27726662017-10-24 23:16:35 -04002171 QSelf {
2172 lt_token: _i . lt_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002173 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002174 position: _i . position,
2175 as_token: _i . as_token,
2176 gt_token: _i . gt_token,
2177 }
2178}
2179# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002180pub fn fold_range_limits<V: Folder + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
Nika Layzell27726662017-10-24 23:16:35 -04002181 use ::RangeLimits::*;
2182 match _i {
2183 HalfOpen(_binding_0, ) => {
2184 HalfOpen (
2185 _binding_0,
2186 )
2187 }
2188 Closed(_binding_0, ) => {
2189 Closed (
2190 _binding_0,
2191 )
2192 }
2193 }
2194}
David Tolnayf93b90d2017-11-11 19:21:26 -08002195
2196pub fn fold_return_type<V: Folder + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2197 use ::ReturnType::*;
2198 match _i {
2199 Default => { Default }
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002200 Type(_binding_0, _binding_1, ) => {
2201 Type (
2202 _visitor.fold_type(_binding_0),
David Tolnayf93b90d2017-11-11 19:21:26 -08002203 _binding_1,
2204 )
2205 }
2206 }
2207}
Nika Layzell27726662017-10-24 23:16:35 -04002208# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002209pub fn fold_stmt<V: Folder + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
Nika Layzell27726662017-10-24 23:16:35 -04002210 use ::Stmt::*;
2211 match _i {
2212 Local(_binding_0, ) => {
2213 Local (
2214 Box::new(_visitor.fold_local(* _binding_0)),
2215 )
2216 }
2217 Item(_binding_0, ) => {
2218 Item (
2219 Box::new(_visitor.fold_item(* _binding_0)),
2220 )
2221 }
2222 Expr(_binding_0, ) => {
2223 Expr (
2224 Box::new(_visitor.fold_expr(* _binding_0)),
2225 )
2226 }
2227 Semi(_binding_0, _binding_1, ) => {
2228 Semi (
2229 Box::new(_visitor.fold_expr(* _binding_0)),
2230 _binding_1,
2231 )
2232 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002233 Macro(_binding_0, ) => {
2234 Macro (
Nika Layzell27726662017-10-24 23:16:35 -04002235 _binding_0,
2236 )
2237 }
2238 }
2239}
2240
Nika Layzella6f46c42017-10-26 15:26:16 -04002241pub fn fold_trait_bound_modifier<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
Nika Layzell27726662017-10-24 23:16:35 -04002242 use ::TraitBoundModifier::*;
2243 match _i {
2244 None => { None }
2245 Maybe(_binding_0, ) => {
2246 Maybe (
2247 _binding_0,
2248 )
2249 }
2250 }
2251}
2252# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002253pub fn fold_trait_item<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
David Tolnayda705bd2017-11-10 21:58:05 -08002254 use ::TraitItem::*;
Nika Layzell27726662017-10-24 23:16:35 -04002255 match _i {
2256 Const(_binding_0, ) => {
2257 Const (
2258 _visitor.fold_trait_item_const(_binding_0),
2259 )
2260 }
2261 Method(_binding_0, ) => {
2262 Method (
2263 _visitor.fold_trait_item_method(_binding_0),
2264 )
2265 }
2266 Type(_binding_0, ) => {
2267 Type (
2268 _visitor.fold_trait_item_type(_binding_0),
2269 )
2270 }
2271 Macro(_binding_0, ) => {
2272 Macro (
David Tolnaydecf28d2017-11-11 11:56:45 -08002273 _visitor.fold_trait_item_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002274 )
2275 }
2276 }
2277}
2278# [ cfg ( feature = "full" ) ]
David Tolnayda705bd2017-11-10 21:58:05 -08002279pub fn fold_trait_item_const<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2280 TraitItemConst {
2281 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2282 const_token: _i . const_token,
2283 ident: _i . ident,
2284 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002285 ty: _visitor.fold_type(_i . ty),
David Tolnayda705bd2017-11-10 21:58:05 -08002286 default: _i . default,
2287 semi_token: _i . semi_token,
2288 }
2289}
2290# [ cfg ( feature = "full" ) ]
David Tolnaydecf28d2017-11-11 11:56:45 -08002291pub fn fold_trait_item_macro<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2292 TraitItemMacro {
David Tolnayda705bd2017-11-10 21:58:05 -08002293 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
David Tolnaydecf28d2017-11-11 11:56:45 -08002294 mac: _visitor.fold_macro(_i . mac),
David Tolnayda705bd2017-11-10 21:58:05 -08002295 }
2296}
2297# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002298pub fn fold_trait_item_method<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
Nika Layzell27726662017-10-24 23:16:35 -04002299 TraitItemMethod {
David Tolnayda705bd2017-11-10 21:58:05 -08002300 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002301 sig: _visitor.fold_method_sig(_i . sig),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002302 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002303 semi_token: _i . semi_token,
2304 }
2305}
2306# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002307pub fn fold_trait_item_type<V: Folder + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
Nika Layzell27726662017-10-24 23:16:35 -04002308 TraitItemType {
David Tolnayda705bd2017-11-10 21:58:05 -08002309 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002310 type_token: _i . type_token,
2311 ident: _i . ident,
2312 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002313 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002314 default: _i . default,
2315 semi_token: _i . semi_token,
2316 }
2317}
2318
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002319pub fn fold_type<V: Folder + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2320 use ::Type::*;
Nika Layzell27726662017-10-24 23:16:35 -04002321 match _i {
2322 Slice(_binding_0, ) => {
2323 Slice (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002324 _visitor.fold_type_slice(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002325 )
2326 }
2327 Array(_binding_0, ) => {
2328 Array (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002329 _visitor.fold_type_array(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002330 )
2331 }
2332 Ptr(_binding_0, ) => {
2333 Ptr (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002334 _visitor.fold_type_ptr(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002335 )
2336 }
David Tolnay0a89b4d2017-11-13 00:55:45 -08002337 Reference(_binding_0, ) => {
2338 Reference (
2339 _visitor.fold_type_reference(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002340 )
2341 }
2342 BareFn(_binding_0, ) => {
2343 BareFn (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002344 _visitor.fold_type_bare_fn(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002345 )
2346 }
2347 Never(_binding_0, ) => {
2348 Never (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002349 _visitor.fold_type_never(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002350 )
2351 }
2352 Tup(_binding_0, ) => {
2353 Tup (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002354 _visitor.fold_type_tup(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002355 )
2356 }
2357 Path(_binding_0, ) => {
2358 Path (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002359 _visitor.fold_type_path(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002360 )
2361 }
2362 TraitObject(_binding_0, ) => {
2363 TraitObject (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002364 _visitor.fold_type_trait_object(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002365 )
2366 }
2367 ImplTrait(_binding_0, ) => {
2368 ImplTrait (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002369 _visitor.fold_type_impl_trait(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002370 )
2371 }
2372 Paren(_binding_0, ) => {
2373 Paren (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002374 _visitor.fold_type_paren(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002375 )
2376 }
2377 Group(_binding_0, ) => {
2378 Group (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002379 _visitor.fold_type_group(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002380 )
2381 }
2382 Infer(_binding_0, ) => {
2383 Infer (
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002384 _visitor.fold_type_infer(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002385 )
2386 }
David Tolnaydecf28d2017-11-11 11:56:45 -08002387 Macro(_binding_0, ) => {
2388 Macro (
2389 _visitor.fold_macro(_binding_0),
Nika Layzell27726662017-10-24 23:16:35 -04002390 )
2391 }
2392 }
2393}
2394
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002395pub fn fold_type_array<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2396 TypeArray {
Nika Layzell27726662017-10-24 23:16:35 -04002397 bracket_token: _i . bracket_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002398 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002399 semi_token: _i . semi_token,
2400 amt: _visitor.fold_expr(_i . amt),
2401 }
2402}
2403
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002404pub fn fold_type_bare_fn<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2405 TypeBareFn {
2406 ty: Box::new(_visitor.fold_bare_fn_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002407 }
2408}
2409
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002410pub fn fold_type_binding<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeBinding) -> TypeBinding {
2411 TypeBinding {
2412 ident: _i . ident,
2413 eq_token: _i . eq_token,
2414 ty: _visitor.fold_type(_i . ty),
2415 }
2416}
2417
2418pub fn fold_type_group<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2419 TypeGroup {
Nika Layzell27726662017-10-24 23:16:35 -04002420 group_token: _i . group_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002421 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002422 }
2423}
2424
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002425pub fn fold_type_impl_trait<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2426 TypeImplTrait {
Nika Layzell27726662017-10-24 23:16:35 -04002427 impl_token: _i . impl_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002428 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002429 }
2430}
2431
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002432pub fn fold_type_infer<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2433 TypeInfer {
Nika Layzell27726662017-10-24 23:16:35 -04002434 underscore_token: _i . underscore_token,
2435 }
2436}
2437
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002438pub fn fold_type_never<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2439 TypeNever {
Nika Layzell27726662017-10-24 23:16:35 -04002440 bang_token: _i . bang_token,
2441 }
2442}
2443
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002444pub fn fold_type_param<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2445 TypeParam {
Nika Layzell27726662017-10-24 23:16:35 -04002446 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2447 ident: _i . ident,
2448 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002449 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002450 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002451 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002452 }
2453}
2454
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002455pub fn fold_type_param_bound<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2456 use ::TypeParamBound::*;
Nika Layzell27726662017-10-24 23:16:35 -04002457 match _i {
2458 Trait(_binding_0, _binding_1, ) => {
2459 Trait (
2460 _visitor.fold_poly_trait_ref(_binding_0),
2461 _visitor.fold_trait_bound_modifier(_binding_1),
2462 )
2463 }
2464 Region(_binding_0, ) => {
2465 Region (
2466 _binding_0,
2467 )
2468 }
2469 }
2470}
2471
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002472pub fn fold_type_paren<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2473 TypeParen {
Nika Layzell27726662017-10-24 23:16:35 -04002474 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002475 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002476 }
2477}
2478
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002479pub fn fold_type_path<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2480 TypePath {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002481 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002482 path: _visitor.fold_path(_i . path),
2483 }
2484}
2485
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002486pub fn fold_type_ptr<V: Folder + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2487 TypePtr {
Nika Layzell27726662017-10-24 23:16:35 -04002488 star_token: _i . star_token,
2489 const_token: _i . const_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002490 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002491 }
2492}
2493
David Tolnay0a89b4d2017-11-13 00:55:45 -08002494pub fn fold_type_reference<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2495 TypeReference {
Nika Layzell27726662017-10-24 23:16:35 -04002496 and_token: _i . and_token,
2497 lifetime: _i . lifetime,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002498 ty: Box::new(_visitor.fold_mut_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002499 }
2500}
2501
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002502pub fn fold_type_slice<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2503 TypeSlice {
2504 ty: Box::new(_visitor.fold_type(* _i . ty)),
Nika Layzell27726662017-10-24 23:16:35 -04002505 bracket_token: _i . bracket_token,
2506 }
2507}
2508
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002509pub fn fold_type_trait_object<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2510 TypeTraitObject {
2511 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002512 }
2513}
2514
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002515pub fn fold_type_tup<V: Folder + ?Sized>(_visitor: &mut V, _i: TypeTup) -> TypeTup {
2516 TypeTup {
Nika Layzell27726662017-10-24 23:16:35 -04002517 paren_token: _i . paren_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002518 tys: FoldHelper::lift(_i . tys, |it| { _visitor.fold_type(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002519 lone_comma: _i . lone_comma,
2520 }
2521}
2522
Nika Layzella6f46c42017-10-26 15:26:16 -04002523pub fn fold_un_op<V: Folder + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
Nika Layzell27726662017-10-24 23:16:35 -04002524 use ::UnOp::*;
2525 match _i {
2526 Deref(_binding_0, ) => {
2527 Deref (
2528 _binding_0,
2529 )
2530 }
2531 Not(_binding_0, ) => {
2532 Not (
2533 _binding_0,
2534 )
2535 }
2536 Neg(_binding_0, ) => {
2537 Neg (
2538 _binding_0,
2539 )
2540 }
2541 }
2542}
2543
Nika Layzella6f46c42017-10-26 15:26:16 -04002544pub fn fold_unsafety<V: Folder + ?Sized>(_visitor: &mut V, _i: Unsafety) -> Unsafety {
Nika Layzell27726662017-10-24 23:16:35 -04002545 use ::Unsafety::*;
2546 match _i {
2547 Unsafe(_binding_0, ) => {
2548 Unsafe (
2549 _binding_0,
2550 )
2551 }
2552 Normal => { Normal }
2553 }
2554}
2555
Nika Layzella6f46c42017-10-26 15:26:16 -04002556pub fn fold_variant<V: Folder + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
Nika Layzell27726662017-10-24 23:16:35 -04002557 Variant {
2558 ident: _i . ident,
2559 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2560 data: _visitor.fold_variant_data(_i . data),
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002561 discriminant: (_i . discriminant).map(|it| { _visitor.fold_expr(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002562 eq_token: _i . eq_token,
2563 }
2564}
2565
Nika Layzella6f46c42017-10-26 15:26:16 -04002566pub fn fold_variant_data<V: Folder + ?Sized>(_visitor: &mut V, _i: VariantData) -> VariantData {
Nika Layzell27726662017-10-24 23:16:35 -04002567 use ::VariantData::*;
2568 match _i {
2569 Struct(_binding_0, _binding_1, ) => {
2570 Struct (
2571 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2572 _binding_1,
2573 )
2574 }
2575 Tuple(_binding_0, _binding_1, ) => {
2576 Tuple (
2577 FoldHelper::lift(_binding_0, |it| { _visitor.fold_field(it) }),
2578 _binding_1,
2579 )
2580 }
2581 Unit => { Unit }
2582 }
2583}
2584# [ cfg ( feature = "full" ) ]
Nika Layzella6f46c42017-10-26 15:26:16 -04002585pub fn fold_view_path<V: Folder + ?Sized>(_visitor: &mut V, _i: ViewPath) -> ViewPath {
Nika Layzell27726662017-10-24 23:16:35 -04002586 use ::ViewPath::*;
2587 match _i {
2588 Simple(_binding_0, ) => {
2589 Simple (
2590 _visitor.fold_path_simple(_binding_0),
2591 )
2592 }
2593 Glob(_binding_0, ) => {
2594 Glob (
2595 _visitor.fold_path_glob(_binding_0),
2596 )
2597 }
2598 List(_binding_0, ) => {
2599 List (
2600 _visitor.fold_path_list(_binding_0),
2601 )
2602 }
2603 }
2604}
2605
Nika Layzella6f46c42017-10-26 15:26:16 -04002606pub fn fold_vis_crate<V: Folder + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
Nika Layzell27726662017-10-24 23:16:35 -04002607 VisCrate {
2608 pub_token: _i . pub_token,
2609 paren_token: _i . paren_token,
2610 crate_token: _i . crate_token,
2611 }
2612}
2613
Nika Layzella6f46c42017-10-26 15:26:16 -04002614pub fn fold_vis_inherited<V: Folder + ?Sized>(_visitor: &mut V, _i: VisInherited) -> VisInherited {
Nika Layzell27726662017-10-24 23:16:35 -04002615 VisInherited {
2616 }
2617}
2618
Nika Layzella6f46c42017-10-26 15:26:16 -04002619pub fn fold_vis_public<V: Folder + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
Nika Layzell27726662017-10-24 23:16:35 -04002620 VisPublic {
2621 pub_token: _i . pub_token,
2622 }
2623}
2624
Nika Layzella6f46c42017-10-26 15:26:16 -04002625pub fn fold_vis_restricted<V: Folder + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
Nika Layzell27726662017-10-24 23:16:35 -04002626 VisRestricted {
2627 pub_token: _i . pub_token,
2628 paren_token: _i . paren_token,
2629 in_token: _i . in_token,
2630 path: Box::new(_visitor.fold_path(* _i . path)),
2631 }
2632}
2633
Nika Layzella6f46c42017-10-26 15:26:16 -04002634pub fn fold_visibility<V: Folder + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
Nika Layzell27726662017-10-24 23:16:35 -04002635 use ::Visibility::*;
2636 match _i {
2637 Public(_binding_0, ) => {
2638 Public (
2639 _visitor.fold_vis_public(_binding_0),
2640 )
2641 }
2642 Crate(_binding_0, ) => {
2643 Crate (
2644 _visitor.fold_vis_crate(_binding_0),
2645 )
2646 }
2647 Restricted(_binding_0, ) => {
2648 Restricted (
2649 _visitor.fold_vis_restricted(_binding_0),
2650 )
2651 }
2652 Inherited(_binding_0, ) => {
2653 Inherited (
2654 _visitor.fold_vis_inherited(_binding_0),
2655 )
2656 }
2657 }
2658}
2659
Nika Layzella6f46c42017-10-26 15:26:16 -04002660pub fn fold_where_bound_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereBoundPredicate) -> WhereBoundPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002661 WhereBoundPredicate {
Nika Layzell4ab8d6e2017-10-26 09:45:49 -04002662 bound_lifetimes: (_i . bound_lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002663 bounded_ty: _visitor.fold_type(_i . bounded_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002664 colon_token: _i . colon_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002665 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
Nika Layzell27726662017-10-24 23:16:35 -04002666 }
2667}
2668
Nika Layzella6f46c42017-10-26 15:26:16 -04002669pub fn fold_where_clause<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
Nika Layzell27726662017-10-24 23:16:35 -04002670 WhereClause {
2671 where_token: _i . where_token,
2672 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2673 }
2674}
2675
Nika Layzella6f46c42017-10-26 15:26:16 -04002676pub fn fold_where_eq_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereEqPredicate) -> WhereEqPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002677 WhereEqPredicate {
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002678 lhs_ty: _visitor.fold_type(_i . lhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002679 eq_token: _i . eq_token,
David Tolnayfd6bf5c2017-11-12 09:41:14 -08002680 rhs_ty: _visitor.fold_type(_i . rhs_ty),
Nika Layzell27726662017-10-24 23:16:35 -04002681 }
2682}
2683
Nika Layzella6f46c42017-10-26 15:26:16 -04002684pub fn fold_where_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002685 use ::WherePredicate::*;
2686 match _i {
2687 BoundPredicate(_binding_0, ) => {
2688 BoundPredicate (
2689 _visitor.fold_where_bound_predicate(_binding_0),
2690 )
2691 }
2692 RegionPredicate(_binding_0, ) => {
2693 RegionPredicate (
2694 _visitor.fold_where_region_predicate(_binding_0),
2695 )
2696 }
2697 EqPredicate(_binding_0, ) => {
2698 EqPredicate (
2699 _visitor.fold_where_eq_predicate(_binding_0),
2700 )
2701 }
2702 }
2703}
2704
Nika Layzella6f46c42017-10-26 15:26:16 -04002705pub fn fold_where_region_predicate<V: Folder + ?Sized>(_visitor: &mut V, _i: WhereRegionPredicate) -> WhereRegionPredicate {
Nika Layzell27726662017-10-24 23:16:35 -04002706 WhereRegionPredicate {
2707 lifetime: _i . lifetime,
2708 colon_token: _i . colon_token,
2709 bounds: _i . bounds,
2710 }
2711}
2712