]> git.proxmox.com Git - rustc.git/blob - src/vendor/syn-0.12.15/src/gen/fold.rs
New upstream version 1.27.1+dfsg1
[rustc.git] / src / vendor / syn-0.12.15 / src / gen / fold.rs
1 // THIS FILE IS AUTOMATICALLY GENERATED; DO NOT EDIT
2
3 #![cfg_attr(rustfmt, rustfmt_skip)]
4
5 // Unreachable code is generated sometimes without the full feature.
6 #![allow(unreachable_code)]
7 #![cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
8
9 use *;
10 #[cfg(any(feature = "full", feature = "derive"))]
11 use token::{Brace, Bracket, Paren, Group};
12 use proc_macro2::Span;
13 #[cfg(any(feature = "full", feature = "derive"))]
14 use gen::helper::fold::*;
15
16
17 #[cfg(feature = "full")]
18 macro_rules! full {
19 ($e:expr) => { $e }
20 }
21
22 #[cfg(all(feature = "derive", not(feature = "full")))]
23 macro_rules! full {
24 ($e:expr) => { unreachable!() }
25 }
26
27
28 /// Syntax tree traversal to transform the nodes of an owned syntax tree.
29 ///
30 /// See the [module documentation] for details.
31 ///
32 /// [module documentation]: index.html
33 ///
34 /// *This trait is available if Syn is built with the `"fold"` feature.*
35 pub trait Fold {
36 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
37 fn fold_abi(&mut self, i: Abi) -> Abi { fold_abi(self, i) }
38 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
39 fn fold_angle_bracketed_generic_arguments(&mut self, i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments { fold_angle_bracketed_generic_arguments(self, i) }
40 # [ cfg ( feature = "full" ) ]
41 fn fold_arg_captured(&mut self, i: ArgCaptured) -> ArgCaptured { fold_arg_captured(self, i) }
42 # [ cfg ( feature = "full" ) ]
43 fn fold_arg_self(&mut self, i: ArgSelf) -> ArgSelf { fold_arg_self(self, i) }
44 # [ cfg ( feature = "full" ) ]
45 fn fold_arg_self_ref(&mut self, i: ArgSelfRef) -> ArgSelfRef { fold_arg_self_ref(self, i) }
46 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
47 fn fold_arm(&mut self, i: Arm) -> Arm { fold_arm(self, i) }
48 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
49 fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle { fold_attr_style(self, i) }
50 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
51 fn fold_attribute(&mut self, i: Attribute) -> Attribute { fold_attribute(self, i) }
52 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
53 fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg { fold_bare_fn_arg(self, i) }
54 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
55 fn fold_bare_fn_arg_name(&mut self, i: BareFnArgName) -> BareFnArgName { fold_bare_fn_arg_name(self, i) }
56 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
57 fn fold_bin_op(&mut self, i: BinOp) -> BinOp { fold_bin_op(self, i) }
58 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
59 fn fold_binding(&mut self, i: Binding) -> Binding { fold_binding(self, i) }
60 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
61 fn fold_block(&mut self, i: Block) -> Block { fold_block(self, i) }
62 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
63 fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes { fold_bound_lifetimes(self, i) }
64 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
65 fn fold_const_param(&mut self, i: ConstParam) -> ConstParam { fold_const_param(self, i) }
66 # [ cfg ( feature = "derive" ) ]
67 fn fold_data(&mut self, i: Data) -> Data { fold_data(self, i) }
68 # [ cfg ( feature = "derive" ) ]
69 fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum { fold_data_enum(self, i) }
70 # [ cfg ( feature = "derive" ) ]
71 fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct { fold_data_struct(self, i) }
72 # [ cfg ( feature = "derive" ) ]
73 fn fold_data_union(&mut self, i: DataUnion) -> DataUnion { fold_data_union(self, i) }
74 # [ cfg ( feature = "derive" ) ]
75 fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput { fold_derive_input(self, i) }
76 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
77 fn fold_expr(&mut self, i: Expr) -> Expr { fold_expr(self, i) }
78 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
79 fn fold_expr_addr_of(&mut self, i: ExprAddrOf) -> ExprAddrOf { fold_expr_addr_of(self, i) }
80 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
81 fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray { fold_expr_array(self, i) }
82 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
83 fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign { fold_expr_assign(self, i) }
84 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
85 fn fold_expr_assign_op(&mut self, i: ExprAssignOp) -> ExprAssignOp { fold_expr_assign_op(self, i) }
86 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
87 fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary { fold_expr_binary(self, i) }
88 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
89 fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock { fold_expr_block(self, i) }
90 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
91 fn fold_expr_box(&mut self, i: ExprBox) -> ExprBox { fold_expr_box(self, i) }
92 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
93 fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak { fold_expr_break(self, i) }
94 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
95 fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall { fold_expr_call(self, i) }
96 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
97 fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast { fold_expr_cast(self, i) }
98 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
99 fn fold_expr_catch(&mut self, i: ExprCatch) -> ExprCatch { fold_expr_catch(self, i) }
100 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
101 fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure { fold_expr_closure(self, i) }
102 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
103 fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue { fold_expr_continue(self, i) }
104 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
105 fn fold_expr_field(&mut self, i: ExprField) -> ExprField { fold_expr_field(self, i) }
106 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
107 fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop { fold_expr_for_loop(self, i) }
108 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
109 fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup { fold_expr_group(self, i) }
110 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
111 fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf { fold_expr_if(self, i) }
112 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
113 fn fold_expr_if_let(&mut self, i: ExprIfLet) -> ExprIfLet { fold_expr_if_let(self, i) }
114 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
115 fn fold_expr_in_place(&mut self, i: ExprInPlace) -> ExprInPlace { fold_expr_in_place(self, i) }
116 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
117 fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex { fold_expr_index(self, i) }
118 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
119 fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit { fold_expr_lit(self, i) }
120 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
121 fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop { fold_expr_loop(self, i) }
122 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
123 fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro { fold_expr_macro(self, i) }
124 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
125 fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch { fold_expr_match(self, i) }
126 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
127 fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall { fold_expr_method_call(self, i) }
128 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
129 fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen { fold_expr_paren(self, i) }
130 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
131 fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath { fold_expr_path(self, i) }
132 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
133 fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange { fold_expr_range(self, i) }
134 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
135 fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat { fold_expr_repeat(self, i) }
136 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
137 fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn { fold_expr_return(self, i) }
138 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
139 fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct { fold_expr_struct(self, i) }
140 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
141 fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry { fold_expr_try(self, i) }
142 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
143 fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple { fold_expr_tuple(self, i) }
144 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
145 fn fold_expr_type(&mut self, i: ExprType) -> ExprType { fold_expr_type(self, i) }
146 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
147 fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary { fold_expr_unary(self, i) }
148 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
149 fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe { fold_expr_unsafe(self, i) }
150 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
151 fn fold_expr_verbatim(&mut self, i: ExprVerbatim) -> ExprVerbatim { fold_expr_verbatim(self, i) }
152 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
153 fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile { fold_expr_while(self, i) }
154 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
155 fn fold_expr_while_let(&mut self, i: ExprWhileLet) -> ExprWhileLet { fold_expr_while_let(self, i) }
156 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
157 fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield { fold_expr_yield(self, i) }
158 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
159 fn fold_field(&mut self, i: Field) -> Field { fold_field(self, i) }
160 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
161 fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat { fold_field_pat(self, i) }
162 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
163 fn fold_field_value(&mut self, i: FieldValue) -> FieldValue { fold_field_value(self, i) }
164 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
165 fn fold_fields(&mut self, i: Fields) -> Fields { fold_fields(self, i) }
166 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
167 fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed { fold_fields_named(self, i) }
168 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
169 fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed { fold_fields_unnamed(self, i) }
170 # [ cfg ( feature = "full" ) ]
171 fn fold_file(&mut self, i: File) -> File { fold_file(self, i) }
172 # [ cfg ( feature = "full" ) ]
173 fn fold_fn_arg(&mut self, i: FnArg) -> FnArg { fold_fn_arg(self, i) }
174 # [ cfg ( feature = "full" ) ]
175 fn fold_fn_decl(&mut self, i: FnDecl) -> FnDecl { fold_fn_decl(self, i) }
176 # [ cfg ( feature = "full" ) ]
177 fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem { fold_foreign_item(self, i) }
178 # [ cfg ( feature = "full" ) ]
179 fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn { fold_foreign_item_fn(self, i) }
180 # [ cfg ( feature = "full" ) ]
181 fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic { fold_foreign_item_static(self, i) }
182 # [ cfg ( feature = "full" ) ]
183 fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType { fold_foreign_item_type(self, i) }
184 # [ cfg ( feature = "full" ) ]
185 fn fold_foreign_item_verbatim(&mut self, i: ForeignItemVerbatim) -> ForeignItemVerbatim { fold_foreign_item_verbatim(self, i) }
186 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
187 fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument { fold_generic_argument(self, i) }
188 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
189 fn fold_generic_method_argument(&mut self, i: GenericMethodArgument) -> GenericMethodArgument { fold_generic_method_argument(self, i) }
190 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
191 fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam { fold_generic_param(self, i) }
192 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
193 fn fold_generics(&mut self, i: Generics) -> Generics { fold_generics(self, i) }
194
195 fn fold_ident(&mut self, i: Ident) -> Ident { fold_ident(self, i) }
196 # [ cfg ( feature = "full" ) ]
197 fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem { fold_impl_item(self, i) }
198 # [ cfg ( feature = "full" ) ]
199 fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst { fold_impl_item_const(self, i) }
200 # [ cfg ( feature = "full" ) ]
201 fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro { fold_impl_item_macro(self, i) }
202 # [ cfg ( feature = "full" ) ]
203 fn fold_impl_item_method(&mut self, i: ImplItemMethod) -> ImplItemMethod { fold_impl_item_method(self, i) }
204 # [ cfg ( feature = "full" ) ]
205 fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType { fold_impl_item_type(self, i) }
206 # [ cfg ( feature = "full" ) ]
207 fn fold_impl_item_verbatim(&mut self, i: ImplItemVerbatim) -> ImplItemVerbatim { fold_impl_item_verbatim(self, i) }
208 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
209 fn fold_index(&mut self, i: Index) -> Index { fold_index(self, i) }
210 # [ cfg ( feature = "full" ) ]
211 fn fold_item(&mut self, i: Item) -> Item { fold_item(self, i) }
212 # [ cfg ( feature = "full" ) ]
213 fn fold_item_const(&mut self, i: ItemConst) -> ItemConst { fold_item_const(self, i) }
214 # [ cfg ( feature = "full" ) ]
215 fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum { fold_item_enum(self, i) }
216 # [ cfg ( feature = "full" ) ]
217 fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate { fold_item_extern_crate(self, i) }
218 # [ cfg ( feature = "full" ) ]
219 fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn { fold_item_fn(self, i) }
220 # [ cfg ( feature = "full" ) ]
221 fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod { fold_item_foreign_mod(self, i) }
222 # [ cfg ( feature = "full" ) ]
223 fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl { fold_item_impl(self, i) }
224 # [ cfg ( feature = "full" ) ]
225 fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro { fold_item_macro(self, i) }
226 # [ cfg ( feature = "full" ) ]
227 fn fold_item_macro2(&mut self, i: ItemMacro2) -> ItemMacro2 { fold_item_macro2(self, i) }
228 # [ cfg ( feature = "full" ) ]
229 fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod { fold_item_mod(self, i) }
230 # [ cfg ( feature = "full" ) ]
231 fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic { fold_item_static(self, i) }
232 # [ cfg ( feature = "full" ) ]
233 fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct { fold_item_struct(self, i) }
234 # [ cfg ( feature = "full" ) ]
235 fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait { fold_item_trait(self, i) }
236 # [ cfg ( feature = "full" ) ]
237 fn fold_item_type(&mut self, i: ItemType) -> ItemType { fold_item_type(self, i) }
238 # [ cfg ( feature = "full" ) ]
239 fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion { fold_item_union(self, i) }
240 # [ cfg ( feature = "full" ) ]
241 fn fold_item_use(&mut self, i: ItemUse) -> ItemUse { fold_item_use(self, i) }
242 # [ cfg ( feature = "full" ) ]
243 fn fold_item_verbatim(&mut self, i: ItemVerbatim) -> ItemVerbatim { fold_item_verbatim(self, i) }
244 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
245 fn fold_label(&mut self, i: Label) -> Label { fold_label(self, i) }
246 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
247 fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime { fold_lifetime(self, i) }
248 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
249 fn fold_lifetime_def(&mut self, i: LifetimeDef) -> LifetimeDef { fold_lifetime_def(self, i) }
250 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
251 fn fold_lit(&mut self, i: Lit) -> Lit { fold_lit(self, i) }
252 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
253 fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { fold_lit_bool(self, i) }
254 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
255 fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { fold_lit_byte(self, i) }
256 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
257 fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { fold_lit_byte_str(self, i) }
258 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
259 fn fold_lit_char(&mut self, i: LitChar) -> LitChar { fold_lit_char(self, i) }
260 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
261 fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { fold_lit_float(self, i) }
262 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
263 fn fold_lit_int(&mut self, i: LitInt) -> LitInt { fold_lit_int(self, i) }
264 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
265 fn fold_lit_str(&mut self, i: LitStr) -> LitStr { fold_lit_str(self, i) }
266 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
267 fn fold_lit_verbatim(&mut self, i: LitVerbatim) -> LitVerbatim { fold_lit_verbatim(self, i) }
268 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
269 fn fold_local(&mut self, i: Local) -> Local { fold_local(self, i) }
270 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
271 fn fold_macro(&mut self, i: Macro) -> Macro { fold_macro(self, i) }
272 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
273 fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter { fold_macro_delimiter(self, i) }
274 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
275 fn fold_member(&mut self, i: Member) -> Member { fold_member(self, i) }
276 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
277 fn fold_meta(&mut self, i: Meta) -> Meta { fold_meta(self, i) }
278 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
279 fn fold_meta_list(&mut self, i: MetaList) -> MetaList { fold_meta_list(self, i) }
280 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
281 fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue { fold_meta_name_value(self, i) }
282 # [ cfg ( feature = "full" ) ]
283 fn fold_method_sig(&mut self, i: MethodSig) -> MethodSig { fold_method_sig(self, i) }
284 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
285 fn fold_method_turbofish(&mut self, i: MethodTurbofish) -> MethodTurbofish { fold_method_turbofish(self, i) }
286 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
287 fn fold_nested_meta(&mut self, i: NestedMeta) -> NestedMeta { fold_nested_meta(self, i) }
288 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
289 fn fold_parenthesized_generic_arguments(&mut self, i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments { fold_parenthesized_generic_arguments(self, i) }
290 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
291 fn fold_pat(&mut self, i: Pat) -> Pat { fold_pat(self, i) }
292 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
293 fn fold_pat_box(&mut self, i: PatBox) -> PatBox { fold_pat_box(self, i) }
294 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
295 fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent { fold_pat_ident(self, i) }
296 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
297 fn fold_pat_lit(&mut self, i: PatLit) -> PatLit { fold_pat_lit(self, i) }
298 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
299 fn fold_pat_macro(&mut self, i: PatMacro) -> PatMacro { fold_pat_macro(self, i) }
300 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
301 fn fold_pat_path(&mut self, i: PatPath) -> PatPath { fold_pat_path(self, i) }
302 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
303 fn fold_pat_range(&mut self, i: PatRange) -> PatRange { fold_pat_range(self, i) }
304 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
305 fn fold_pat_ref(&mut self, i: PatRef) -> PatRef { fold_pat_ref(self, i) }
306 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
307 fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice { fold_pat_slice(self, i) }
308 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
309 fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct { fold_pat_struct(self, i) }
310 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
311 fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple { fold_pat_tuple(self, i) }
312 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
313 fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct { fold_pat_tuple_struct(self, i) }
314 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
315 fn fold_pat_verbatim(&mut self, i: PatVerbatim) -> PatVerbatim { fold_pat_verbatim(self, i) }
316 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
317 fn fold_pat_wild(&mut self, i: PatWild) -> PatWild { fold_pat_wild(self, i) }
318 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
319 fn fold_path(&mut self, i: Path) -> Path { fold_path(self, i) }
320 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
321 fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments { fold_path_arguments(self, i) }
322 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
323 fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment { fold_path_segment(self, i) }
324 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
325 fn fold_predicate_eq(&mut self, i: PredicateEq) -> PredicateEq { fold_predicate_eq(self, i) }
326 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
327 fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime { fold_predicate_lifetime(self, i) }
328 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
329 fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType { fold_predicate_type(self, i) }
330 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
331 fn fold_qself(&mut self, i: QSelf) -> QSelf { fold_qself(self, i) }
332 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
333 fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits { fold_range_limits(self, i) }
334 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
335 fn fold_return_type(&mut self, i: ReturnType) -> ReturnType { fold_return_type(self, i) }
336
337 fn fold_span(&mut self, i: Span) -> Span { fold_span(self, i) }
338 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
339 fn fold_stmt(&mut self, i: Stmt) -> Stmt { fold_stmt(self, i) }
340 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
341 fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound { fold_trait_bound(self, i) }
342 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
343 fn fold_trait_bound_modifier(&mut self, i: TraitBoundModifier) -> TraitBoundModifier { fold_trait_bound_modifier(self, i) }
344 # [ cfg ( feature = "full" ) ]
345 fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem { fold_trait_item(self, i) }
346 # [ cfg ( feature = "full" ) ]
347 fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst { fold_trait_item_const(self, i) }
348 # [ cfg ( feature = "full" ) ]
349 fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro { fold_trait_item_macro(self, i) }
350 # [ cfg ( feature = "full" ) ]
351 fn fold_trait_item_method(&mut self, i: TraitItemMethod) -> TraitItemMethod { fold_trait_item_method(self, i) }
352 # [ cfg ( feature = "full" ) ]
353 fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType { fold_trait_item_type(self, i) }
354 # [ cfg ( feature = "full" ) ]
355 fn fold_trait_item_verbatim(&mut self, i: TraitItemVerbatim) -> TraitItemVerbatim { fold_trait_item_verbatim(self, i) }
356 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
357 fn fold_type(&mut self, i: Type) -> Type { fold_type(self, i) }
358 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
359 fn fold_type_array(&mut self, i: TypeArray) -> TypeArray { fold_type_array(self, i) }
360 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
361 fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn { fold_type_bare_fn(self, i) }
362 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
363 fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup { fold_type_group(self, i) }
364 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
365 fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait { fold_type_impl_trait(self, i) }
366 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
367 fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer { fold_type_infer(self, i) }
368 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
369 fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro { fold_type_macro(self, i) }
370 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
371 fn fold_type_never(&mut self, i: TypeNever) -> TypeNever { fold_type_never(self, i) }
372 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
373 fn fold_type_param(&mut self, i: TypeParam) -> TypeParam { fold_type_param(self, i) }
374 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
375 fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound { fold_type_param_bound(self, i) }
376 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
377 fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen { fold_type_paren(self, i) }
378 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
379 fn fold_type_path(&mut self, i: TypePath) -> TypePath { fold_type_path(self, i) }
380 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
381 fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr { fold_type_ptr(self, i) }
382 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
383 fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference { fold_type_reference(self, i) }
384 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
385 fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice { fold_type_slice(self, i) }
386 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
387 fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject { fold_type_trait_object(self, i) }
388 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
389 fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple { fold_type_tuple(self, i) }
390 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
391 fn fold_type_verbatim(&mut self, i: TypeVerbatim) -> TypeVerbatim { fold_type_verbatim(self, i) }
392 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
393 fn fold_un_op(&mut self, i: UnOp) -> UnOp { fold_un_op(self, i) }
394 # [ cfg ( feature = "full" ) ]
395 fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob { fold_use_glob(self, i) }
396 # [ cfg ( feature = "full" ) ]
397 fn fold_use_list(&mut self, i: UseList) -> UseList { fold_use_list(self, i) }
398 # [ cfg ( feature = "full" ) ]
399 fn fold_use_path(&mut self, i: UsePath) -> UsePath { fold_use_path(self, i) }
400 # [ cfg ( feature = "full" ) ]
401 fn fold_use_tree(&mut self, i: UseTree) -> UseTree { fold_use_tree(self, i) }
402 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
403 fn fold_variant(&mut self, i: Variant) -> Variant { fold_variant(self, i) }
404 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
405 fn fold_vis_crate(&mut self, i: VisCrate) -> VisCrate { fold_vis_crate(self, i) }
406 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
407 fn fold_vis_public(&mut self, i: VisPublic) -> VisPublic { fold_vis_public(self, i) }
408 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
409 fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted { fold_vis_restricted(self, i) }
410 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
411 fn fold_visibility(&mut self, i: Visibility) -> Visibility { fold_visibility(self, i) }
412 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
413 fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause { fold_where_clause(self, i) }
414 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
415 fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate { fold_where_predicate(self, i) }
416
417 }
418
419 macro_rules! fold_span_only {
420 ($f:ident : $t:ident) => {
421 pub fn $f<V: Fold + ?Sized>(_visitor: &mut V, mut _i: $t) -> $t {
422 _i.span = _visitor.fold_span(_i.span);
423 _i
424 }
425 }
426 }
427
428 fold_span_only!(fold_ident: Ident);
429 #[cfg(any(feature = "full", feature = "derive"))]
430 fold_span_only!(fold_lifetime: Lifetime);
431 #[cfg(any(feature = "full", feature = "derive"))]
432 fold_span_only!(fold_lit_byte: LitByte);
433 #[cfg(any(feature = "full", feature = "derive"))]
434 fold_span_only!(fold_lit_byte_str: LitByteStr);
435 #[cfg(any(feature = "full", feature = "derive"))]
436 fold_span_only!(fold_lit_char: LitChar);
437 #[cfg(any(feature = "full", feature = "derive"))]
438 fold_span_only!(fold_lit_float: LitFloat);
439 #[cfg(any(feature = "full", feature = "derive"))]
440 fold_span_only!(fold_lit_int: LitInt);
441 #[cfg(any(feature = "full", feature = "derive"))]
442 fold_span_only!(fold_lit_str: LitStr);
443
444 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
445 pub fn fold_abi<V: Fold + ?Sized>(_visitor: &mut V, _i: Abi) -> Abi {
446 Abi {
447 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
448 name: (_i . name).map(|it| { _visitor.fold_lit_str(it) }),
449 }
450 }
451 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
452 pub fn fold_angle_bracketed_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: AngleBracketedGenericArguments) -> AngleBracketedGenericArguments {
453 AngleBracketedGenericArguments {
454 colon2_token: (_i . colon2_token).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
455 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
456 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_argument(it) }),
457 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
458 }
459 }
460 # [ cfg ( feature = "full" ) ]
461 pub fn fold_arg_captured<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgCaptured) -> ArgCaptured {
462 ArgCaptured {
463 pat: _visitor.fold_pat(_i . pat),
464 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
465 ty: _visitor.fold_type(_i . ty),
466 }
467 }
468 # [ cfg ( feature = "full" ) ]
469 pub fn fold_arg_self<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelf) -> ArgSelf {
470 ArgSelf {
471 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
472 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
473 }
474 }
475 # [ cfg ( feature = "full" ) ]
476 pub fn fold_arg_self_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: ArgSelfRef) -> ArgSelfRef {
477 ArgSelfRef {
478 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
479 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
480 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
481 self_token: Token ! [ self ](tokens_helper(_visitor, &(_i . self_token).0)),
482 }
483 }
484 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
485 pub fn fold_arm<V: Fold + ?Sized>(_visitor: &mut V, _i: Arm) -> Arm {
486 Arm {
487 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
488 pats: FoldHelper::lift(_i . pats, |it| { _visitor.fold_pat(it) }),
489 guard: (_i . guard).map(|it| { (
490 Token ! [ if ](tokens_helper(_visitor, &(( it ) . 0).0)),
491 Box::new(_visitor.fold_expr(* ( it ) . 1)),
492 ) }),
493 rocket_token: Token ! [ => ](tokens_helper(_visitor, &(_i . rocket_token).0)),
494 body: Box::new(_visitor.fold_expr(* _i . body)),
495 comma: (_i . comma).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
496 }
497 }
498 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
499 pub fn fold_attr_style<V: Fold + ?Sized>(_visitor: &mut V, _i: AttrStyle) -> AttrStyle {
500 match _i {
501 AttrStyle::Outer => { AttrStyle::Outer }
502 AttrStyle::Inner(_binding_0, ) => {
503 AttrStyle::Inner (
504 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
505 )
506 }
507 }
508 }
509 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
510 pub fn fold_attribute<V: Fold + ?Sized>(_visitor: &mut V, _i: Attribute) -> Attribute {
511 Attribute {
512 pound_token: Token ! [ # ](tokens_helper(_visitor, &(_i . pound_token).0)),
513 style: _visitor.fold_attr_style(_i . style),
514 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
515 path: _visitor.fold_path(_i . path),
516 tts: _i . tts,
517 is_sugared_doc: _i . is_sugared_doc,
518 }
519 }
520 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
521 pub fn fold_bare_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArg) -> BareFnArg {
522 BareFnArg {
523 name: (_i . name).map(|it| { (
524 _visitor.fold_bare_fn_arg_name(( it ) . 0),
525 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 1).0)),
526 ) }),
527 ty: _visitor.fold_type(_i . ty),
528 }
529 }
530 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
531 pub fn fold_bare_fn_arg_name<V: Fold + ?Sized>(_visitor: &mut V, _i: BareFnArgName) -> BareFnArgName {
532 match _i {
533 BareFnArgName::Named(_binding_0, ) => {
534 BareFnArgName::Named (
535 _visitor.fold_ident(_binding_0),
536 )
537 }
538 BareFnArgName::Wild(_binding_0, ) => {
539 BareFnArgName::Wild (
540 Token ! [ _ ](tokens_helper(_visitor, &(_binding_0).0)),
541 )
542 }
543 }
544 }
545 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
546 pub fn fold_bin_op<V: Fold + ?Sized>(_visitor: &mut V, _i: BinOp) -> BinOp {
547 match _i {
548 BinOp::Add(_binding_0, ) => {
549 BinOp::Add (
550 Token ! [ + ](tokens_helper(_visitor, &(_binding_0).0)),
551 )
552 }
553 BinOp::Sub(_binding_0, ) => {
554 BinOp::Sub (
555 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
556 )
557 }
558 BinOp::Mul(_binding_0, ) => {
559 BinOp::Mul (
560 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
561 )
562 }
563 BinOp::Div(_binding_0, ) => {
564 BinOp::Div (
565 Token ! [ / ](tokens_helper(_visitor, &(_binding_0).0)),
566 )
567 }
568 BinOp::Rem(_binding_0, ) => {
569 BinOp::Rem (
570 Token ! [ % ](tokens_helper(_visitor, &(_binding_0).0)),
571 )
572 }
573 BinOp::And(_binding_0, ) => {
574 BinOp::And (
575 Token ! [ && ](tokens_helper(_visitor, &(_binding_0).0)),
576 )
577 }
578 BinOp::Or(_binding_0, ) => {
579 BinOp::Or (
580 Token ! [ || ](tokens_helper(_visitor, &(_binding_0).0)),
581 )
582 }
583 BinOp::BitXor(_binding_0, ) => {
584 BinOp::BitXor (
585 Token ! [ ^ ](tokens_helper(_visitor, &(_binding_0).0)),
586 )
587 }
588 BinOp::BitAnd(_binding_0, ) => {
589 BinOp::BitAnd (
590 Token ! [ & ](tokens_helper(_visitor, &(_binding_0).0)),
591 )
592 }
593 BinOp::BitOr(_binding_0, ) => {
594 BinOp::BitOr (
595 Token ! [ | ](tokens_helper(_visitor, &(_binding_0).0)),
596 )
597 }
598 BinOp::Shl(_binding_0, ) => {
599 BinOp::Shl (
600 Token ! [ << ](tokens_helper(_visitor, &(_binding_0).0)),
601 )
602 }
603 BinOp::Shr(_binding_0, ) => {
604 BinOp::Shr (
605 Token ! [ >> ](tokens_helper(_visitor, &(_binding_0).0)),
606 )
607 }
608 BinOp::Eq(_binding_0, ) => {
609 BinOp::Eq (
610 Token ! [ == ](tokens_helper(_visitor, &(_binding_0).0)),
611 )
612 }
613 BinOp::Lt(_binding_0, ) => {
614 BinOp::Lt (
615 Token ! [ < ](tokens_helper(_visitor, &(_binding_0).0)),
616 )
617 }
618 BinOp::Le(_binding_0, ) => {
619 BinOp::Le (
620 Token ! [ <= ](tokens_helper(_visitor, &(_binding_0).0)),
621 )
622 }
623 BinOp::Ne(_binding_0, ) => {
624 BinOp::Ne (
625 Token ! [ != ](tokens_helper(_visitor, &(_binding_0).0)),
626 )
627 }
628 BinOp::Ge(_binding_0, ) => {
629 BinOp::Ge (
630 Token ! [ >= ](tokens_helper(_visitor, &(_binding_0).0)),
631 )
632 }
633 BinOp::Gt(_binding_0, ) => {
634 BinOp::Gt (
635 Token ! [ > ](tokens_helper(_visitor, &(_binding_0).0)),
636 )
637 }
638 BinOp::AddEq(_binding_0, ) => {
639 BinOp::AddEq (
640 Token ! [ += ](tokens_helper(_visitor, &(_binding_0).0)),
641 )
642 }
643 BinOp::SubEq(_binding_0, ) => {
644 BinOp::SubEq (
645 Token ! [ -= ](tokens_helper(_visitor, &(_binding_0).0)),
646 )
647 }
648 BinOp::MulEq(_binding_0, ) => {
649 BinOp::MulEq (
650 Token ! [ *= ](tokens_helper(_visitor, &(_binding_0).0)),
651 )
652 }
653 BinOp::DivEq(_binding_0, ) => {
654 BinOp::DivEq (
655 Token ! [ /= ](tokens_helper(_visitor, &(_binding_0).0)),
656 )
657 }
658 BinOp::RemEq(_binding_0, ) => {
659 BinOp::RemEq (
660 Token ! [ %= ](tokens_helper(_visitor, &(_binding_0).0)),
661 )
662 }
663 BinOp::BitXorEq(_binding_0, ) => {
664 BinOp::BitXorEq (
665 Token ! [ ^= ](tokens_helper(_visitor, &(_binding_0).0)),
666 )
667 }
668 BinOp::BitAndEq(_binding_0, ) => {
669 BinOp::BitAndEq (
670 Token ! [ &= ](tokens_helper(_visitor, &(_binding_0).0)),
671 )
672 }
673 BinOp::BitOrEq(_binding_0, ) => {
674 BinOp::BitOrEq (
675 Token ! [ |= ](tokens_helper(_visitor, &(_binding_0).0)),
676 )
677 }
678 BinOp::ShlEq(_binding_0, ) => {
679 BinOp::ShlEq (
680 Token ! [ <<= ](tokens_helper(_visitor, &(_binding_0).0)),
681 )
682 }
683 BinOp::ShrEq(_binding_0, ) => {
684 BinOp::ShrEq (
685 Token ! [ >>= ](tokens_helper(_visitor, &(_binding_0).0)),
686 )
687 }
688 }
689 }
690 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
691 pub fn fold_binding<V: Fold + ?Sized>(_visitor: &mut V, _i: Binding) -> Binding {
692 Binding {
693 ident: _visitor.fold_ident(_i . ident),
694 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
695 ty: _visitor.fold_type(_i . ty),
696 }
697 }
698 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
699 pub fn fold_block<V: Fold + ?Sized>(_visitor: &mut V, _i: Block) -> Block {
700 Block {
701 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
702 stmts: FoldHelper::lift(_i . stmts, |it| { _visitor.fold_stmt(it) }),
703 }
704 }
705 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
706 pub fn fold_bound_lifetimes<V: Fold + ?Sized>(_visitor: &mut V, _i: BoundLifetimes) -> BoundLifetimes {
707 BoundLifetimes {
708 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
709 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
710 lifetimes: FoldHelper::lift(_i . lifetimes, |it| { _visitor.fold_lifetime_def(it) }),
711 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
712 }
713 }
714 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
715 pub fn fold_const_param<V: Fold + ?Sized>(_visitor: &mut V, _i: ConstParam) -> ConstParam {
716 ConstParam {
717 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
718 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
719 ident: _visitor.fold_ident(_i . ident),
720 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
721 ty: _visitor.fold_type(_i . ty),
722 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
723 default: (_i . default).map(|it| { _visitor.fold_expr(it) }),
724 }
725 }
726 # [ cfg ( feature = "derive" ) ]
727 pub fn fold_data<V: Fold + ?Sized>(_visitor: &mut V, _i: Data) -> Data {
728 match _i {
729 Data::Struct(_binding_0, ) => {
730 Data::Struct (
731 _visitor.fold_data_struct(_binding_0),
732 )
733 }
734 Data::Enum(_binding_0, ) => {
735 Data::Enum (
736 _visitor.fold_data_enum(_binding_0),
737 )
738 }
739 Data::Union(_binding_0, ) => {
740 Data::Union (
741 _visitor.fold_data_union(_binding_0),
742 )
743 }
744 }
745 }
746 # [ cfg ( feature = "derive" ) ]
747 pub fn fold_data_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: DataEnum) -> DataEnum {
748 DataEnum {
749 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
750 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
751 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
752 }
753 }
754 # [ cfg ( feature = "derive" ) ]
755 pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct {
756 DataStruct {
757 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
758 fields: _visitor.fold_fields(_i . fields),
759 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
760 }
761 }
762 # [ cfg ( feature = "derive" ) ]
763 pub fn fold_data_union<V: Fold + ?Sized>(_visitor: &mut V, _i: DataUnion) -> DataUnion {
764 DataUnion {
765 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
766 fields: _visitor.fold_fields_named(_i . fields),
767 }
768 }
769 # [ cfg ( feature = "derive" ) ]
770 pub fn fold_derive_input<V: Fold + ?Sized>(_visitor: &mut V, _i: DeriveInput) -> DeriveInput {
771 DeriveInput {
772 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
773 vis: _visitor.fold_visibility(_i . vis),
774 ident: _visitor.fold_ident(_i . ident),
775 generics: _visitor.fold_generics(_i . generics),
776 data: _visitor.fold_data(_i . data),
777 }
778 }
779 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
780 pub fn fold_expr<V: Fold + ?Sized>(_visitor: &mut V, _i: Expr) -> Expr {
781 match _i {
782 Expr::Box(_binding_0, ) => {
783 Expr::Box (
784 full!(_visitor.fold_expr_box(_binding_0)),
785 )
786 }
787 Expr::InPlace(_binding_0, ) => {
788 Expr::InPlace (
789 full!(_visitor.fold_expr_in_place(_binding_0)),
790 )
791 }
792 Expr::Array(_binding_0, ) => {
793 Expr::Array (
794 full!(_visitor.fold_expr_array(_binding_0)),
795 )
796 }
797 Expr::Call(_binding_0, ) => {
798 Expr::Call (
799 _visitor.fold_expr_call(_binding_0),
800 )
801 }
802 Expr::MethodCall(_binding_0, ) => {
803 Expr::MethodCall (
804 full!(_visitor.fold_expr_method_call(_binding_0)),
805 )
806 }
807 Expr::Tuple(_binding_0, ) => {
808 Expr::Tuple (
809 full!(_visitor.fold_expr_tuple(_binding_0)),
810 )
811 }
812 Expr::Binary(_binding_0, ) => {
813 Expr::Binary (
814 _visitor.fold_expr_binary(_binding_0),
815 )
816 }
817 Expr::Unary(_binding_0, ) => {
818 Expr::Unary (
819 _visitor.fold_expr_unary(_binding_0),
820 )
821 }
822 Expr::Lit(_binding_0, ) => {
823 Expr::Lit (
824 _visitor.fold_expr_lit(_binding_0),
825 )
826 }
827 Expr::Cast(_binding_0, ) => {
828 Expr::Cast (
829 _visitor.fold_expr_cast(_binding_0),
830 )
831 }
832 Expr::Type(_binding_0, ) => {
833 Expr::Type (
834 full!(_visitor.fold_expr_type(_binding_0)),
835 )
836 }
837 Expr::If(_binding_0, ) => {
838 Expr::If (
839 full!(_visitor.fold_expr_if(_binding_0)),
840 )
841 }
842 Expr::IfLet(_binding_0, ) => {
843 Expr::IfLet (
844 full!(_visitor.fold_expr_if_let(_binding_0)),
845 )
846 }
847 Expr::While(_binding_0, ) => {
848 Expr::While (
849 full!(_visitor.fold_expr_while(_binding_0)),
850 )
851 }
852 Expr::WhileLet(_binding_0, ) => {
853 Expr::WhileLet (
854 full!(_visitor.fold_expr_while_let(_binding_0)),
855 )
856 }
857 Expr::ForLoop(_binding_0, ) => {
858 Expr::ForLoop (
859 full!(_visitor.fold_expr_for_loop(_binding_0)),
860 )
861 }
862 Expr::Loop(_binding_0, ) => {
863 Expr::Loop (
864 full!(_visitor.fold_expr_loop(_binding_0)),
865 )
866 }
867 Expr::Match(_binding_0, ) => {
868 Expr::Match (
869 full!(_visitor.fold_expr_match(_binding_0)),
870 )
871 }
872 Expr::Closure(_binding_0, ) => {
873 Expr::Closure (
874 full!(_visitor.fold_expr_closure(_binding_0)),
875 )
876 }
877 Expr::Unsafe(_binding_0, ) => {
878 Expr::Unsafe (
879 full!(_visitor.fold_expr_unsafe(_binding_0)),
880 )
881 }
882 Expr::Block(_binding_0, ) => {
883 Expr::Block (
884 full!(_visitor.fold_expr_block(_binding_0)),
885 )
886 }
887 Expr::Assign(_binding_0, ) => {
888 Expr::Assign (
889 full!(_visitor.fold_expr_assign(_binding_0)),
890 )
891 }
892 Expr::AssignOp(_binding_0, ) => {
893 Expr::AssignOp (
894 full!(_visitor.fold_expr_assign_op(_binding_0)),
895 )
896 }
897 Expr::Field(_binding_0, ) => {
898 Expr::Field (
899 full!(_visitor.fold_expr_field(_binding_0)),
900 )
901 }
902 Expr::Index(_binding_0, ) => {
903 Expr::Index (
904 _visitor.fold_expr_index(_binding_0),
905 )
906 }
907 Expr::Range(_binding_0, ) => {
908 Expr::Range (
909 full!(_visitor.fold_expr_range(_binding_0)),
910 )
911 }
912 Expr::Path(_binding_0, ) => {
913 Expr::Path (
914 _visitor.fold_expr_path(_binding_0),
915 )
916 }
917 Expr::AddrOf(_binding_0, ) => {
918 Expr::AddrOf (
919 full!(_visitor.fold_expr_addr_of(_binding_0)),
920 )
921 }
922 Expr::Break(_binding_0, ) => {
923 Expr::Break (
924 full!(_visitor.fold_expr_break(_binding_0)),
925 )
926 }
927 Expr::Continue(_binding_0, ) => {
928 Expr::Continue (
929 full!(_visitor.fold_expr_continue(_binding_0)),
930 )
931 }
932 Expr::Return(_binding_0, ) => {
933 Expr::Return (
934 full!(_visitor.fold_expr_return(_binding_0)),
935 )
936 }
937 Expr::Macro(_binding_0, ) => {
938 Expr::Macro (
939 full!(_visitor.fold_expr_macro(_binding_0)),
940 )
941 }
942 Expr::Struct(_binding_0, ) => {
943 Expr::Struct (
944 full!(_visitor.fold_expr_struct(_binding_0)),
945 )
946 }
947 Expr::Repeat(_binding_0, ) => {
948 Expr::Repeat (
949 full!(_visitor.fold_expr_repeat(_binding_0)),
950 )
951 }
952 Expr::Paren(_binding_0, ) => {
953 Expr::Paren (
954 _visitor.fold_expr_paren(_binding_0),
955 )
956 }
957 Expr::Group(_binding_0, ) => {
958 Expr::Group (
959 full!(_visitor.fold_expr_group(_binding_0)),
960 )
961 }
962 Expr::Try(_binding_0, ) => {
963 Expr::Try (
964 full!(_visitor.fold_expr_try(_binding_0)),
965 )
966 }
967 Expr::Catch(_binding_0, ) => {
968 Expr::Catch (
969 full!(_visitor.fold_expr_catch(_binding_0)),
970 )
971 }
972 Expr::Yield(_binding_0, ) => {
973 Expr::Yield (
974 full!(_visitor.fold_expr_yield(_binding_0)),
975 )
976 }
977 Expr::Verbatim(_binding_0, ) => {
978 Expr::Verbatim (
979 _visitor.fold_expr_verbatim(_binding_0),
980 )
981 }
982 }
983 }
984 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
985 pub fn fold_expr_addr_of<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAddrOf) -> ExprAddrOf {
986 ExprAddrOf {
987 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
988 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
989 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
990 expr: Box::new(_visitor.fold_expr(* _i . expr)),
991 }
992 }
993 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
994 pub fn fold_expr_array<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprArray) -> ExprArray {
995 ExprArray {
996 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
997 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
998 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
999 }
1000 }
1001 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1002 pub fn fold_expr_assign<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssign) -> ExprAssign {
1003 ExprAssign {
1004 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1005 left: Box::new(_visitor.fold_expr(* _i . left)),
1006 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1007 right: Box::new(_visitor.fold_expr(* _i . right)),
1008 }
1009 }
1010 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1011 pub fn fold_expr_assign_op<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprAssignOp) -> ExprAssignOp {
1012 ExprAssignOp {
1013 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1014 left: Box::new(_visitor.fold_expr(* _i . left)),
1015 op: _visitor.fold_bin_op(_i . op),
1016 right: Box::new(_visitor.fold_expr(* _i . right)),
1017 }
1018 }
1019 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1020 pub fn fold_expr_binary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBinary) -> ExprBinary {
1021 ExprBinary {
1022 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1023 left: Box::new(_visitor.fold_expr(* _i . left)),
1024 op: _visitor.fold_bin_op(_i . op),
1025 right: Box::new(_visitor.fold_expr(* _i . right)),
1026 }
1027 }
1028 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1029 pub fn fold_expr_block<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBlock) -> ExprBlock {
1030 ExprBlock {
1031 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1032 block: _visitor.fold_block(_i . block),
1033 }
1034 }
1035 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1036 pub fn fold_expr_box<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBox) -> ExprBox {
1037 ExprBox {
1038 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1039 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
1040 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1041 }
1042 }
1043 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1044 pub fn fold_expr_break<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprBreak) -> ExprBreak {
1045 ExprBreak {
1046 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1047 break_token: Token ! [ break ](tokens_helper(_visitor, &(_i . break_token).0)),
1048 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1049 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1050 }
1051 }
1052 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1053 pub fn fold_expr_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCall) -> ExprCall {
1054 ExprCall {
1055 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1056 func: Box::new(_visitor.fold_expr(* _i . func)),
1057 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1058 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1059 }
1060 }
1061 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1062 pub fn fold_expr_cast<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCast) -> ExprCast {
1063 ExprCast {
1064 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1065 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1066 as_token: Token ! [ as ](tokens_helper(_visitor, &(_i . as_token).0)),
1067 ty: Box::new(_visitor.fold_type(* _i . ty)),
1068 }
1069 }
1070 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1071 pub fn fold_expr_catch<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprCatch) -> ExprCatch {
1072 ExprCatch {
1073 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1074 do_token: Token ! [ do ](tokens_helper(_visitor, &(_i . do_token).0)),
1075 catch_token: Token ! [ catch ](tokens_helper(_visitor, &(_i . catch_token).0)),
1076 block: _visitor.fold_block(_i . block),
1077 }
1078 }
1079 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1080 pub fn fold_expr_closure<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprClosure) -> ExprClosure {
1081 ExprClosure {
1082 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1083 capture: (_i . capture).map(|it| { Token ! [ move ](tokens_helper(_visitor, &(it).0)) }),
1084 or1_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or1_token).0)),
1085 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1086 or2_token: Token ! [ | ](tokens_helper(_visitor, &(_i . or2_token).0)),
1087 output: _visitor.fold_return_type(_i . output),
1088 body: Box::new(_visitor.fold_expr(* _i . body)),
1089 }
1090 }
1091 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1092 pub fn fold_expr_continue<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprContinue) -> ExprContinue {
1093 ExprContinue {
1094 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1095 continue_token: Token ! [ continue ](tokens_helper(_visitor, &(_i . continue_token).0)),
1096 label: (_i . label).map(|it| { _visitor.fold_lifetime(it) }),
1097 }
1098 }
1099 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1100 pub fn fold_expr_field<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprField) -> ExprField {
1101 ExprField {
1102 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1103 base: Box::new(_visitor.fold_expr(* _i . base)),
1104 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1105 member: _visitor.fold_member(_i . member),
1106 }
1107 }
1108 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1109 pub fn fold_expr_for_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprForLoop) -> ExprForLoop {
1110 ExprForLoop {
1111 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1112 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
1113 for_token: Token ! [ for ](tokens_helper(_visitor, &(_i . for_token).0)),
1114 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1115 in_token: Token ! [ in ](tokens_helper(_visitor, &(_i . in_token).0)),
1116 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1117 body: _visitor.fold_block(_i . body),
1118 }
1119 }
1120 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1121 pub fn fold_expr_group<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprGroup) -> ExprGroup {
1122 ExprGroup {
1123 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1124 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
1125 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1126 }
1127 }
1128 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1129 pub fn fold_expr_if<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIf) -> ExprIf {
1130 ExprIf {
1131 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1132 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1133 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1134 then_branch: _visitor.fold_block(_i . then_branch),
1135 else_branch: (_i . else_branch).map(|it| { (
1136 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1137 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1138 ) }),
1139 }
1140 }
1141 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1142 pub fn fold_expr_if_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIfLet) -> ExprIfLet {
1143 ExprIfLet {
1144 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1145 if_token: Token ! [ if ](tokens_helper(_visitor, &(_i . if_token).0)),
1146 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1147 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1148 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1149 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1150 then_branch: _visitor.fold_block(_i . then_branch),
1151 else_branch: (_i . else_branch).map(|it| { (
1152 Token ! [ else ](tokens_helper(_visitor, &(( it ) . 0).0)),
1153 Box::new(_visitor.fold_expr(* ( it ) . 1)),
1154 ) }),
1155 }
1156 }
1157 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1158 pub fn fold_expr_in_place<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprInPlace) -> ExprInPlace {
1159 ExprInPlace {
1160 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1161 place: Box::new(_visitor.fold_expr(* _i . place)),
1162 arrow_token: Token ! [ <- ](tokens_helper(_visitor, &(_i . arrow_token).0)),
1163 value: Box::new(_visitor.fold_expr(* _i . value)),
1164 }
1165 }
1166 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1167 pub fn fold_expr_index<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprIndex) -> ExprIndex {
1168 ExprIndex {
1169 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1170 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1171 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1172 index: Box::new(_visitor.fold_expr(* _i . index)),
1173 }
1174 }
1175 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1176 pub fn fold_expr_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLit) -> ExprLit {
1177 ExprLit {
1178 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1179 lit: _visitor.fold_lit(_i . lit),
1180 }
1181 }
1182 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1183 pub fn fold_expr_loop<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprLoop) -> ExprLoop {
1184 ExprLoop {
1185 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1186 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
1187 loop_token: Token ! [ loop ](tokens_helper(_visitor, &(_i . loop_token).0)),
1188 body: _visitor.fold_block(_i . body),
1189 }
1190 }
1191 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1192 pub fn fold_expr_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMacro) -> ExprMacro {
1193 ExprMacro {
1194 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1195 mac: _visitor.fold_macro(_i . mac),
1196 }
1197 }
1198 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1199 pub fn fold_expr_match<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMatch) -> ExprMatch {
1200 ExprMatch {
1201 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1202 match_token: Token ! [ match ](tokens_helper(_visitor, &(_i . match_token).0)),
1203 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1204 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1205 arms: FoldHelper::lift(_i . arms, |it| { _visitor.fold_arm(it) }),
1206 }
1207 }
1208 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1209 pub fn fold_expr_method_call<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprMethodCall) -> ExprMethodCall {
1210 ExprMethodCall {
1211 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1212 receiver: Box::new(_visitor.fold_expr(* _i . receiver)),
1213 dot_token: Token ! [ . ](tokens_helper(_visitor, &(_i . dot_token).0)),
1214 method: _visitor.fold_ident(_i . method),
1215 turbofish: (_i . turbofish).map(|it| { _visitor.fold_method_turbofish(it) }),
1216 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1217 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_expr(it) }),
1218 }
1219 }
1220 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1221 pub fn fold_expr_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprParen) -> ExprParen {
1222 ExprParen {
1223 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1224 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1225 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1226 }
1227 }
1228 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1229 pub fn fold_expr_path<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprPath) -> ExprPath {
1230 ExprPath {
1231 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1232 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
1233 path: _visitor.fold_path(_i . path),
1234 }
1235 }
1236 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1237 pub fn fold_expr_range<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRange) -> ExprRange {
1238 ExprRange {
1239 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1240 from: (_i . from).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1241 limits: _visitor.fold_range_limits(_i . limits),
1242 to: (_i . to).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1243 }
1244 }
1245 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1246 pub fn fold_expr_repeat<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprRepeat) -> ExprRepeat {
1247 ExprRepeat {
1248 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1249 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
1250 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1251 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1252 len: Box::new(_visitor.fold_expr(* _i . len)),
1253 }
1254 }
1255 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1256 pub fn fold_expr_return<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprReturn) -> ExprReturn {
1257 ExprReturn {
1258 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1259 return_token: Token ! [ return ](tokens_helper(_visitor, &(_i . return_token).0)),
1260 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1261 }
1262 }
1263 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1264 pub fn fold_expr_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprStruct) -> ExprStruct {
1265 ExprStruct {
1266 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1267 path: _visitor.fold_path(_i . path),
1268 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1269 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_value(it) }),
1270 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
1271 rest: (_i . rest).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1272 }
1273 }
1274 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1275 pub fn fold_expr_try<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTry) -> ExprTry {
1276 ExprTry {
1277 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1278 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1279 question_token: Token ! [ ? ](tokens_helper(_visitor, &(_i . question_token).0)),
1280 }
1281 }
1282 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1283 pub fn fold_expr_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprTuple) -> ExprTuple {
1284 ExprTuple {
1285 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1286 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1287 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_expr(it) }),
1288 }
1289 }
1290 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1291 pub fn fold_expr_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprType) -> ExprType {
1292 ExprType {
1293 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1294 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1295 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1296 ty: Box::new(_visitor.fold_type(* _i . ty)),
1297 }
1298 }
1299 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1300 pub fn fold_expr_unary<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnary) -> ExprUnary {
1301 ExprUnary {
1302 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1303 op: _visitor.fold_un_op(_i . op),
1304 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1305 }
1306 }
1307 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1308 pub fn fold_expr_unsafe<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprUnsafe) -> ExprUnsafe {
1309 ExprUnsafe {
1310 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1311 unsafe_token: Token ! [ unsafe ](tokens_helper(_visitor, &(_i . unsafe_token).0)),
1312 block: _visitor.fold_block(_i . block),
1313 }
1314 }
1315 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1316 pub fn fold_expr_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprVerbatim) -> ExprVerbatim {
1317 ExprVerbatim {
1318 tts: _i . tts,
1319 }
1320 }
1321 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1322 pub fn fold_expr_while<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhile) -> ExprWhile {
1323 ExprWhile {
1324 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1325 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
1326 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1327 cond: Box::new(_visitor.fold_expr(* _i . cond)),
1328 body: _visitor.fold_block(_i . body),
1329 }
1330 }
1331 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1332 pub fn fold_expr_while_let<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprWhileLet) -> ExprWhileLet {
1333 ExprWhileLet {
1334 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1335 label: (_i . label).map(|it| { _visitor.fold_label(it) }),
1336 while_token: Token ! [ while ](tokens_helper(_visitor, &(_i . while_token).0)),
1337 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
1338 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1339 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1340 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1341 body: _visitor.fold_block(_i . body),
1342 }
1343 }
1344 # [ cfg ( feature = "full" ) ] # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1345 pub fn fold_expr_yield<V: Fold + ?Sized>(_visitor: &mut V, _i: ExprYield) -> ExprYield {
1346 ExprYield {
1347 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1348 yield_token: Token ! [ yield ](tokens_helper(_visitor, &(_i . yield_token).0)),
1349 expr: (_i . expr).map(|it| { Box::new(_visitor.fold_expr(* it)) }),
1350 }
1351 }
1352 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1353 pub fn fold_field<V: Fold + ?Sized>(_visitor: &mut V, _i: Field) -> Field {
1354 Field {
1355 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1356 vis: _visitor.fold_visibility(_i . vis),
1357 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
1358 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1359 ty: _visitor.fold_type(_i . ty),
1360 }
1361 }
1362 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
1363 pub fn fold_field_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldPat) -> FieldPat {
1364 FieldPat {
1365 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1366 member: _visitor.fold_member(_i . member),
1367 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1368 pat: Box::new(_visitor.fold_pat(* _i . pat)),
1369 }
1370 }
1371 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
1372 pub fn fold_field_value<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldValue) -> FieldValue {
1373 FieldValue {
1374 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1375 member: _visitor.fold_member(_i . member),
1376 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1377 expr: _visitor.fold_expr(_i . expr),
1378 }
1379 }
1380 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1381 pub fn fold_fields<V: Fold + ?Sized>(_visitor: &mut V, _i: Fields) -> Fields {
1382 match _i {
1383 Fields::Named(_binding_0, ) => {
1384 Fields::Named (
1385 _visitor.fold_fields_named(_binding_0),
1386 )
1387 }
1388 Fields::Unnamed(_binding_0, ) => {
1389 Fields::Unnamed (
1390 _visitor.fold_fields_unnamed(_binding_0),
1391 )
1392 }
1393 Fields::Unit => { Fields::Unit }
1394 }
1395 }
1396 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1397 pub fn fold_fields_named<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsNamed) -> FieldsNamed {
1398 FieldsNamed {
1399 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1400 named: FoldHelper::lift(_i . named, |it| { _visitor.fold_field(it) }),
1401 }
1402 }
1403 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1404 pub fn fold_fields_unnamed<V: Fold + ?Sized>(_visitor: &mut V, _i: FieldsUnnamed) -> FieldsUnnamed {
1405 FieldsUnnamed {
1406 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1407 unnamed: FoldHelper::lift(_i . unnamed, |it| { _visitor.fold_field(it) }),
1408 }
1409 }
1410 # [ cfg ( feature = "full" ) ]
1411 pub fn fold_file<V: Fold + ?Sized>(_visitor: &mut V, _i: File) -> File {
1412 File {
1413 shebang: _i . shebang,
1414 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1415 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_item(it) }),
1416 }
1417 }
1418 # [ cfg ( feature = "full" ) ]
1419 pub fn fold_fn_arg<V: Fold + ?Sized>(_visitor: &mut V, _i: FnArg) -> FnArg {
1420 match _i {
1421 FnArg::SelfRef(_binding_0, ) => {
1422 FnArg::SelfRef (
1423 _visitor.fold_arg_self_ref(_binding_0),
1424 )
1425 }
1426 FnArg::SelfValue(_binding_0, ) => {
1427 FnArg::SelfValue (
1428 _visitor.fold_arg_self(_binding_0),
1429 )
1430 }
1431 FnArg::Captured(_binding_0, ) => {
1432 FnArg::Captured (
1433 _visitor.fold_arg_captured(_binding_0),
1434 )
1435 }
1436 FnArg::Inferred(_binding_0, ) => {
1437 FnArg::Inferred (
1438 _visitor.fold_pat(_binding_0),
1439 )
1440 }
1441 FnArg::Ignored(_binding_0, ) => {
1442 FnArg::Ignored (
1443 _visitor.fold_type(_binding_0),
1444 )
1445 }
1446 }
1447 }
1448 # [ cfg ( feature = "full" ) ]
1449 pub fn fold_fn_decl<V: Fold + ?Sized>(_visitor: &mut V, _i: FnDecl) -> FnDecl {
1450 FnDecl {
1451 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
1452 generics: _visitor.fold_generics(_i . generics),
1453 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1454 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_fn_arg(it) }),
1455 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
1456 output: _visitor.fold_return_type(_i . output),
1457 }
1458 }
1459 # [ cfg ( feature = "full" ) ]
1460 pub fn fold_foreign_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItem) -> ForeignItem {
1461 match _i {
1462 ForeignItem::Fn(_binding_0, ) => {
1463 ForeignItem::Fn (
1464 _visitor.fold_foreign_item_fn(_binding_0),
1465 )
1466 }
1467 ForeignItem::Static(_binding_0, ) => {
1468 ForeignItem::Static (
1469 _visitor.fold_foreign_item_static(_binding_0),
1470 )
1471 }
1472 ForeignItem::Type(_binding_0, ) => {
1473 ForeignItem::Type (
1474 _visitor.fold_foreign_item_type(_binding_0),
1475 )
1476 }
1477 ForeignItem::Verbatim(_binding_0, ) => {
1478 ForeignItem::Verbatim (
1479 _visitor.fold_foreign_item_verbatim(_binding_0),
1480 )
1481 }
1482 }
1483 }
1484 # [ cfg ( feature = "full" ) ]
1485 pub fn fold_foreign_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemFn) -> ForeignItemFn {
1486 ForeignItemFn {
1487 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1488 vis: _visitor.fold_visibility(_i . vis),
1489 ident: _visitor.fold_ident(_i . ident),
1490 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1491 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1492 }
1493 }
1494 # [ cfg ( feature = "full" ) ]
1495 pub fn fold_foreign_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemStatic) -> ForeignItemStatic {
1496 ForeignItemStatic {
1497 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1498 vis: _visitor.fold_visibility(_i . vis),
1499 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
1500 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1501 ident: _visitor.fold_ident(_i . ident),
1502 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1503 ty: Box::new(_visitor.fold_type(* _i . ty)),
1504 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1505 }
1506 }
1507 # [ cfg ( feature = "full" ) ]
1508 pub fn fold_foreign_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemType) -> ForeignItemType {
1509 ForeignItemType {
1510 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1511 vis: _visitor.fold_visibility(_i . vis),
1512 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
1513 ident: _visitor.fold_ident(_i . ident),
1514 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1515 }
1516 }
1517 # [ cfg ( feature = "full" ) ]
1518 pub fn fold_foreign_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ForeignItemVerbatim) -> ForeignItemVerbatim {
1519 ForeignItemVerbatim {
1520 tts: _i . tts,
1521 }
1522 }
1523 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1524 pub fn fold_generic_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericArgument) -> GenericArgument {
1525 match _i {
1526 GenericArgument::Lifetime(_binding_0, ) => {
1527 GenericArgument::Lifetime (
1528 _visitor.fold_lifetime(_binding_0),
1529 )
1530 }
1531 GenericArgument::Type(_binding_0, ) => {
1532 GenericArgument::Type (
1533 _visitor.fold_type(_binding_0),
1534 )
1535 }
1536 GenericArgument::Binding(_binding_0, ) => {
1537 GenericArgument::Binding (
1538 _visitor.fold_binding(_binding_0),
1539 )
1540 }
1541 GenericArgument::Const(_binding_0, ) => {
1542 GenericArgument::Const (
1543 _visitor.fold_expr(_binding_0),
1544 )
1545 }
1546 }
1547 }
1548 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
1549 pub fn fold_generic_method_argument<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericMethodArgument) -> GenericMethodArgument {
1550 match _i {
1551 GenericMethodArgument::Type(_binding_0, ) => {
1552 GenericMethodArgument::Type (
1553 _visitor.fold_type(_binding_0),
1554 )
1555 }
1556 GenericMethodArgument::Const(_binding_0, ) => {
1557 GenericMethodArgument::Const (
1558 _visitor.fold_expr(_binding_0),
1559 )
1560 }
1561 }
1562 }
1563 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1564 pub fn fold_generic_param<V: Fold + ?Sized>(_visitor: &mut V, _i: GenericParam) -> GenericParam {
1565 match _i {
1566 GenericParam::Type(_binding_0, ) => {
1567 GenericParam::Type (
1568 _visitor.fold_type_param(_binding_0),
1569 )
1570 }
1571 GenericParam::Lifetime(_binding_0, ) => {
1572 GenericParam::Lifetime (
1573 _visitor.fold_lifetime_def(_binding_0),
1574 )
1575 }
1576 GenericParam::Const(_binding_0, ) => {
1577 GenericParam::Const (
1578 _visitor.fold_const_param(_binding_0),
1579 )
1580 }
1581 }
1582 }
1583 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1584 pub fn fold_generics<V: Fold + ?Sized>(_visitor: &mut V, _i: Generics) -> Generics {
1585 Generics {
1586 lt_token: (_i . lt_token).map(|it| { Token ! [ < ](tokens_helper(_visitor, &(it).0)) }),
1587 params: FoldHelper::lift(_i . params, |it| { _visitor.fold_generic_param(it) }),
1588 gt_token: (_i . gt_token).map(|it| { Token ! [ > ](tokens_helper(_visitor, &(it).0)) }),
1589 where_clause: (_i . where_clause).map(|it| { _visitor.fold_where_clause(it) }),
1590 }
1591 }
1592 # [ cfg ( feature = "full" ) ]
1593 pub fn fold_impl_item<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItem) -> ImplItem {
1594 match _i {
1595 ImplItem::Const(_binding_0, ) => {
1596 ImplItem::Const (
1597 _visitor.fold_impl_item_const(_binding_0),
1598 )
1599 }
1600 ImplItem::Method(_binding_0, ) => {
1601 ImplItem::Method (
1602 _visitor.fold_impl_item_method(_binding_0),
1603 )
1604 }
1605 ImplItem::Type(_binding_0, ) => {
1606 ImplItem::Type (
1607 _visitor.fold_impl_item_type(_binding_0),
1608 )
1609 }
1610 ImplItem::Macro(_binding_0, ) => {
1611 ImplItem::Macro (
1612 _visitor.fold_impl_item_macro(_binding_0),
1613 )
1614 }
1615 ImplItem::Verbatim(_binding_0, ) => {
1616 ImplItem::Verbatim (
1617 _visitor.fold_impl_item_verbatim(_binding_0),
1618 )
1619 }
1620 }
1621 }
1622 # [ cfg ( feature = "full" ) ]
1623 pub fn fold_impl_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemConst) -> ImplItemConst {
1624 ImplItemConst {
1625 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1626 vis: _visitor.fold_visibility(_i . vis),
1627 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
1628 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
1629 ident: _visitor.fold_ident(_i . ident),
1630 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1631 ty: _visitor.fold_type(_i . ty),
1632 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1633 expr: _visitor.fold_expr(_i . expr),
1634 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1635 }
1636 }
1637 # [ cfg ( feature = "full" ) ]
1638 pub fn fold_impl_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMacro) -> ImplItemMacro {
1639 ImplItemMacro {
1640 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1641 mac: _visitor.fold_macro(_i . mac),
1642 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
1643 }
1644 }
1645 # [ cfg ( feature = "full" ) ]
1646 pub fn fold_impl_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemMethod) -> ImplItemMethod {
1647 ImplItemMethod {
1648 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1649 vis: _visitor.fold_visibility(_i . vis),
1650 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
1651 sig: _visitor.fold_method_sig(_i . sig),
1652 block: _visitor.fold_block(_i . block),
1653 }
1654 }
1655 # [ cfg ( feature = "full" ) ]
1656 pub fn fold_impl_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemType) -> ImplItemType {
1657 ImplItemType {
1658 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1659 vis: _visitor.fold_visibility(_i . vis),
1660 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
1661 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
1662 ident: _visitor.fold_ident(_i . ident),
1663 generics: _visitor.fold_generics(_i . generics),
1664 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1665 ty: _visitor.fold_type(_i . ty),
1666 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1667 }
1668 }
1669 # [ cfg ( feature = "full" ) ]
1670 pub fn fold_impl_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ImplItemVerbatim) -> ImplItemVerbatim {
1671 ImplItemVerbatim {
1672 tts: _i . tts,
1673 }
1674 }
1675 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1676 pub fn fold_index<V: Fold + ?Sized>(_visitor: &mut V, _i: Index) -> Index {
1677 Index {
1678 index: _i . index,
1679 span: _visitor.fold_span(_i . span),
1680 }
1681 }
1682 # [ cfg ( feature = "full" ) ]
1683 pub fn fold_item<V: Fold + ?Sized>(_visitor: &mut V, _i: Item) -> Item {
1684 match _i {
1685 Item::ExternCrate(_binding_0, ) => {
1686 Item::ExternCrate (
1687 _visitor.fold_item_extern_crate(_binding_0),
1688 )
1689 }
1690 Item::Use(_binding_0, ) => {
1691 Item::Use (
1692 _visitor.fold_item_use(_binding_0),
1693 )
1694 }
1695 Item::Static(_binding_0, ) => {
1696 Item::Static (
1697 _visitor.fold_item_static(_binding_0),
1698 )
1699 }
1700 Item::Const(_binding_0, ) => {
1701 Item::Const (
1702 _visitor.fold_item_const(_binding_0),
1703 )
1704 }
1705 Item::Fn(_binding_0, ) => {
1706 Item::Fn (
1707 _visitor.fold_item_fn(_binding_0),
1708 )
1709 }
1710 Item::Mod(_binding_0, ) => {
1711 Item::Mod (
1712 _visitor.fold_item_mod(_binding_0),
1713 )
1714 }
1715 Item::ForeignMod(_binding_0, ) => {
1716 Item::ForeignMod (
1717 _visitor.fold_item_foreign_mod(_binding_0),
1718 )
1719 }
1720 Item::Type(_binding_0, ) => {
1721 Item::Type (
1722 _visitor.fold_item_type(_binding_0),
1723 )
1724 }
1725 Item::Struct(_binding_0, ) => {
1726 Item::Struct (
1727 _visitor.fold_item_struct(_binding_0),
1728 )
1729 }
1730 Item::Enum(_binding_0, ) => {
1731 Item::Enum (
1732 _visitor.fold_item_enum(_binding_0),
1733 )
1734 }
1735 Item::Union(_binding_0, ) => {
1736 Item::Union (
1737 _visitor.fold_item_union(_binding_0),
1738 )
1739 }
1740 Item::Trait(_binding_0, ) => {
1741 Item::Trait (
1742 _visitor.fold_item_trait(_binding_0),
1743 )
1744 }
1745 Item::Impl(_binding_0, ) => {
1746 Item::Impl (
1747 _visitor.fold_item_impl(_binding_0),
1748 )
1749 }
1750 Item::Macro(_binding_0, ) => {
1751 Item::Macro (
1752 _visitor.fold_item_macro(_binding_0),
1753 )
1754 }
1755 Item::Macro2(_binding_0, ) => {
1756 Item::Macro2 (
1757 _visitor.fold_item_macro2(_binding_0),
1758 )
1759 }
1760 Item::Verbatim(_binding_0, ) => {
1761 Item::Verbatim (
1762 _visitor.fold_item_verbatim(_binding_0),
1763 )
1764 }
1765 }
1766 }
1767 # [ cfg ( feature = "full" ) ]
1768 pub fn fold_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemConst) -> ItemConst {
1769 ItemConst {
1770 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1771 vis: _visitor.fold_visibility(_i . vis),
1772 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
1773 ident: _visitor.fold_ident(_i . ident),
1774 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1775 ty: Box::new(_visitor.fold_type(* _i . ty)),
1776 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1777 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1778 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1779 }
1780 }
1781 # [ cfg ( feature = "full" ) ]
1782 pub fn fold_item_enum<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemEnum) -> ItemEnum {
1783 ItemEnum {
1784 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1785 vis: _visitor.fold_visibility(_i . vis),
1786 enum_token: Token ! [ enum ](tokens_helper(_visitor, &(_i . enum_token).0)),
1787 ident: _visitor.fold_ident(_i . ident),
1788 generics: _visitor.fold_generics(_i . generics),
1789 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1790 variants: FoldHelper::lift(_i . variants, |it| { _visitor.fold_variant(it) }),
1791 }
1792 }
1793 # [ cfg ( feature = "full" ) ]
1794 pub fn fold_item_extern_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemExternCrate) -> ItemExternCrate {
1795 ItemExternCrate {
1796 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1797 vis: _visitor.fold_visibility(_i . vis),
1798 extern_token: Token ! [ extern ](tokens_helper(_visitor, &(_i . extern_token).0)),
1799 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
1800 ident: _visitor.fold_ident(_i . ident),
1801 rename: (_i . rename).map(|it| { (
1802 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
1803 _visitor.fold_ident(( it ) . 1),
1804 ) }),
1805 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1806 }
1807 }
1808 # [ cfg ( feature = "full" ) ]
1809 pub fn fold_item_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemFn) -> ItemFn {
1810 ItemFn {
1811 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1812 vis: _visitor.fold_visibility(_i . vis),
1813 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
1814 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
1815 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
1816 ident: _visitor.fold_ident(_i . ident),
1817 decl: Box::new(_visitor.fold_fn_decl(* _i . decl)),
1818 block: Box::new(_visitor.fold_block(* _i . block)),
1819 }
1820 }
1821 # [ cfg ( feature = "full" ) ]
1822 pub fn fold_item_foreign_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemForeignMod) -> ItemForeignMod {
1823 ItemForeignMod {
1824 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1825 abi: _visitor.fold_abi(_i . abi),
1826 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1827 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_foreign_item(it) }),
1828 }
1829 }
1830 # [ cfg ( feature = "full" ) ]
1831 pub fn fold_item_impl<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemImpl) -> ItemImpl {
1832 ItemImpl {
1833 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1834 defaultness: (_i . defaultness).map(|it| { Token ! [ default ](tokens_helper(_visitor, &(it).0)) }),
1835 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
1836 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
1837 generics: _visitor.fold_generics(_i . generics),
1838 trait_: (_i . trait_).map(|it| { (
1839 (( it ) . 0).map(|it| { Token ! [ ! ](tokens_helper(_visitor, &(it).0)) }),
1840 _visitor.fold_path(( it ) . 1),
1841 Token ! [ for ](tokens_helper(_visitor, &(( it ) . 2).0)),
1842 ) }),
1843 self_ty: Box::new(_visitor.fold_type(* _i . self_ty)),
1844 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1845 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_impl_item(it) }),
1846 }
1847 }
1848 # [ cfg ( feature = "full" ) ]
1849 pub fn fold_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro) -> ItemMacro {
1850 ItemMacro {
1851 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1852 ident: (_i . ident).map(|it| { _visitor.fold_ident(it) }),
1853 mac: _visitor.fold_macro(_i . mac),
1854 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
1855 }
1856 }
1857 # [ cfg ( feature = "full" ) ]
1858 pub fn fold_item_macro2<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMacro2) -> ItemMacro2 {
1859 ItemMacro2 {
1860 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1861 vis: _visitor.fold_visibility(_i . vis),
1862 macro_token: Token ! [ macro ](tokens_helper(_visitor, &(_i . macro_token).0)),
1863 ident: _visitor.fold_ident(_i . ident),
1864 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
1865 args: _i . args,
1866 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1867 body: _i . body,
1868 }
1869 }
1870 # [ cfg ( feature = "full" ) ]
1871 pub fn fold_item_mod<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemMod) -> ItemMod {
1872 ItemMod {
1873 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1874 vis: _visitor.fold_visibility(_i . vis),
1875 mod_token: Token ! [ mod ](tokens_helper(_visitor, &(_i . mod_token).0)),
1876 ident: _visitor.fold_ident(_i . ident),
1877 content: (_i . content).map(|it| { (
1878 Brace(tokens_helper(_visitor, &(( it ) . 0).0)),
1879 FoldHelper::lift(( it ) . 1, |it| { _visitor.fold_item(it) }),
1880 ) }),
1881 semi: (_i . semi).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
1882 }
1883 }
1884 # [ cfg ( feature = "full" ) ]
1885 pub fn fold_item_static<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStatic) -> ItemStatic {
1886 ItemStatic {
1887 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1888 vis: _visitor.fold_visibility(_i . vis),
1889 static_token: Token ! [ static ](tokens_helper(_visitor, &(_i . static_token).0)),
1890 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
1891 ident: _visitor.fold_ident(_i . ident),
1892 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1893 ty: Box::new(_visitor.fold_type(* _i . ty)),
1894 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1895 expr: Box::new(_visitor.fold_expr(* _i . expr)),
1896 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1897 }
1898 }
1899 # [ cfg ( feature = "full" ) ]
1900 pub fn fold_item_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemStruct) -> ItemStruct {
1901 ItemStruct {
1902 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1903 vis: _visitor.fold_visibility(_i . vis),
1904 struct_token: Token ! [ struct ](tokens_helper(_visitor, &(_i . struct_token).0)),
1905 ident: _visitor.fold_ident(_i . ident),
1906 generics: _visitor.fold_generics(_i . generics),
1907 fields: _visitor.fold_fields(_i . fields),
1908 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
1909 }
1910 }
1911 # [ cfg ( feature = "full" ) ]
1912 pub fn fold_item_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemTrait) -> ItemTrait {
1913 ItemTrait {
1914 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1915 vis: _visitor.fold_visibility(_i . vis),
1916 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
1917 auto_token: (_i . auto_token).map(|it| { Token ! [ auto ](tokens_helper(_visitor, &(it).0)) }),
1918 trait_token: Token ! [ trait ](tokens_helper(_visitor, &(_i . trait_token).0)),
1919 ident: _visitor.fold_ident(_i . ident),
1920 generics: _visitor.fold_generics(_i . generics),
1921 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1922 supertraits: FoldHelper::lift(_i . supertraits, |it| { _visitor.fold_type_param_bound(it) }),
1923 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
1924 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_trait_item(it) }),
1925 }
1926 }
1927 # [ cfg ( feature = "full" ) ]
1928 pub fn fold_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemType) -> ItemType {
1929 ItemType {
1930 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1931 vis: _visitor.fold_visibility(_i . vis),
1932 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
1933 ident: _visitor.fold_ident(_i . ident),
1934 generics: _visitor.fold_generics(_i . generics),
1935 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
1936 ty: Box::new(_visitor.fold_type(* _i . ty)),
1937 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1938 }
1939 }
1940 # [ cfg ( feature = "full" ) ]
1941 pub fn fold_item_union<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUnion) -> ItemUnion {
1942 ItemUnion {
1943 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1944 vis: _visitor.fold_visibility(_i . vis),
1945 union_token: Token ! [ union ](tokens_helper(_visitor, &(_i . union_token).0)),
1946 ident: _visitor.fold_ident(_i . ident),
1947 generics: _visitor.fold_generics(_i . generics),
1948 fields: _visitor.fold_fields_named(_i . fields),
1949 }
1950 }
1951 # [ cfg ( feature = "full" ) ]
1952 pub fn fold_item_use<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemUse) -> ItemUse {
1953 ItemUse {
1954 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1955 vis: _visitor.fold_visibility(_i . vis),
1956 use_token: Token ! [ use ](tokens_helper(_visitor, &(_i . use_token).0)),
1957 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
1958 prefix: FoldHelper::lift(_i . prefix, |it| { _visitor.fold_ident(it) }),
1959 tree: _visitor.fold_use_tree(_i . tree),
1960 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
1961 }
1962 }
1963 # [ cfg ( feature = "full" ) ]
1964 pub fn fold_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: ItemVerbatim) -> ItemVerbatim {
1965 ItemVerbatim {
1966 tts: _i . tts,
1967 }
1968 }
1969 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
1970 pub fn fold_label<V: Fold + ?Sized>(_visitor: &mut V, _i: Label) -> Label {
1971 Label {
1972 name: _visitor.fold_lifetime(_i . name),
1973 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
1974 }
1975 }
1976 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1977 pub fn fold_lifetime_def<V: Fold + ?Sized>(_visitor: &mut V, _i: LifetimeDef) -> LifetimeDef {
1978 LifetimeDef {
1979 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
1980 lifetime: _visitor.fold_lifetime(_i . lifetime),
1981 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
1982 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
1983 }
1984 }
1985 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
1986 pub fn fold_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: Lit) -> Lit {
1987 match _i {
1988 Lit::Str(_binding_0, ) => {
1989 Lit::Str (
1990 _visitor.fold_lit_str(_binding_0),
1991 )
1992 }
1993 Lit::ByteStr(_binding_0, ) => {
1994 Lit::ByteStr (
1995 _visitor.fold_lit_byte_str(_binding_0),
1996 )
1997 }
1998 Lit::Byte(_binding_0, ) => {
1999 Lit::Byte (
2000 _visitor.fold_lit_byte(_binding_0),
2001 )
2002 }
2003 Lit::Char(_binding_0, ) => {
2004 Lit::Char (
2005 _visitor.fold_lit_char(_binding_0),
2006 )
2007 }
2008 Lit::Int(_binding_0, ) => {
2009 Lit::Int (
2010 _visitor.fold_lit_int(_binding_0),
2011 )
2012 }
2013 Lit::Float(_binding_0, ) => {
2014 Lit::Float (
2015 _visitor.fold_lit_float(_binding_0),
2016 )
2017 }
2018 Lit::Bool(_binding_0, ) => {
2019 Lit::Bool (
2020 _visitor.fold_lit_bool(_binding_0),
2021 )
2022 }
2023 Lit::Verbatim(_binding_0, ) => {
2024 Lit::Verbatim (
2025 _visitor.fold_lit_verbatim(_binding_0),
2026 )
2027 }
2028 }
2029 }
2030 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2031 pub fn fold_lit_bool<V: Fold + ?Sized>(_visitor: &mut V, _i: LitBool) -> LitBool {
2032 LitBool {
2033 value: _i . value,
2034 span: _visitor.fold_span(_i . span),
2035 }
2036 }
2037 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2038 pub fn fold_lit_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: LitVerbatim) -> LitVerbatim {
2039 LitVerbatim {
2040 token: _i . token,
2041 span: _visitor.fold_span(_i . span),
2042 }
2043 }
2044 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2045 pub fn fold_local<V: Fold + ?Sized>(_visitor: &mut V, _i: Local) -> Local {
2046 Local {
2047 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2048 let_token: Token ! [ let ](tokens_helper(_visitor, &(_i . let_token).0)),
2049 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2050 ty: (_i . ty).map(|it| { (
2051 Token ! [ : ](tokens_helper(_visitor, &(( it ) . 0).0)),
2052 Box::new(_visitor.fold_type(* ( it ) . 1)),
2053 ) }),
2054 init: (_i . init).map(|it| { (
2055 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2056 Box::new(_visitor.fold_expr(* ( it ) . 1)),
2057 ) }),
2058 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
2059 }
2060 }
2061 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2062 pub fn fold_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: Macro) -> Macro {
2063 Macro {
2064 path: _visitor.fold_path(_i . path),
2065 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
2066 delimiter: _visitor.fold_macro_delimiter(_i . delimiter),
2067 tts: _i . tts,
2068 }
2069 }
2070 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2071 pub fn fold_macro_delimiter<V: Fold + ?Sized>(_visitor: &mut V, _i: MacroDelimiter) -> MacroDelimiter {
2072 match _i {
2073 MacroDelimiter::Paren(_binding_0, ) => {
2074 MacroDelimiter::Paren (
2075 Paren(tokens_helper(_visitor, &(_binding_0).0)),
2076 )
2077 }
2078 MacroDelimiter::Brace(_binding_0, ) => {
2079 MacroDelimiter::Brace (
2080 Brace(tokens_helper(_visitor, &(_binding_0).0)),
2081 )
2082 }
2083 MacroDelimiter::Bracket(_binding_0, ) => {
2084 MacroDelimiter::Bracket (
2085 Bracket(tokens_helper(_visitor, &(_binding_0).0)),
2086 )
2087 }
2088 }
2089 }
2090 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2091 pub fn fold_member<V: Fold + ?Sized>(_visitor: &mut V, _i: Member) -> Member {
2092 match _i {
2093 Member::Named(_binding_0, ) => {
2094 Member::Named (
2095 _visitor.fold_ident(_binding_0),
2096 )
2097 }
2098 Member::Unnamed(_binding_0, ) => {
2099 Member::Unnamed (
2100 _visitor.fold_index(_binding_0),
2101 )
2102 }
2103 }
2104 }
2105 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2106 pub fn fold_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: Meta) -> Meta {
2107 match _i {
2108 Meta::Word(_binding_0, ) => {
2109 Meta::Word (
2110 _visitor.fold_ident(_binding_0),
2111 )
2112 }
2113 Meta::List(_binding_0, ) => {
2114 Meta::List (
2115 _visitor.fold_meta_list(_binding_0),
2116 )
2117 }
2118 Meta::NameValue(_binding_0, ) => {
2119 Meta::NameValue (
2120 _visitor.fold_meta_name_value(_binding_0),
2121 )
2122 }
2123 }
2124 }
2125 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2126 pub fn fold_meta_list<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaList) -> MetaList {
2127 MetaList {
2128 ident: _visitor.fold_ident(_i . ident),
2129 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2130 nested: FoldHelper::lift(_i . nested, |it| { _visitor.fold_nested_meta(it) }),
2131 }
2132 }
2133 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2134 pub fn fold_meta_name_value<V: Fold + ?Sized>(_visitor: &mut V, _i: MetaNameValue) -> MetaNameValue {
2135 MetaNameValue {
2136 ident: _visitor.fold_ident(_i . ident),
2137 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2138 lit: _visitor.fold_lit(_i . lit),
2139 }
2140 }
2141 # [ cfg ( feature = "full" ) ]
2142 pub fn fold_method_sig<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodSig) -> MethodSig {
2143 MethodSig {
2144 constness: (_i . constness).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
2145 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2146 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2147 ident: _visitor.fold_ident(_i . ident),
2148 decl: _visitor.fold_fn_decl(_i . decl),
2149 }
2150 }
2151 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2152 pub fn fold_method_turbofish<V: Fold + ?Sized>(_visitor: &mut V, _i: MethodTurbofish) -> MethodTurbofish {
2153 MethodTurbofish {
2154 colon2_token: Token ! [ :: ](tokens_helper(_visitor, &(_i . colon2_token).0)),
2155 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2156 args: FoldHelper::lift(_i . args, |it| { _visitor.fold_generic_method_argument(it) }),
2157 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2158 }
2159 }
2160 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2161 pub fn fold_nested_meta<V: Fold + ?Sized>(_visitor: &mut V, _i: NestedMeta) -> NestedMeta {
2162 match _i {
2163 NestedMeta::Meta(_binding_0, ) => {
2164 NestedMeta::Meta (
2165 _visitor.fold_meta(_binding_0),
2166 )
2167 }
2168 NestedMeta::Literal(_binding_0, ) => {
2169 NestedMeta::Literal (
2170 _visitor.fold_lit(_binding_0),
2171 )
2172 }
2173 }
2174 }
2175 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2176 pub fn fold_parenthesized_generic_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: ParenthesizedGenericArguments) -> ParenthesizedGenericArguments {
2177 ParenthesizedGenericArguments {
2178 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2179 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_type(it) }),
2180 output: _visitor.fold_return_type(_i . output),
2181 }
2182 }
2183 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2184 pub fn fold_pat<V: Fold + ?Sized>(_visitor: &mut V, _i: Pat) -> Pat {
2185 match _i {
2186 Pat::Wild(_binding_0, ) => {
2187 Pat::Wild (
2188 _visitor.fold_pat_wild(_binding_0),
2189 )
2190 }
2191 Pat::Ident(_binding_0, ) => {
2192 Pat::Ident (
2193 _visitor.fold_pat_ident(_binding_0),
2194 )
2195 }
2196 Pat::Struct(_binding_0, ) => {
2197 Pat::Struct (
2198 _visitor.fold_pat_struct(_binding_0),
2199 )
2200 }
2201 Pat::TupleStruct(_binding_0, ) => {
2202 Pat::TupleStruct (
2203 _visitor.fold_pat_tuple_struct(_binding_0),
2204 )
2205 }
2206 Pat::Path(_binding_0, ) => {
2207 Pat::Path (
2208 _visitor.fold_pat_path(_binding_0),
2209 )
2210 }
2211 Pat::Tuple(_binding_0, ) => {
2212 Pat::Tuple (
2213 _visitor.fold_pat_tuple(_binding_0),
2214 )
2215 }
2216 Pat::Box(_binding_0, ) => {
2217 Pat::Box (
2218 _visitor.fold_pat_box(_binding_0),
2219 )
2220 }
2221 Pat::Ref(_binding_0, ) => {
2222 Pat::Ref (
2223 _visitor.fold_pat_ref(_binding_0),
2224 )
2225 }
2226 Pat::Lit(_binding_0, ) => {
2227 Pat::Lit (
2228 _visitor.fold_pat_lit(_binding_0),
2229 )
2230 }
2231 Pat::Range(_binding_0, ) => {
2232 Pat::Range (
2233 _visitor.fold_pat_range(_binding_0),
2234 )
2235 }
2236 Pat::Slice(_binding_0, ) => {
2237 Pat::Slice (
2238 _visitor.fold_pat_slice(_binding_0),
2239 )
2240 }
2241 Pat::Macro(_binding_0, ) => {
2242 Pat::Macro (
2243 _visitor.fold_pat_macro(_binding_0),
2244 )
2245 }
2246 Pat::Verbatim(_binding_0, ) => {
2247 Pat::Verbatim (
2248 _visitor.fold_pat_verbatim(_binding_0),
2249 )
2250 }
2251 }
2252 }
2253 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2254 pub fn fold_pat_box<V: Fold + ?Sized>(_visitor: &mut V, _i: PatBox) -> PatBox {
2255 PatBox {
2256 box_token: Token ! [ box ](tokens_helper(_visitor, &(_i . box_token).0)),
2257 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2258 }
2259 }
2260 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2261 pub fn fold_pat_ident<V: Fold + ?Sized>(_visitor: &mut V, _i: PatIdent) -> PatIdent {
2262 PatIdent {
2263 by_ref: (_i . by_ref).map(|it| { Token ! [ ref ](tokens_helper(_visitor, &(it).0)) }),
2264 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2265 ident: _visitor.fold_ident(_i . ident),
2266 subpat: (_i . subpat).map(|it| { (
2267 Token ! [ @ ](tokens_helper(_visitor, &(( it ) . 0).0)),
2268 Box::new(_visitor.fold_pat(* ( it ) . 1)),
2269 ) }),
2270 }
2271 }
2272 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2273 pub fn fold_pat_lit<V: Fold + ?Sized>(_visitor: &mut V, _i: PatLit) -> PatLit {
2274 PatLit {
2275 expr: Box::new(_visitor.fold_expr(* _i . expr)),
2276 }
2277 }
2278 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2279 pub fn fold_pat_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: PatMacro) -> PatMacro {
2280 PatMacro {
2281 mac: _visitor.fold_macro(_i . mac),
2282 }
2283 }
2284 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2285 pub fn fold_pat_path<V: Fold + ?Sized>(_visitor: &mut V, _i: PatPath) -> PatPath {
2286 PatPath {
2287 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
2288 path: _visitor.fold_path(_i . path),
2289 }
2290 }
2291 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2292 pub fn fold_pat_range<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRange) -> PatRange {
2293 PatRange {
2294 lo: Box::new(_visitor.fold_expr(* _i . lo)),
2295 limits: _visitor.fold_range_limits(_i . limits),
2296 hi: Box::new(_visitor.fold_expr(* _i . hi)),
2297 }
2298 }
2299 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2300 pub fn fold_pat_ref<V: Fold + ?Sized>(_visitor: &mut V, _i: PatRef) -> PatRef {
2301 PatRef {
2302 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
2303 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2304 pat: Box::new(_visitor.fold_pat(* _i . pat)),
2305 }
2306 }
2307 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2308 pub fn fold_pat_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: PatSlice) -> PatSlice {
2309 PatSlice {
2310 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
2311 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
2312 middle: (_i . middle).map(|it| { Box::new(_visitor.fold_pat(* it)) }),
2313 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2314 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2315 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2316 }
2317 }
2318 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2319 pub fn fold_pat_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatStruct) -> PatStruct {
2320 PatStruct {
2321 path: _visitor.fold_path(_i . path),
2322 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
2323 fields: FoldHelper::lift(_i . fields, |it| { _visitor.fold_field_pat(it) }),
2324 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2325 }
2326 }
2327 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2328 pub fn fold_pat_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTuple) -> PatTuple {
2329 PatTuple {
2330 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2331 front: FoldHelper::lift(_i . front, |it| { _visitor.fold_pat(it) }),
2332 dot2_token: (_i . dot2_token).map(|it| { Token ! [ .. ](tokens_helper(_visitor, &(it).0)) }),
2333 comma_token: (_i . comma_token).map(|it| { Token ! [ , ](tokens_helper(_visitor, &(it).0)) }),
2334 back: FoldHelper::lift(_i . back, |it| { _visitor.fold_pat(it) }),
2335 }
2336 }
2337 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2338 pub fn fold_pat_tuple_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: PatTupleStruct) -> PatTupleStruct {
2339 PatTupleStruct {
2340 path: _visitor.fold_path(_i . path),
2341 pat: _visitor.fold_pat_tuple(_i . pat),
2342 }
2343 }
2344 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2345 pub fn fold_pat_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: PatVerbatim) -> PatVerbatim {
2346 PatVerbatim {
2347 tts: _i . tts,
2348 }
2349 }
2350 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2351 pub fn fold_pat_wild<V: Fold + ?Sized>(_visitor: &mut V, _i: PatWild) -> PatWild {
2352 PatWild {
2353 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
2354 }
2355 }
2356 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2357 pub fn fold_path<V: Fold + ?Sized>(_visitor: &mut V, _i: Path) -> Path {
2358 Path {
2359 leading_colon: (_i . leading_colon).map(|it| { Token ! [ :: ](tokens_helper(_visitor, &(it).0)) }),
2360 segments: FoldHelper::lift(_i . segments, |it| { _visitor.fold_path_segment(it) }),
2361 }
2362 }
2363 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2364 pub fn fold_path_arguments<V: Fold + ?Sized>(_visitor: &mut V, _i: PathArguments) -> PathArguments {
2365 match _i {
2366 PathArguments::None => { PathArguments::None }
2367 PathArguments::AngleBracketed(_binding_0, ) => {
2368 PathArguments::AngleBracketed (
2369 _visitor.fold_angle_bracketed_generic_arguments(_binding_0),
2370 )
2371 }
2372 PathArguments::Parenthesized(_binding_0, ) => {
2373 PathArguments::Parenthesized (
2374 _visitor.fold_parenthesized_generic_arguments(_binding_0),
2375 )
2376 }
2377 }
2378 }
2379 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2380 pub fn fold_path_segment<V: Fold + ?Sized>(_visitor: &mut V, _i: PathSegment) -> PathSegment {
2381 PathSegment {
2382 ident: _visitor.fold_ident(_i . ident),
2383 arguments: _visitor.fold_path_arguments(_i . arguments),
2384 }
2385 }
2386 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2387 pub fn fold_predicate_eq<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateEq) -> PredicateEq {
2388 PredicateEq {
2389 lhs_ty: _visitor.fold_type(_i . lhs_ty),
2390 eq_token: Token ! [ = ](tokens_helper(_visitor, &(_i . eq_token).0)),
2391 rhs_ty: _visitor.fold_type(_i . rhs_ty),
2392 }
2393 }
2394 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2395 pub fn fold_predicate_lifetime<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateLifetime) -> PredicateLifetime {
2396 PredicateLifetime {
2397 lifetime: _visitor.fold_lifetime(_i . lifetime),
2398 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2399 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_lifetime(it) }),
2400 }
2401 }
2402 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2403 pub fn fold_predicate_type<V: Fold + ?Sized>(_visitor: &mut V, _i: PredicateType) -> PredicateType {
2404 PredicateType {
2405 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2406 bounded_ty: _visitor.fold_type(_i . bounded_ty),
2407 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2408 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2409 }
2410 }
2411 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2412 pub fn fold_qself<V: Fold + ?Sized>(_visitor: &mut V, _i: QSelf) -> QSelf {
2413 QSelf {
2414 lt_token: Token ! [ < ](tokens_helper(_visitor, &(_i . lt_token).0)),
2415 ty: Box::new(_visitor.fold_type(* _i . ty)),
2416 position: _i . position,
2417 as_token: (_i . as_token).map(|it| { Token ! [ as ](tokens_helper(_visitor, &(it).0)) }),
2418 gt_token: Token ! [ > ](tokens_helper(_visitor, &(_i . gt_token).0)),
2419 }
2420 }
2421 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2422 pub fn fold_range_limits<V: Fold + ?Sized>(_visitor: &mut V, _i: RangeLimits) -> RangeLimits {
2423 match _i {
2424 RangeLimits::HalfOpen(_binding_0, ) => {
2425 RangeLimits::HalfOpen (
2426 Token ! [ .. ](tokens_helper(_visitor, &(_binding_0).0)),
2427 )
2428 }
2429 RangeLimits::Closed(_binding_0, ) => {
2430 RangeLimits::Closed (
2431 Token ! [ ..= ](tokens_helper(_visitor, &(_binding_0).0)),
2432 )
2433 }
2434 }
2435 }
2436 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2437 pub fn fold_return_type<V: Fold + ?Sized>(_visitor: &mut V, _i: ReturnType) -> ReturnType {
2438 match _i {
2439 ReturnType::Default => { ReturnType::Default }
2440 ReturnType::Type(_binding_0, _binding_1, ) => {
2441 ReturnType::Type (
2442 Token ! [ -> ](tokens_helper(_visitor, &(_binding_0).0)),
2443 Box::new(_visitor.fold_type(* _binding_1)),
2444 )
2445 }
2446 }
2447 }
2448
2449 pub fn fold_span<V: Fold + ?Sized>(_visitor: &mut V, _i: Span) -> Span {
2450 _i
2451 }
2452 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ] # [ cfg ( feature = "full" ) ]
2453 pub fn fold_stmt<V: Fold + ?Sized>(_visitor: &mut V, _i: Stmt) -> Stmt {
2454 match _i {
2455 Stmt::Local(_binding_0, ) => {
2456 Stmt::Local (
2457 _visitor.fold_local(_binding_0),
2458 )
2459 }
2460 Stmt::Item(_binding_0, ) => {
2461 Stmt::Item (
2462 _visitor.fold_item(_binding_0),
2463 )
2464 }
2465 Stmt::Expr(_binding_0, ) => {
2466 Stmt::Expr (
2467 _visitor.fold_expr(_binding_0),
2468 )
2469 }
2470 Stmt::Semi(_binding_0, _binding_1, ) => {
2471 Stmt::Semi (
2472 _visitor.fold_expr(_binding_0),
2473 Token ! [ ; ](tokens_helper(_visitor, &(_binding_1).0)),
2474 )
2475 }
2476 }
2477 }
2478 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2479 pub fn fold_trait_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBound) -> TraitBound {
2480 TraitBound {
2481 modifier: _visitor.fold_trait_bound_modifier(_i . modifier),
2482 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2483 path: _visitor.fold_path(_i . path),
2484 }
2485 }
2486 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2487 pub fn fold_trait_bound_modifier<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitBoundModifier) -> TraitBoundModifier {
2488 match _i {
2489 TraitBoundModifier::None => { TraitBoundModifier::None }
2490 TraitBoundModifier::Maybe(_binding_0, ) => {
2491 TraitBoundModifier::Maybe (
2492 Token ! [ ? ](tokens_helper(_visitor, &(_binding_0).0)),
2493 )
2494 }
2495 }
2496 }
2497 # [ cfg ( feature = "full" ) ]
2498 pub fn fold_trait_item<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItem) -> TraitItem {
2499 match _i {
2500 TraitItem::Const(_binding_0, ) => {
2501 TraitItem::Const (
2502 _visitor.fold_trait_item_const(_binding_0),
2503 )
2504 }
2505 TraitItem::Method(_binding_0, ) => {
2506 TraitItem::Method (
2507 _visitor.fold_trait_item_method(_binding_0),
2508 )
2509 }
2510 TraitItem::Type(_binding_0, ) => {
2511 TraitItem::Type (
2512 _visitor.fold_trait_item_type(_binding_0),
2513 )
2514 }
2515 TraitItem::Macro(_binding_0, ) => {
2516 TraitItem::Macro (
2517 _visitor.fold_trait_item_macro(_binding_0),
2518 )
2519 }
2520 TraitItem::Verbatim(_binding_0, ) => {
2521 TraitItem::Verbatim (
2522 _visitor.fold_trait_item_verbatim(_binding_0),
2523 )
2524 }
2525 }
2526 }
2527 # [ cfg ( feature = "full" ) ]
2528 pub fn fold_trait_item_const<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemConst) -> TraitItemConst {
2529 TraitItemConst {
2530 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2531 const_token: Token ! [ const ](tokens_helper(_visitor, &(_i . const_token).0)),
2532 ident: _visitor.fold_ident(_i . ident),
2533 colon_token: Token ! [ : ](tokens_helper(_visitor, &(_i . colon_token).0)),
2534 ty: _visitor.fold_type(_i . ty),
2535 default: (_i . default).map(|it| { (
2536 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2537 _visitor.fold_expr(( it ) . 1),
2538 ) }),
2539 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
2540 }
2541 }
2542 # [ cfg ( feature = "full" ) ]
2543 pub fn fold_trait_item_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMacro) -> TraitItemMacro {
2544 TraitItemMacro {
2545 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2546 mac: _visitor.fold_macro(_i . mac),
2547 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
2548 }
2549 }
2550 # [ cfg ( feature = "full" ) ]
2551 pub fn fold_trait_item_method<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemMethod) -> TraitItemMethod {
2552 TraitItemMethod {
2553 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2554 sig: _visitor.fold_method_sig(_i . sig),
2555 default: (_i . default).map(|it| { _visitor.fold_block(it) }),
2556 semi_token: (_i . semi_token).map(|it| { Token ! [ ; ](tokens_helper(_visitor, &(it).0)) }),
2557 }
2558 }
2559 # [ cfg ( feature = "full" ) ]
2560 pub fn fold_trait_item_type<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemType) -> TraitItemType {
2561 TraitItemType {
2562 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2563 type_token: Token ! [ type ](tokens_helper(_visitor, &(_i . type_token).0)),
2564 ident: _visitor.fold_ident(_i . ident),
2565 generics: _visitor.fold_generics(_i . generics),
2566 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2567 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2568 default: (_i . default).map(|it| { (
2569 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2570 _visitor.fold_type(( it ) . 1),
2571 ) }),
2572 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
2573 }
2574 }
2575 # [ cfg ( feature = "full" ) ]
2576 pub fn fold_trait_item_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TraitItemVerbatim) -> TraitItemVerbatim {
2577 TraitItemVerbatim {
2578 tts: _i . tts,
2579 }
2580 }
2581 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2582 pub fn fold_type<V: Fold + ?Sized>(_visitor: &mut V, _i: Type) -> Type {
2583 match _i {
2584 Type::Slice(_binding_0, ) => {
2585 Type::Slice (
2586 _visitor.fold_type_slice(_binding_0),
2587 )
2588 }
2589 Type::Array(_binding_0, ) => {
2590 Type::Array (
2591 _visitor.fold_type_array(_binding_0),
2592 )
2593 }
2594 Type::Ptr(_binding_0, ) => {
2595 Type::Ptr (
2596 _visitor.fold_type_ptr(_binding_0),
2597 )
2598 }
2599 Type::Reference(_binding_0, ) => {
2600 Type::Reference (
2601 _visitor.fold_type_reference(_binding_0),
2602 )
2603 }
2604 Type::BareFn(_binding_0, ) => {
2605 Type::BareFn (
2606 _visitor.fold_type_bare_fn(_binding_0),
2607 )
2608 }
2609 Type::Never(_binding_0, ) => {
2610 Type::Never (
2611 _visitor.fold_type_never(_binding_0),
2612 )
2613 }
2614 Type::Tuple(_binding_0, ) => {
2615 Type::Tuple (
2616 _visitor.fold_type_tuple(_binding_0),
2617 )
2618 }
2619 Type::Path(_binding_0, ) => {
2620 Type::Path (
2621 _visitor.fold_type_path(_binding_0),
2622 )
2623 }
2624 Type::TraitObject(_binding_0, ) => {
2625 Type::TraitObject (
2626 _visitor.fold_type_trait_object(_binding_0),
2627 )
2628 }
2629 Type::ImplTrait(_binding_0, ) => {
2630 Type::ImplTrait (
2631 _visitor.fold_type_impl_trait(_binding_0),
2632 )
2633 }
2634 Type::Paren(_binding_0, ) => {
2635 Type::Paren (
2636 _visitor.fold_type_paren(_binding_0),
2637 )
2638 }
2639 Type::Group(_binding_0, ) => {
2640 Type::Group (
2641 _visitor.fold_type_group(_binding_0),
2642 )
2643 }
2644 Type::Infer(_binding_0, ) => {
2645 Type::Infer (
2646 _visitor.fold_type_infer(_binding_0),
2647 )
2648 }
2649 Type::Macro(_binding_0, ) => {
2650 Type::Macro (
2651 _visitor.fold_type_macro(_binding_0),
2652 )
2653 }
2654 Type::Verbatim(_binding_0, ) => {
2655 Type::Verbatim (
2656 _visitor.fold_type_verbatim(_binding_0),
2657 )
2658 }
2659 }
2660 }
2661 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2662 pub fn fold_type_array<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeArray) -> TypeArray {
2663 TypeArray {
2664 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
2665 elem: Box::new(_visitor.fold_type(* _i . elem)),
2666 semi_token: Token ! [ ; ](tokens_helper(_visitor, &(_i . semi_token).0)),
2667 len: _visitor.fold_expr(_i . len),
2668 }
2669 }
2670 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2671 pub fn fold_type_bare_fn<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeBareFn) -> TypeBareFn {
2672 TypeBareFn {
2673 unsafety: (_i . unsafety).map(|it| { Token ! [ unsafe ](tokens_helper(_visitor, &(it).0)) }),
2674 abi: (_i . abi).map(|it| { _visitor.fold_abi(it) }),
2675 fn_token: Token ! [ fn ](tokens_helper(_visitor, &(_i . fn_token).0)),
2676 lifetimes: (_i . lifetimes).map(|it| { _visitor.fold_bound_lifetimes(it) }),
2677 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2678 inputs: FoldHelper::lift(_i . inputs, |it| { _visitor.fold_bare_fn_arg(it) }),
2679 variadic: (_i . variadic).map(|it| { Token ! [ ... ](tokens_helper(_visitor, &(it).0)) }),
2680 output: _visitor.fold_return_type(_i . output),
2681 }
2682 }
2683 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2684 pub fn fold_type_group<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeGroup) -> TypeGroup {
2685 TypeGroup {
2686 group_token: Group(tokens_helper(_visitor, &(_i . group_token).0)),
2687 elem: Box::new(_visitor.fold_type(* _i . elem)),
2688 }
2689 }
2690 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2691 pub fn fold_type_impl_trait<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeImplTrait) -> TypeImplTrait {
2692 TypeImplTrait {
2693 impl_token: Token ! [ impl ](tokens_helper(_visitor, &(_i . impl_token).0)),
2694 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2695 }
2696 }
2697 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2698 pub fn fold_type_infer<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeInfer) -> TypeInfer {
2699 TypeInfer {
2700 underscore_token: Token ! [ _ ](tokens_helper(_visitor, &(_i . underscore_token).0)),
2701 }
2702 }
2703 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2704 pub fn fold_type_macro<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeMacro) -> TypeMacro {
2705 TypeMacro {
2706 mac: _visitor.fold_macro(_i . mac),
2707 }
2708 }
2709 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2710 pub fn fold_type_never<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeNever) -> TypeNever {
2711 TypeNever {
2712 bang_token: Token ! [ ! ](tokens_helper(_visitor, &(_i . bang_token).0)),
2713 }
2714 }
2715 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2716 pub fn fold_type_param<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParam) -> TypeParam {
2717 TypeParam {
2718 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2719 ident: _visitor.fold_ident(_i . ident),
2720 colon_token: (_i . colon_token).map(|it| { Token ! [ : ](tokens_helper(_visitor, &(it).0)) }),
2721 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2722 eq_token: (_i . eq_token).map(|it| { Token ! [ = ](tokens_helper(_visitor, &(it).0)) }),
2723 default: (_i . default).map(|it| { _visitor.fold_type(it) }),
2724 }
2725 }
2726 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2727 pub fn fold_type_param_bound<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParamBound) -> TypeParamBound {
2728 match _i {
2729 TypeParamBound::Trait(_binding_0, ) => {
2730 TypeParamBound::Trait (
2731 _visitor.fold_trait_bound(_binding_0),
2732 )
2733 }
2734 TypeParamBound::Lifetime(_binding_0, ) => {
2735 TypeParamBound::Lifetime (
2736 _visitor.fold_lifetime(_binding_0),
2737 )
2738 }
2739 }
2740 }
2741 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2742 pub fn fold_type_paren<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeParen) -> TypeParen {
2743 TypeParen {
2744 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2745 elem: Box::new(_visitor.fold_type(* _i . elem)),
2746 }
2747 }
2748 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2749 pub fn fold_type_path<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePath) -> TypePath {
2750 TypePath {
2751 qself: (_i . qself).map(|it| { _visitor.fold_qself(it) }),
2752 path: _visitor.fold_path(_i . path),
2753 }
2754 }
2755 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2756 pub fn fold_type_ptr<V: Fold + ?Sized>(_visitor: &mut V, _i: TypePtr) -> TypePtr {
2757 TypePtr {
2758 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2759 const_token: (_i . const_token).map(|it| { Token ! [ const ](tokens_helper(_visitor, &(it).0)) }),
2760 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2761 elem: Box::new(_visitor.fold_type(* _i . elem)),
2762 }
2763 }
2764 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2765 pub fn fold_type_reference<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeReference) -> TypeReference {
2766 TypeReference {
2767 and_token: Token ! [ & ](tokens_helper(_visitor, &(_i . and_token).0)),
2768 lifetime: (_i . lifetime).map(|it| { _visitor.fold_lifetime(it) }),
2769 mutability: (_i . mutability).map(|it| { Token ! [ mut ](tokens_helper(_visitor, &(it).0)) }),
2770 elem: Box::new(_visitor.fold_type(* _i . elem)),
2771 }
2772 }
2773 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2774 pub fn fold_type_slice<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeSlice) -> TypeSlice {
2775 TypeSlice {
2776 bracket_token: Bracket(tokens_helper(_visitor, &(_i . bracket_token).0)),
2777 elem: Box::new(_visitor.fold_type(* _i . elem)),
2778 }
2779 }
2780 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2781 pub fn fold_type_trait_object<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTraitObject) -> TypeTraitObject {
2782 TypeTraitObject {
2783 dyn_token: (_i . dyn_token).map(|it| { Token ! [ dyn ](tokens_helper(_visitor, &(it).0)) }),
2784 bounds: FoldHelper::lift(_i . bounds, |it| { _visitor.fold_type_param_bound(it) }),
2785 }
2786 }
2787 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2788 pub fn fold_type_tuple<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeTuple) -> TypeTuple {
2789 TypeTuple {
2790 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2791 elems: FoldHelper::lift(_i . elems, |it| { _visitor.fold_type(it) }),
2792 }
2793 }
2794 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2795 pub fn fold_type_verbatim<V: Fold + ?Sized>(_visitor: &mut V, _i: TypeVerbatim) -> TypeVerbatim {
2796 TypeVerbatim {
2797 tts: _i . tts,
2798 }
2799 }
2800 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2801 pub fn fold_un_op<V: Fold + ?Sized>(_visitor: &mut V, _i: UnOp) -> UnOp {
2802 match _i {
2803 UnOp::Deref(_binding_0, ) => {
2804 UnOp::Deref (
2805 Token ! [ * ](tokens_helper(_visitor, &(_binding_0).0)),
2806 )
2807 }
2808 UnOp::Not(_binding_0, ) => {
2809 UnOp::Not (
2810 Token ! [ ! ](tokens_helper(_visitor, &(_binding_0).0)),
2811 )
2812 }
2813 UnOp::Neg(_binding_0, ) => {
2814 UnOp::Neg (
2815 Token ! [ - ](tokens_helper(_visitor, &(_binding_0).0)),
2816 )
2817 }
2818 }
2819 }
2820 # [ cfg ( feature = "full" ) ]
2821 pub fn fold_use_glob<V: Fold + ?Sized>(_visitor: &mut V, _i: UseGlob) -> UseGlob {
2822 UseGlob {
2823 star_token: Token ! [ * ](tokens_helper(_visitor, &(_i . star_token).0)),
2824 }
2825 }
2826 # [ cfg ( feature = "full" ) ]
2827 pub fn fold_use_list<V: Fold + ?Sized>(_visitor: &mut V, _i: UseList) -> UseList {
2828 UseList {
2829 brace_token: Brace(tokens_helper(_visitor, &(_i . brace_token).0)),
2830 items: FoldHelper::lift(_i . items, |it| { _visitor.fold_use_tree(it) }),
2831 }
2832 }
2833 # [ cfg ( feature = "full" ) ]
2834 pub fn fold_use_path<V: Fold + ?Sized>(_visitor: &mut V, _i: UsePath) -> UsePath {
2835 UsePath {
2836 ident: _visitor.fold_ident(_i . ident),
2837 rename: (_i . rename).map(|it| { (
2838 Token ! [ as ](tokens_helper(_visitor, &(( it ) . 0).0)),
2839 _visitor.fold_ident(( it ) . 1),
2840 ) }),
2841 }
2842 }
2843 # [ cfg ( feature = "full" ) ]
2844 pub fn fold_use_tree<V: Fold + ?Sized>(_visitor: &mut V, _i: UseTree) -> UseTree {
2845 match _i {
2846 UseTree::Path(_binding_0, ) => {
2847 UseTree::Path (
2848 _visitor.fold_use_path(_binding_0),
2849 )
2850 }
2851 UseTree::Glob(_binding_0, ) => {
2852 UseTree::Glob (
2853 _visitor.fold_use_glob(_binding_0),
2854 )
2855 }
2856 UseTree::List(_binding_0, ) => {
2857 UseTree::List (
2858 _visitor.fold_use_list(_binding_0),
2859 )
2860 }
2861 }
2862 }
2863 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2864 pub fn fold_variant<V: Fold + ?Sized>(_visitor: &mut V, _i: Variant) -> Variant {
2865 Variant {
2866 attrs: FoldHelper::lift(_i . attrs, |it| { _visitor.fold_attribute(it) }),
2867 ident: _visitor.fold_ident(_i . ident),
2868 fields: _visitor.fold_fields(_i . fields),
2869 discriminant: (_i . discriminant).map(|it| { (
2870 Token ! [ = ](tokens_helper(_visitor, &(( it ) . 0).0)),
2871 _visitor.fold_expr(( it ) . 1),
2872 ) }),
2873 }
2874 }
2875 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2876 pub fn fold_vis_crate<V: Fold + ?Sized>(_visitor: &mut V, _i: VisCrate) -> VisCrate {
2877 VisCrate {
2878 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
2879 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2880 crate_token: Token ! [ crate ](tokens_helper(_visitor, &(_i . crate_token).0)),
2881 }
2882 }
2883 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2884 pub fn fold_vis_public<V: Fold + ?Sized>(_visitor: &mut V, _i: VisPublic) -> VisPublic {
2885 VisPublic {
2886 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
2887 }
2888 }
2889 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2890 pub fn fold_vis_restricted<V: Fold + ?Sized>(_visitor: &mut V, _i: VisRestricted) -> VisRestricted {
2891 VisRestricted {
2892 pub_token: Token ! [ pub ](tokens_helper(_visitor, &(_i . pub_token).0)),
2893 paren_token: Paren(tokens_helper(_visitor, &(_i . paren_token).0)),
2894 in_token: (_i . in_token).map(|it| { Token ! [ in ](tokens_helper(_visitor, &(it).0)) }),
2895 path: Box::new(_visitor.fold_path(* _i . path)),
2896 }
2897 }
2898 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2899 pub fn fold_visibility<V: Fold + ?Sized>(_visitor: &mut V, _i: Visibility) -> Visibility {
2900 match _i {
2901 Visibility::Public(_binding_0, ) => {
2902 Visibility::Public (
2903 _visitor.fold_vis_public(_binding_0),
2904 )
2905 }
2906 Visibility::Crate(_binding_0, ) => {
2907 Visibility::Crate (
2908 _visitor.fold_vis_crate(_binding_0),
2909 )
2910 }
2911 Visibility::Restricted(_binding_0, ) => {
2912 Visibility::Restricted (
2913 _visitor.fold_vis_restricted(_binding_0),
2914 )
2915 }
2916 Visibility::Inherited => { Visibility::Inherited }
2917 }
2918 }
2919 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2920 pub fn fold_where_clause<V: Fold + ?Sized>(_visitor: &mut V, _i: WhereClause) -> WhereClause {
2921 WhereClause {
2922 where_token: Token ! [ where ](tokens_helper(_visitor, &(_i . where_token).0)),
2923 predicates: FoldHelper::lift(_i . predicates, |it| { _visitor.fold_where_predicate(it) }),
2924 }
2925 }
2926 # [ cfg ( any ( feature = "full" , feature = "derive" ) ) ]
2927 pub fn fold_where_predicate<V: Fold + ?Sized>(_visitor: &mut V, _i: WherePredicate) -> WherePredicate {
2928 match _i {
2929 WherePredicate::Type(_binding_0, ) => {
2930 WherePredicate::Type (
2931 _visitor.fold_predicate_type(_binding_0),
2932 )
2933 }
2934 WherePredicate::Lifetime(_binding_0, ) => {
2935 WherePredicate::Lifetime (
2936 _visitor.fold_predicate_lifetime(_binding_0),
2937 )
2938 }
2939 WherePredicate::Eq(_binding_0, ) => {
2940 WherePredicate::Eq (
2941 _visitor.fold_predicate_eq(_binding_0),
2942 )
2943 }
2944 }
2945 }
2946