1 | // This file is @generated by syn-internal-codegen. |
2 | // It is not intended for manual editing. |
3 | |
4 | #![allow (unreachable_code, unused_variables)] |
5 | #![allow ( |
6 | clippy::match_wildcard_for_single_variants, |
7 | clippy::needless_match, |
8 | clippy::needless_pass_by_ref_mut, |
9 | )] |
10 | #[cfg (any(feature = "full" , feature = "derive" ))] |
11 | use crate::gen::helper::fold::FoldHelper; |
12 | #[cfg (feature = "full" )] |
13 | macro_rules! full { |
14 | ($e:expr) => { |
15 | $e |
16 | }; |
17 | } |
18 | #[cfg (all(feature = "derive" , not(feature = "full" )))] |
19 | macro_rules! full { |
20 | ($e:expr) => { |
21 | unreachable!() |
22 | }; |
23 | } |
24 | /// Syntax tree traversal to transform the nodes of an owned syntax tree. |
25 | /// |
26 | /// See the [module documentation] for details. |
27 | /// |
28 | /// [module documentation]: self |
29 | pub trait Fold { |
30 | #[cfg (any(feature = "derive" , feature = "full" ))] |
31 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
32 | fn fold_abi(&mut self, i: crate::Abi) -> crate::Abi { |
33 | fold_abi(self, i) |
34 | } |
35 | #[cfg (any(feature = "derive" , feature = "full" ))] |
36 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
37 | fn fold_angle_bracketed_generic_arguments( |
38 | &mut self, |
39 | i: crate::AngleBracketedGenericArguments, |
40 | ) -> crate::AngleBracketedGenericArguments { |
41 | fold_angle_bracketed_generic_arguments(self, i) |
42 | } |
43 | #[cfg (feature = "full" )] |
44 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
45 | fn fold_arm(&mut self, i: crate::Arm) -> crate::Arm { |
46 | fold_arm(self, i) |
47 | } |
48 | #[cfg (any(feature = "derive" , feature = "full" ))] |
49 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
50 | fn fold_assoc_const(&mut self, i: crate::AssocConst) -> crate::AssocConst { |
51 | fold_assoc_const(self, i) |
52 | } |
53 | #[cfg (any(feature = "derive" , feature = "full" ))] |
54 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
55 | fn fold_assoc_type(&mut self, i: crate::AssocType) -> crate::AssocType { |
56 | fold_assoc_type(self, i) |
57 | } |
58 | #[cfg (any(feature = "derive" , feature = "full" ))] |
59 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
60 | fn fold_attr_style(&mut self, i: crate::AttrStyle) -> crate::AttrStyle { |
61 | fold_attr_style(self, i) |
62 | } |
63 | #[cfg (any(feature = "derive" , feature = "full" ))] |
64 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
65 | fn fold_attribute(&mut self, i: crate::Attribute) -> crate::Attribute { |
66 | fold_attribute(self, i) |
67 | } |
68 | #[cfg (any(feature = "derive" , feature = "full" ))] |
69 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
70 | fn fold_bare_fn_arg(&mut self, i: crate::BareFnArg) -> crate::BareFnArg { |
71 | fold_bare_fn_arg(self, i) |
72 | } |
73 | #[cfg (any(feature = "derive" , feature = "full" ))] |
74 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
75 | fn fold_bare_variadic(&mut self, i: crate::BareVariadic) -> crate::BareVariadic { |
76 | fold_bare_variadic(self, i) |
77 | } |
78 | #[cfg (any(feature = "derive" , feature = "full" ))] |
79 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
80 | fn fold_bin_op(&mut self, i: crate::BinOp) -> crate::BinOp { |
81 | fold_bin_op(self, i) |
82 | } |
83 | #[cfg (feature = "full" )] |
84 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
85 | fn fold_block(&mut self, i: crate::Block) -> crate::Block { |
86 | fold_block(self, i) |
87 | } |
88 | #[cfg (any(feature = "derive" , feature = "full" ))] |
89 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
90 | fn fold_bound_lifetimes( |
91 | &mut self, |
92 | i: crate::BoundLifetimes, |
93 | ) -> crate::BoundLifetimes { |
94 | fold_bound_lifetimes(self, i) |
95 | } |
96 | #[cfg (any(feature = "derive" , feature = "full" ))] |
97 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
98 | fn fold_const_param(&mut self, i: crate::ConstParam) -> crate::ConstParam { |
99 | fold_const_param(self, i) |
100 | } |
101 | #[cfg (any(feature = "derive" , feature = "full" ))] |
102 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
103 | fn fold_constraint(&mut self, i: crate::Constraint) -> crate::Constraint { |
104 | fold_constraint(self, i) |
105 | } |
106 | #[cfg (feature = "derive" )] |
107 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
108 | fn fold_data(&mut self, i: crate::Data) -> crate::Data { |
109 | fold_data(self, i) |
110 | } |
111 | #[cfg (feature = "derive" )] |
112 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
113 | fn fold_data_enum(&mut self, i: crate::DataEnum) -> crate::DataEnum { |
114 | fold_data_enum(self, i) |
115 | } |
116 | #[cfg (feature = "derive" )] |
117 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
118 | fn fold_data_struct(&mut self, i: crate::DataStruct) -> crate::DataStruct { |
119 | fold_data_struct(self, i) |
120 | } |
121 | #[cfg (feature = "derive" )] |
122 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
123 | fn fold_data_union(&mut self, i: crate::DataUnion) -> crate::DataUnion { |
124 | fold_data_union(self, i) |
125 | } |
126 | #[cfg (feature = "derive" )] |
127 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
128 | fn fold_derive_input(&mut self, i: crate::DeriveInput) -> crate::DeriveInput { |
129 | fold_derive_input(self, i) |
130 | } |
131 | #[cfg (any(feature = "derive" , feature = "full" ))] |
132 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
133 | fn fold_expr(&mut self, i: crate::Expr) -> crate::Expr { |
134 | fold_expr(self, i) |
135 | } |
136 | #[cfg (feature = "full" )] |
137 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
138 | fn fold_expr_array(&mut self, i: crate::ExprArray) -> crate::ExprArray { |
139 | fold_expr_array(self, i) |
140 | } |
141 | #[cfg (feature = "full" )] |
142 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
143 | fn fold_expr_assign(&mut self, i: crate::ExprAssign) -> crate::ExprAssign { |
144 | fold_expr_assign(self, i) |
145 | } |
146 | #[cfg (feature = "full" )] |
147 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
148 | fn fold_expr_async(&mut self, i: crate::ExprAsync) -> crate::ExprAsync { |
149 | fold_expr_async(self, i) |
150 | } |
151 | #[cfg (feature = "full" )] |
152 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
153 | fn fold_expr_await(&mut self, i: crate::ExprAwait) -> crate::ExprAwait { |
154 | fold_expr_await(self, i) |
155 | } |
156 | #[cfg (any(feature = "derive" , feature = "full" ))] |
157 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
158 | fn fold_expr_binary(&mut self, i: crate::ExprBinary) -> crate::ExprBinary { |
159 | fold_expr_binary(self, i) |
160 | } |
161 | #[cfg (feature = "full" )] |
162 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
163 | fn fold_expr_block(&mut self, i: crate::ExprBlock) -> crate::ExprBlock { |
164 | fold_expr_block(self, i) |
165 | } |
166 | #[cfg (feature = "full" )] |
167 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
168 | fn fold_expr_break(&mut self, i: crate::ExprBreak) -> crate::ExprBreak { |
169 | fold_expr_break(self, i) |
170 | } |
171 | #[cfg (any(feature = "derive" , feature = "full" ))] |
172 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
173 | fn fold_expr_call(&mut self, i: crate::ExprCall) -> crate::ExprCall { |
174 | fold_expr_call(self, i) |
175 | } |
176 | #[cfg (any(feature = "derive" , feature = "full" ))] |
177 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
178 | fn fold_expr_cast(&mut self, i: crate::ExprCast) -> crate::ExprCast { |
179 | fold_expr_cast(self, i) |
180 | } |
181 | #[cfg (feature = "full" )] |
182 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
183 | fn fold_expr_closure(&mut self, i: crate::ExprClosure) -> crate::ExprClosure { |
184 | fold_expr_closure(self, i) |
185 | } |
186 | #[cfg (feature = "full" )] |
187 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
188 | fn fold_expr_const(&mut self, i: crate::ExprConst) -> crate::ExprConst { |
189 | fold_expr_const(self, i) |
190 | } |
191 | #[cfg (feature = "full" )] |
192 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
193 | fn fold_expr_continue(&mut self, i: crate::ExprContinue) -> crate::ExprContinue { |
194 | fold_expr_continue(self, i) |
195 | } |
196 | #[cfg (any(feature = "derive" , feature = "full" ))] |
197 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
198 | fn fold_expr_field(&mut self, i: crate::ExprField) -> crate::ExprField { |
199 | fold_expr_field(self, i) |
200 | } |
201 | #[cfg (feature = "full" )] |
202 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
203 | fn fold_expr_for_loop(&mut self, i: crate::ExprForLoop) -> crate::ExprForLoop { |
204 | fold_expr_for_loop(self, i) |
205 | } |
206 | #[cfg (any(feature = "derive" , feature = "full" ))] |
207 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
208 | fn fold_expr_group(&mut self, i: crate::ExprGroup) -> crate::ExprGroup { |
209 | fold_expr_group(self, i) |
210 | } |
211 | #[cfg (feature = "full" )] |
212 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
213 | fn fold_expr_if(&mut self, i: crate::ExprIf) -> crate::ExprIf { |
214 | fold_expr_if(self, i) |
215 | } |
216 | #[cfg (any(feature = "derive" , feature = "full" ))] |
217 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
218 | fn fold_expr_index(&mut self, i: crate::ExprIndex) -> crate::ExprIndex { |
219 | fold_expr_index(self, i) |
220 | } |
221 | #[cfg (feature = "full" )] |
222 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
223 | fn fold_expr_infer(&mut self, i: crate::ExprInfer) -> crate::ExprInfer { |
224 | fold_expr_infer(self, i) |
225 | } |
226 | #[cfg (feature = "full" )] |
227 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
228 | fn fold_expr_let(&mut self, i: crate::ExprLet) -> crate::ExprLet { |
229 | fold_expr_let(self, i) |
230 | } |
231 | #[cfg (any(feature = "derive" , feature = "full" ))] |
232 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
233 | fn fold_expr_lit(&mut self, i: crate::ExprLit) -> crate::ExprLit { |
234 | fold_expr_lit(self, i) |
235 | } |
236 | #[cfg (feature = "full" )] |
237 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
238 | fn fold_expr_loop(&mut self, i: crate::ExprLoop) -> crate::ExprLoop { |
239 | fold_expr_loop(self, i) |
240 | } |
241 | #[cfg (any(feature = "derive" , feature = "full" ))] |
242 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
243 | fn fold_expr_macro(&mut self, i: crate::ExprMacro) -> crate::ExprMacro { |
244 | fold_expr_macro(self, i) |
245 | } |
246 | #[cfg (feature = "full" )] |
247 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
248 | fn fold_expr_match(&mut self, i: crate::ExprMatch) -> crate::ExprMatch { |
249 | fold_expr_match(self, i) |
250 | } |
251 | #[cfg (any(feature = "derive" , feature = "full" ))] |
252 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
253 | fn fold_expr_method_call( |
254 | &mut self, |
255 | i: crate::ExprMethodCall, |
256 | ) -> crate::ExprMethodCall { |
257 | fold_expr_method_call(self, i) |
258 | } |
259 | #[cfg (any(feature = "derive" , feature = "full" ))] |
260 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
261 | fn fold_expr_paren(&mut self, i: crate::ExprParen) -> crate::ExprParen { |
262 | fold_expr_paren(self, i) |
263 | } |
264 | #[cfg (any(feature = "derive" , feature = "full" ))] |
265 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
266 | fn fold_expr_path(&mut self, i: crate::ExprPath) -> crate::ExprPath { |
267 | fold_expr_path(self, i) |
268 | } |
269 | #[cfg (feature = "full" )] |
270 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
271 | fn fold_expr_range(&mut self, i: crate::ExprRange) -> crate::ExprRange { |
272 | fold_expr_range(self, i) |
273 | } |
274 | #[cfg (any(feature = "derive" , feature = "full" ))] |
275 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
276 | fn fold_expr_reference(&mut self, i: crate::ExprReference) -> crate::ExprReference { |
277 | fold_expr_reference(self, i) |
278 | } |
279 | #[cfg (feature = "full" )] |
280 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
281 | fn fold_expr_repeat(&mut self, i: crate::ExprRepeat) -> crate::ExprRepeat { |
282 | fold_expr_repeat(self, i) |
283 | } |
284 | #[cfg (feature = "full" )] |
285 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
286 | fn fold_expr_return(&mut self, i: crate::ExprReturn) -> crate::ExprReturn { |
287 | fold_expr_return(self, i) |
288 | } |
289 | #[cfg (any(feature = "derive" , feature = "full" ))] |
290 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
291 | fn fold_expr_struct(&mut self, i: crate::ExprStruct) -> crate::ExprStruct { |
292 | fold_expr_struct(self, i) |
293 | } |
294 | #[cfg (feature = "full" )] |
295 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
296 | fn fold_expr_try(&mut self, i: crate::ExprTry) -> crate::ExprTry { |
297 | fold_expr_try(self, i) |
298 | } |
299 | #[cfg (feature = "full" )] |
300 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
301 | fn fold_expr_try_block(&mut self, i: crate::ExprTryBlock) -> crate::ExprTryBlock { |
302 | fold_expr_try_block(self, i) |
303 | } |
304 | #[cfg (feature = "full" )] |
305 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
306 | fn fold_expr_tuple(&mut self, i: crate::ExprTuple) -> crate::ExprTuple { |
307 | fold_expr_tuple(self, i) |
308 | } |
309 | #[cfg (any(feature = "derive" , feature = "full" ))] |
310 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
311 | fn fold_expr_unary(&mut self, i: crate::ExprUnary) -> crate::ExprUnary { |
312 | fold_expr_unary(self, i) |
313 | } |
314 | #[cfg (feature = "full" )] |
315 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
316 | fn fold_expr_unsafe(&mut self, i: crate::ExprUnsafe) -> crate::ExprUnsafe { |
317 | fold_expr_unsafe(self, i) |
318 | } |
319 | #[cfg (feature = "full" )] |
320 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
321 | fn fold_expr_while(&mut self, i: crate::ExprWhile) -> crate::ExprWhile { |
322 | fold_expr_while(self, i) |
323 | } |
324 | #[cfg (feature = "full" )] |
325 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
326 | fn fold_expr_yield(&mut self, i: crate::ExprYield) -> crate::ExprYield { |
327 | fold_expr_yield(self, i) |
328 | } |
329 | #[cfg (any(feature = "derive" , feature = "full" ))] |
330 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
331 | fn fold_field(&mut self, i: crate::Field) -> crate::Field { |
332 | fold_field(self, i) |
333 | } |
334 | #[cfg (any(feature = "derive" , feature = "full" ))] |
335 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
336 | fn fold_field_mutability( |
337 | &mut self, |
338 | i: crate::FieldMutability, |
339 | ) -> crate::FieldMutability { |
340 | fold_field_mutability(self, i) |
341 | } |
342 | #[cfg (feature = "full" )] |
343 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
344 | fn fold_field_pat(&mut self, i: crate::FieldPat) -> crate::FieldPat { |
345 | fold_field_pat(self, i) |
346 | } |
347 | #[cfg (any(feature = "derive" , feature = "full" ))] |
348 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
349 | fn fold_field_value(&mut self, i: crate::FieldValue) -> crate::FieldValue { |
350 | fold_field_value(self, i) |
351 | } |
352 | #[cfg (any(feature = "derive" , feature = "full" ))] |
353 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
354 | fn fold_fields(&mut self, i: crate::Fields) -> crate::Fields { |
355 | fold_fields(self, i) |
356 | } |
357 | #[cfg (any(feature = "derive" , feature = "full" ))] |
358 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
359 | fn fold_fields_named(&mut self, i: crate::FieldsNamed) -> crate::FieldsNamed { |
360 | fold_fields_named(self, i) |
361 | } |
362 | #[cfg (any(feature = "derive" , feature = "full" ))] |
363 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
364 | fn fold_fields_unnamed(&mut self, i: crate::FieldsUnnamed) -> crate::FieldsUnnamed { |
365 | fold_fields_unnamed(self, i) |
366 | } |
367 | #[cfg (feature = "full" )] |
368 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
369 | fn fold_file(&mut self, i: crate::File) -> crate::File { |
370 | fold_file(self, i) |
371 | } |
372 | #[cfg (feature = "full" )] |
373 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
374 | fn fold_fn_arg(&mut self, i: crate::FnArg) -> crate::FnArg { |
375 | fold_fn_arg(self, i) |
376 | } |
377 | #[cfg (feature = "full" )] |
378 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
379 | fn fold_foreign_item(&mut self, i: crate::ForeignItem) -> crate::ForeignItem { |
380 | fold_foreign_item(self, i) |
381 | } |
382 | #[cfg (feature = "full" )] |
383 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
384 | fn fold_foreign_item_fn(&mut self, i: crate::ForeignItemFn) -> crate::ForeignItemFn { |
385 | fold_foreign_item_fn(self, i) |
386 | } |
387 | #[cfg (feature = "full" )] |
388 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
389 | fn fold_foreign_item_macro( |
390 | &mut self, |
391 | i: crate::ForeignItemMacro, |
392 | ) -> crate::ForeignItemMacro { |
393 | fold_foreign_item_macro(self, i) |
394 | } |
395 | #[cfg (feature = "full" )] |
396 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
397 | fn fold_foreign_item_static( |
398 | &mut self, |
399 | i: crate::ForeignItemStatic, |
400 | ) -> crate::ForeignItemStatic { |
401 | fold_foreign_item_static(self, i) |
402 | } |
403 | #[cfg (feature = "full" )] |
404 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
405 | fn fold_foreign_item_type( |
406 | &mut self, |
407 | i: crate::ForeignItemType, |
408 | ) -> crate::ForeignItemType { |
409 | fold_foreign_item_type(self, i) |
410 | } |
411 | #[cfg (any(feature = "derive" , feature = "full" ))] |
412 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
413 | fn fold_generic_argument( |
414 | &mut self, |
415 | i: crate::GenericArgument, |
416 | ) -> crate::GenericArgument { |
417 | fold_generic_argument(self, i) |
418 | } |
419 | #[cfg (any(feature = "derive" , feature = "full" ))] |
420 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
421 | fn fold_generic_param(&mut self, i: crate::GenericParam) -> crate::GenericParam { |
422 | fold_generic_param(self, i) |
423 | } |
424 | #[cfg (any(feature = "derive" , feature = "full" ))] |
425 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
426 | fn fold_generics(&mut self, i: crate::Generics) -> crate::Generics { |
427 | fold_generics(self, i) |
428 | } |
429 | fn fold_ident(&mut self, i: proc_macro2::Ident) -> proc_macro2::Ident { |
430 | fold_ident(self, i) |
431 | } |
432 | #[cfg (feature = "full" )] |
433 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
434 | fn fold_impl_item(&mut self, i: crate::ImplItem) -> crate::ImplItem { |
435 | fold_impl_item(self, i) |
436 | } |
437 | #[cfg (feature = "full" )] |
438 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
439 | fn fold_impl_item_const(&mut self, i: crate::ImplItemConst) -> crate::ImplItemConst { |
440 | fold_impl_item_const(self, i) |
441 | } |
442 | #[cfg (feature = "full" )] |
443 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
444 | fn fold_impl_item_fn(&mut self, i: crate::ImplItemFn) -> crate::ImplItemFn { |
445 | fold_impl_item_fn(self, i) |
446 | } |
447 | #[cfg (feature = "full" )] |
448 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
449 | fn fold_impl_item_macro(&mut self, i: crate::ImplItemMacro) -> crate::ImplItemMacro { |
450 | fold_impl_item_macro(self, i) |
451 | } |
452 | #[cfg (feature = "full" )] |
453 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
454 | fn fold_impl_item_type(&mut self, i: crate::ImplItemType) -> crate::ImplItemType { |
455 | fold_impl_item_type(self, i) |
456 | } |
457 | #[cfg (feature = "full" )] |
458 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
459 | fn fold_impl_restriction( |
460 | &mut self, |
461 | i: crate::ImplRestriction, |
462 | ) -> crate::ImplRestriction { |
463 | fold_impl_restriction(self, i) |
464 | } |
465 | #[cfg (any(feature = "derive" , feature = "full" ))] |
466 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
467 | fn fold_index(&mut self, i: crate::Index) -> crate::Index { |
468 | fold_index(self, i) |
469 | } |
470 | #[cfg (feature = "full" )] |
471 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
472 | fn fold_item(&mut self, i: crate::Item) -> crate::Item { |
473 | fold_item(self, i) |
474 | } |
475 | #[cfg (feature = "full" )] |
476 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
477 | fn fold_item_const(&mut self, i: crate::ItemConst) -> crate::ItemConst { |
478 | fold_item_const(self, i) |
479 | } |
480 | #[cfg (feature = "full" )] |
481 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
482 | fn fold_item_enum(&mut self, i: crate::ItemEnum) -> crate::ItemEnum { |
483 | fold_item_enum(self, i) |
484 | } |
485 | #[cfg (feature = "full" )] |
486 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
487 | fn fold_item_extern_crate( |
488 | &mut self, |
489 | i: crate::ItemExternCrate, |
490 | ) -> crate::ItemExternCrate { |
491 | fold_item_extern_crate(self, i) |
492 | } |
493 | #[cfg (feature = "full" )] |
494 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
495 | fn fold_item_fn(&mut self, i: crate::ItemFn) -> crate::ItemFn { |
496 | fold_item_fn(self, i) |
497 | } |
498 | #[cfg (feature = "full" )] |
499 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
500 | fn fold_item_foreign_mod( |
501 | &mut self, |
502 | i: crate::ItemForeignMod, |
503 | ) -> crate::ItemForeignMod { |
504 | fold_item_foreign_mod(self, i) |
505 | } |
506 | #[cfg (feature = "full" )] |
507 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
508 | fn fold_item_impl(&mut self, i: crate::ItemImpl) -> crate::ItemImpl { |
509 | fold_item_impl(self, i) |
510 | } |
511 | #[cfg (feature = "full" )] |
512 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
513 | fn fold_item_macro(&mut self, i: crate::ItemMacro) -> crate::ItemMacro { |
514 | fold_item_macro(self, i) |
515 | } |
516 | #[cfg (feature = "full" )] |
517 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
518 | fn fold_item_mod(&mut self, i: crate::ItemMod) -> crate::ItemMod { |
519 | fold_item_mod(self, i) |
520 | } |
521 | #[cfg (feature = "full" )] |
522 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
523 | fn fold_item_static(&mut self, i: crate::ItemStatic) -> crate::ItemStatic { |
524 | fold_item_static(self, i) |
525 | } |
526 | #[cfg (feature = "full" )] |
527 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
528 | fn fold_item_struct(&mut self, i: crate::ItemStruct) -> crate::ItemStruct { |
529 | fold_item_struct(self, i) |
530 | } |
531 | #[cfg (feature = "full" )] |
532 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
533 | fn fold_item_trait(&mut self, i: crate::ItemTrait) -> crate::ItemTrait { |
534 | fold_item_trait(self, i) |
535 | } |
536 | #[cfg (feature = "full" )] |
537 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
538 | fn fold_item_trait_alias( |
539 | &mut self, |
540 | i: crate::ItemTraitAlias, |
541 | ) -> crate::ItemTraitAlias { |
542 | fold_item_trait_alias(self, i) |
543 | } |
544 | #[cfg (feature = "full" )] |
545 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
546 | fn fold_item_type(&mut self, i: crate::ItemType) -> crate::ItemType { |
547 | fold_item_type(self, i) |
548 | } |
549 | #[cfg (feature = "full" )] |
550 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
551 | fn fold_item_union(&mut self, i: crate::ItemUnion) -> crate::ItemUnion { |
552 | fold_item_union(self, i) |
553 | } |
554 | #[cfg (feature = "full" )] |
555 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
556 | fn fold_item_use(&mut self, i: crate::ItemUse) -> crate::ItemUse { |
557 | fold_item_use(self, i) |
558 | } |
559 | #[cfg (feature = "full" )] |
560 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
561 | fn fold_label(&mut self, i: crate::Label) -> crate::Label { |
562 | fold_label(self, i) |
563 | } |
564 | fn fold_lifetime(&mut self, i: crate::Lifetime) -> crate::Lifetime { |
565 | fold_lifetime(self, i) |
566 | } |
567 | #[cfg (any(feature = "derive" , feature = "full" ))] |
568 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
569 | fn fold_lifetime_param(&mut self, i: crate::LifetimeParam) -> crate::LifetimeParam { |
570 | fold_lifetime_param(self, i) |
571 | } |
572 | fn fold_lit(&mut self, i: crate::Lit) -> crate::Lit { |
573 | fold_lit(self, i) |
574 | } |
575 | fn fold_lit_bool(&mut self, i: crate::LitBool) -> crate::LitBool { |
576 | fold_lit_bool(self, i) |
577 | } |
578 | fn fold_lit_byte(&mut self, i: crate::LitByte) -> crate::LitByte { |
579 | fold_lit_byte(self, i) |
580 | } |
581 | fn fold_lit_byte_str(&mut self, i: crate::LitByteStr) -> crate::LitByteStr { |
582 | fold_lit_byte_str(self, i) |
583 | } |
584 | fn fold_lit_char(&mut self, i: crate::LitChar) -> crate::LitChar { |
585 | fold_lit_char(self, i) |
586 | } |
587 | fn fold_lit_float(&mut self, i: crate::LitFloat) -> crate::LitFloat { |
588 | fold_lit_float(self, i) |
589 | } |
590 | fn fold_lit_int(&mut self, i: crate::LitInt) -> crate::LitInt { |
591 | fold_lit_int(self, i) |
592 | } |
593 | fn fold_lit_str(&mut self, i: crate::LitStr) -> crate::LitStr { |
594 | fold_lit_str(self, i) |
595 | } |
596 | #[cfg (feature = "full" )] |
597 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
598 | fn fold_local(&mut self, i: crate::Local) -> crate::Local { |
599 | fold_local(self, i) |
600 | } |
601 | #[cfg (feature = "full" )] |
602 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
603 | fn fold_local_init(&mut self, i: crate::LocalInit) -> crate::LocalInit { |
604 | fold_local_init(self, i) |
605 | } |
606 | #[cfg (any(feature = "derive" , feature = "full" ))] |
607 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
608 | fn fold_macro(&mut self, i: crate::Macro) -> crate::Macro { |
609 | fold_macro(self, i) |
610 | } |
611 | #[cfg (any(feature = "derive" , feature = "full" ))] |
612 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
613 | fn fold_macro_delimiter( |
614 | &mut self, |
615 | i: crate::MacroDelimiter, |
616 | ) -> crate::MacroDelimiter { |
617 | fold_macro_delimiter(self, i) |
618 | } |
619 | #[cfg (any(feature = "derive" , feature = "full" ))] |
620 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
621 | fn fold_member(&mut self, i: crate::Member) -> crate::Member { |
622 | fold_member(self, i) |
623 | } |
624 | #[cfg (any(feature = "derive" , feature = "full" ))] |
625 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
626 | fn fold_meta(&mut self, i: crate::Meta) -> crate::Meta { |
627 | fold_meta(self, i) |
628 | } |
629 | #[cfg (any(feature = "derive" , feature = "full" ))] |
630 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
631 | fn fold_meta_list(&mut self, i: crate::MetaList) -> crate::MetaList { |
632 | fold_meta_list(self, i) |
633 | } |
634 | #[cfg (any(feature = "derive" , feature = "full" ))] |
635 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
636 | fn fold_meta_name_value(&mut self, i: crate::MetaNameValue) -> crate::MetaNameValue { |
637 | fold_meta_name_value(self, i) |
638 | } |
639 | #[cfg (any(feature = "derive" , feature = "full" ))] |
640 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
641 | fn fold_parenthesized_generic_arguments( |
642 | &mut self, |
643 | i: crate::ParenthesizedGenericArguments, |
644 | ) -> crate::ParenthesizedGenericArguments { |
645 | fold_parenthesized_generic_arguments(self, i) |
646 | } |
647 | #[cfg (feature = "full" )] |
648 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
649 | fn fold_pat(&mut self, i: crate::Pat) -> crate::Pat { |
650 | fold_pat(self, i) |
651 | } |
652 | #[cfg (feature = "full" )] |
653 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
654 | fn fold_pat_ident(&mut self, i: crate::PatIdent) -> crate::PatIdent { |
655 | fold_pat_ident(self, i) |
656 | } |
657 | #[cfg (feature = "full" )] |
658 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
659 | fn fold_pat_or(&mut self, i: crate::PatOr) -> crate::PatOr { |
660 | fold_pat_or(self, i) |
661 | } |
662 | #[cfg (feature = "full" )] |
663 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
664 | fn fold_pat_paren(&mut self, i: crate::PatParen) -> crate::PatParen { |
665 | fold_pat_paren(self, i) |
666 | } |
667 | #[cfg (feature = "full" )] |
668 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
669 | fn fold_pat_reference(&mut self, i: crate::PatReference) -> crate::PatReference { |
670 | fold_pat_reference(self, i) |
671 | } |
672 | #[cfg (feature = "full" )] |
673 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
674 | fn fold_pat_rest(&mut self, i: crate::PatRest) -> crate::PatRest { |
675 | fold_pat_rest(self, i) |
676 | } |
677 | #[cfg (feature = "full" )] |
678 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
679 | fn fold_pat_slice(&mut self, i: crate::PatSlice) -> crate::PatSlice { |
680 | fold_pat_slice(self, i) |
681 | } |
682 | #[cfg (feature = "full" )] |
683 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
684 | fn fold_pat_struct(&mut self, i: crate::PatStruct) -> crate::PatStruct { |
685 | fold_pat_struct(self, i) |
686 | } |
687 | #[cfg (feature = "full" )] |
688 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
689 | fn fold_pat_tuple(&mut self, i: crate::PatTuple) -> crate::PatTuple { |
690 | fold_pat_tuple(self, i) |
691 | } |
692 | #[cfg (feature = "full" )] |
693 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
694 | fn fold_pat_tuple_struct( |
695 | &mut self, |
696 | i: crate::PatTupleStruct, |
697 | ) -> crate::PatTupleStruct { |
698 | fold_pat_tuple_struct(self, i) |
699 | } |
700 | #[cfg (feature = "full" )] |
701 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
702 | fn fold_pat_type(&mut self, i: crate::PatType) -> crate::PatType { |
703 | fold_pat_type(self, i) |
704 | } |
705 | #[cfg (feature = "full" )] |
706 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
707 | fn fold_pat_wild(&mut self, i: crate::PatWild) -> crate::PatWild { |
708 | fold_pat_wild(self, i) |
709 | } |
710 | #[cfg (any(feature = "derive" , feature = "full" ))] |
711 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
712 | fn fold_path(&mut self, i: crate::Path) -> crate::Path { |
713 | fold_path(self, i) |
714 | } |
715 | #[cfg (any(feature = "derive" , feature = "full" ))] |
716 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
717 | fn fold_path_arguments(&mut self, i: crate::PathArguments) -> crate::PathArguments { |
718 | fold_path_arguments(self, i) |
719 | } |
720 | #[cfg (any(feature = "derive" , feature = "full" ))] |
721 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
722 | fn fold_path_segment(&mut self, i: crate::PathSegment) -> crate::PathSegment { |
723 | fold_path_segment(self, i) |
724 | } |
725 | #[cfg (any(feature = "derive" , feature = "full" ))] |
726 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
727 | fn fold_predicate_lifetime( |
728 | &mut self, |
729 | i: crate::PredicateLifetime, |
730 | ) -> crate::PredicateLifetime { |
731 | fold_predicate_lifetime(self, i) |
732 | } |
733 | #[cfg (any(feature = "derive" , feature = "full" ))] |
734 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
735 | fn fold_predicate_type(&mut self, i: crate::PredicateType) -> crate::PredicateType { |
736 | fold_predicate_type(self, i) |
737 | } |
738 | #[cfg (any(feature = "derive" , feature = "full" ))] |
739 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
740 | fn fold_qself(&mut self, i: crate::QSelf) -> crate::QSelf { |
741 | fold_qself(self, i) |
742 | } |
743 | #[cfg (feature = "full" )] |
744 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
745 | fn fold_range_limits(&mut self, i: crate::RangeLimits) -> crate::RangeLimits { |
746 | fold_range_limits(self, i) |
747 | } |
748 | #[cfg (feature = "full" )] |
749 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
750 | fn fold_receiver(&mut self, i: crate::Receiver) -> crate::Receiver { |
751 | fold_receiver(self, i) |
752 | } |
753 | #[cfg (any(feature = "derive" , feature = "full" ))] |
754 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
755 | fn fold_return_type(&mut self, i: crate::ReturnType) -> crate::ReturnType { |
756 | fold_return_type(self, i) |
757 | } |
758 | #[cfg (feature = "full" )] |
759 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
760 | fn fold_signature(&mut self, i: crate::Signature) -> crate::Signature { |
761 | fold_signature(self, i) |
762 | } |
763 | fn fold_span(&mut self, i: proc_macro2::Span) -> proc_macro2::Span { |
764 | fold_span(self, i) |
765 | } |
766 | #[cfg (feature = "full" )] |
767 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
768 | fn fold_static_mutability( |
769 | &mut self, |
770 | i: crate::StaticMutability, |
771 | ) -> crate::StaticMutability { |
772 | fold_static_mutability(self, i) |
773 | } |
774 | #[cfg (feature = "full" )] |
775 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
776 | fn fold_stmt(&mut self, i: crate::Stmt) -> crate::Stmt { |
777 | fold_stmt(self, i) |
778 | } |
779 | #[cfg (feature = "full" )] |
780 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
781 | fn fold_stmt_macro(&mut self, i: crate::StmtMacro) -> crate::StmtMacro { |
782 | fold_stmt_macro(self, i) |
783 | } |
784 | #[cfg (any(feature = "derive" , feature = "full" ))] |
785 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
786 | fn fold_trait_bound(&mut self, i: crate::TraitBound) -> crate::TraitBound { |
787 | fold_trait_bound(self, i) |
788 | } |
789 | #[cfg (any(feature = "derive" , feature = "full" ))] |
790 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
791 | fn fold_trait_bound_modifier( |
792 | &mut self, |
793 | i: crate::TraitBoundModifier, |
794 | ) -> crate::TraitBoundModifier { |
795 | fold_trait_bound_modifier(self, i) |
796 | } |
797 | #[cfg (feature = "full" )] |
798 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
799 | fn fold_trait_item(&mut self, i: crate::TraitItem) -> crate::TraitItem { |
800 | fold_trait_item(self, i) |
801 | } |
802 | #[cfg (feature = "full" )] |
803 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
804 | fn fold_trait_item_const( |
805 | &mut self, |
806 | i: crate::TraitItemConst, |
807 | ) -> crate::TraitItemConst { |
808 | fold_trait_item_const(self, i) |
809 | } |
810 | #[cfg (feature = "full" )] |
811 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
812 | fn fold_trait_item_fn(&mut self, i: crate::TraitItemFn) -> crate::TraitItemFn { |
813 | fold_trait_item_fn(self, i) |
814 | } |
815 | #[cfg (feature = "full" )] |
816 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
817 | fn fold_trait_item_macro( |
818 | &mut self, |
819 | i: crate::TraitItemMacro, |
820 | ) -> crate::TraitItemMacro { |
821 | fold_trait_item_macro(self, i) |
822 | } |
823 | #[cfg (feature = "full" )] |
824 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
825 | fn fold_trait_item_type(&mut self, i: crate::TraitItemType) -> crate::TraitItemType { |
826 | fold_trait_item_type(self, i) |
827 | } |
828 | #[cfg (any(feature = "derive" , feature = "full" ))] |
829 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
830 | fn fold_type(&mut self, i: crate::Type) -> crate::Type { |
831 | fold_type(self, i) |
832 | } |
833 | #[cfg (any(feature = "derive" , feature = "full" ))] |
834 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
835 | fn fold_type_array(&mut self, i: crate::TypeArray) -> crate::TypeArray { |
836 | fold_type_array(self, i) |
837 | } |
838 | #[cfg (any(feature = "derive" , feature = "full" ))] |
839 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
840 | fn fold_type_bare_fn(&mut self, i: crate::TypeBareFn) -> crate::TypeBareFn { |
841 | fold_type_bare_fn(self, i) |
842 | } |
843 | #[cfg (any(feature = "derive" , feature = "full" ))] |
844 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
845 | fn fold_type_group(&mut self, i: crate::TypeGroup) -> crate::TypeGroup { |
846 | fold_type_group(self, i) |
847 | } |
848 | #[cfg (any(feature = "derive" , feature = "full" ))] |
849 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
850 | fn fold_type_impl_trait(&mut self, i: crate::TypeImplTrait) -> crate::TypeImplTrait { |
851 | fold_type_impl_trait(self, i) |
852 | } |
853 | #[cfg (any(feature = "derive" , feature = "full" ))] |
854 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
855 | fn fold_type_infer(&mut self, i: crate::TypeInfer) -> crate::TypeInfer { |
856 | fold_type_infer(self, i) |
857 | } |
858 | #[cfg (any(feature = "derive" , feature = "full" ))] |
859 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
860 | fn fold_type_macro(&mut self, i: crate::TypeMacro) -> crate::TypeMacro { |
861 | fold_type_macro(self, i) |
862 | } |
863 | #[cfg (any(feature = "derive" , feature = "full" ))] |
864 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
865 | fn fold_type_never(&mut self, i: crate::TypeNever) -> crate::TypeNever { |
866 | fold_type_never(self, i) |
867 | } |
868 | #[cfg (any(feature = "derive" , feature = "full" ))] |
869 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
870 | fn fold_type_param(&mut self, i: crate::TypeParam) -> crate::TypeParam { |
871 | fold_type_param(self, i) |
872 | } |
873 | #[cfg (any(feature = "derive" , feature = "full" ))] |
874 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
875 | fn fold_type_param_bound( |
876 | &mut self, |
877 | i: crate::TypeParamBound, |
878 | ) -> crate::TypeParamBound { |
879 | fold_type_param_bound(self, i) |
880 | } |
881 | #[cfg (any(feature = "derive" , feature = "full" ))] |
882 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
883 | fn fold_type_paren(&mut self, i: crate::TypeParen) -> crate::TypeParen { |
884 | fold_type_paren(self, i) |
885 | } |
886 | #[cfg (any(feature = "derive" , feature = "full" ))] |
887 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
888 | fn fold_type_path(&mut self, i: crate::TypePath) -> crate::TypePath { |
889 | fold_type_path(self, i) |
890 | } |
891 | #[cfg (any(feature = "derive" , feature = "full" ))] |
892 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
893 | fn fold_type_ptr(&mut self, i: crate::TypePtr) -> crate::TypePtr { |
894 | fold_type_ptr(self, i) |
895 | } |
896 | #[cfg (any(feature = "derive" , feature = "full" ))] |
897 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
898 | fn fold_type_reference(&mut self, i: crate::TypeReference) -> crate::TypeReference { |
899 | fold_type_reference(self, i) |
900 | } |
901 | #[cfg (any(feature = "derive" , feature = "full" ))] |
902 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
903 | fn fold_type_slice(&mut self, i: crate::TypeSlice) -> crate::TypeSlice { |
904 | fold_type_slice(self, i) |
905 | } |
906 | #[cfg (any(feature = "derive" , feature = "full" ))] |
907 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
908 | fn fold_type_trait_object( |
909 | &mut self, |
910 | i: crate::TypeTraitObject, |
911 | ) -> crate::TypeTraitObject { |
912 | fold_type_trait_object(self, i) |
913 | } |
914 | #[cfg (any(feature = "derive" , feature = "full" ))] |
915 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
916 | fn fold_type_tuple(&mut self, i: crate::TypeTuple) -> crate::TypeTuple { |
917 | fold_type_tuple(self, i) |
918 | } |
919 | #[cfg (any(feature = "derive" , feature = "full" ))] |
920 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
921 | fn fold_un_op(&mut self, i: crate::UnOp) -> crate::UnOp { |
922 | fold_un_op(self, i) |
923 | } |
924 | #[cfg (feature = "full" )] |
925 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
926 | fn fold_use_glob(&mut self, i: crate::UseGlob) -> crate::UseGlob { |
927 | fold_use_glob(self, i) |
928 | } |
929 | #[cfg (feature = "full" )] |
930 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
931 | fn fold_use_group(&mut self, i: crate::UseGroup) -> crate::UseGroup { |
932 | fold_use_group(self, i) |
933 | } |
934 | #[cfg (feature = "full" )] |
935 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
936 | fn fold_use_name(&mut self, i: crate::UseName) -> crate::UseName { |
937 | fold_use_name(self, i) |
938 | } |
939 | #[cfg (feature = "full" )] |
940 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
941 | fn fold_use_path(&mut self, i: crate::UsePath) -> crate::UsePath { |
942 | fold_use_path(self, i) |
943 | } |
944 | #[cfg (feature = "full" )] |
945 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
946 | fn fold_use_rename(&mut self, i: crate::UseRename) -> crate::UseRename { |
947 | fold_use_rename(self, i) |
948 | } |
949 | #[cfg (feature = "full" )] |
950 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
951 | fn fold_use_tree(&mut self, i: crate::UseTree) -> crate::UseTree { |
952 | fold_use_tree(self, i) |
953 | } |
954 | #[cfg (feature = "full" )] |
955 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
956 | fn fold_variadic(&mut self, i: crate::Variadic) -> crate::Variadic { |
957 | fold_variadic(self, i) |
958 | } |
959 | #[cfg (any(feature = "derive" , feature = "full" ))] |
960 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
961 | fn fold_variant(&mut self, i: crate::Variant) -> crate::Variant { |
962 | fold_variant(self, i) |
963 | } |
964 | #[cfg (any(feature = "derive" , feature = "full" ))] |
965 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
966 | fn fold_vis_restricted(&mut self, i: crate::VisRestricted) -> crate::VisRestricted { |
967 | fold_vis_restricted(self, i) |
968 | } |
969 | #[cfg (any(feature = "derive" , feature = "full" ))] |
970 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
971 | fn fold_visibility(&mut self, i: crate::Visibility) -> crate::Visibility { |
972 | fold_visibility(self, i) |
973 | } |
974 | #[cfg (any(feature = "derive" , feature = "full" ))] |
975 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
976 | fn fold_where_clause(&mut self, i: crate::WhereClause) -> crate::WhereClause { |
977 | fold_where_clause(self, i) |
978 | } |
979 | #[cfg (any(feature = "derive" , feature = "full" ))] |
980 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
981 | fn fold_where_predicate( |
982 | &mut self, |
983 | i: crate::WherePredicate, |
984 | ) -> crate::WherePredicate { |
985 | fold_where_predicate(self, i) |
986 | } |
987 | } |
988 | #[cfg (any(feature = "derive" , feature = "full" ))] |
989 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
990 | pub fn fold_abi<F>(f: &mut F, node: crate::Abi) -> crate::Abi |
991 | where |
992 | F: Fold + ?Sized, |
993 | { |
994 | crate::Abi { |
995 | extern_token: node.extern_token, |
996 | name: (node.name).map(|it: LitStr| f.fold_lit_str(it)), |
997 | } |
998 | } |
999 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1000 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1001 | pub fn fold_angle_bracketed_generic_arguments<F>( |
1002 | f: &mut F, |
1003 | node: crate::AngleBracketedGenericArguments, |
1004 | ) -> crate::AngleBracketedGenericArguments |
1005 | where |
1006 | F: Fold + ?Sized, |
1007 | { |
1008 | crate::AngleBracketedGenericArguments { |
1009 | colon2_token: node.colon2_token, |
1010 | lt_token: node.lt_token, |
1011 | args: FoldHelper::lift(self:node.args, |it: GenericArgument| f.fold_generic_argument(it)), |
1012 | gt_token: node.gt_token, |
1013 | } |
1014 | } |
1015 | #[cfg (feature = "full" )] |
1016 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1017 | pub fn fold_arm<F>(f: &mut F, node: crate::Arm) -> crate::Arm |
1018 | where |
1019 | F: Fold + ?Sized, |
1020 | { |
1021 | crate::Arm { |
1022 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1023 | pat: f.fold_pat(node.pat), |
1024 | guard: (node.guard).map(|it: (If, Box)| ((it).0, Box::new(f.fold_expr(*(it).1)))), |
1025 | fat_arrow_token: node.fat_arrow_token, |
1026 | body: Box::new(f.fold_expr(*node.body)), |
1027 | comma: node.comma, |
1028 | } |
1029 | } |
1030 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1031 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1032 | pub fn fold_assoc_const<F>(f: &mut F, node: crate::AssocConst) -> crate::AssocConst |
1033 | where |
1034 | F: Fold + ?Sized, |
1035 | { |
1036 | crate::AssocConst { |
1037 | ident: f.fold_ident(node.ident), |
1038 | generics: (node.generics).map(|it: AngleBracketedGenericArguments| f.fold_angle_bracketed_generic_arguments(it)), |
1039 | eq_token: node.eq_token, |
1040 | value: f.fold_expr(node.value), |
1041 | } |
1042 | } |
1043 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1044 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1045 | pub fn fold_assoc_type<F>(f: &mut F, node: crate::AssocType) -> crate::AssocType |
1046 | where |
1047 | F: Fold + ?Sized, |
1048 | { |
1049 | crate::AssocType { |
1050 | ident: f.fold_ident(node.ident), |
1051 | generics: (node.generics).map(|it: AngleBracketedGenericArguments| f.fold_angle_bracketed_generic_arguments(it)), |
1052 | eq_token: node.eq_token, |
1053 | ty: f.fold_type(node.ty), |
1054 | } |
1055 | } |
1056 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1057 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1058 | pub fn fold_attr_style<F>(f: &mut F, node: crate::AttrStyle) -> crate::AttrStyle |
1059 | where |
1060 | F: Fold + ?Sized, |
1061 | { |
1062 | match node { |
1063 | crate::AttrStyle::Outer => crate::AttrStyle::Outer, |
1064 | crate::AttrStyle::Inner(_binding_0: Not) => crate::AttrStyle::Inner(_binding_0), |
1065 | } |
1066 | } |
1067 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1068 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1069 | pub fn fold_attribute<F>(f: &mut F, node: crate::Attribute) -> crate::Attribute |
1070 | where |
1071 | F: Fold + ?Sized, |
1072 | { |
1073 | crate::Attribute { |
1074 | pound_token: node.pound_token, |
1075 | style: f.fold_attr_style(node.style), |
1076 | bracket_token: node.bracket_token, |
1077 | meta: f.fold_meta(node.meta), |
1078 | } |
1079 | } |
1080 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1081 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1082 | pub fn fold_bare_fn_arg<F>(f: &mut F, node: crate::BareFnArg) -> crate::BareFnArg |
1083 | where |
1084 | F: Fold + ?Sized, |
1085 | { |
1086 | crate::BareFnArg { |
1087 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1088 | name: (node.name).map(|it: (Ident, Colon)| (f.fold_ident((it).0), (it).1)), |
1089 | ty: f.fold_type(node.ty), |
1090 | } |
1091 | } |
1092 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1093 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1094 | pub fn fold_bare_variadic<F>(f: &mut F, node: crate::BareVariadic) -> crate::BareVariadic |
1095 | where |
1096 | F: Fold + ?Sized, |
1097 | { |
1098 | crate::BareVariadic { |
1099 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1100 | name: (node.name).map(|it: (Ident, Colon)| (f.fold_ident((it).0), (it).1)), |
1101 | dots: node.dots, |
1102 | comma: node.comma, |
1103 | } |
1104 | } |
1105 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1106 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1107 | pub fn fold_bin_op<F>(f: &mut F, node: crate::BinOp) -> crate::BinOp |
1108 | where |
1109 | F: Fold + ?Sized, |
1110 | { |
1111 | match node { |
1112 | crate::BinOp::Add(_binding_0) => crate::BinOp::Add(_binding_0), |
1113 | crate::BinOp::Sub(_binding_0) => crate::BinOp::Sub(_binding_0), |
1114 | crate::BinOp::Mul(_binding_0) => crate::BinOp::Mul(_binding_0), |
1115 | crate::BinOp::Div(_binding_0) => crate::BinOp::Div(_binding_0), |
1116 | crate::BinOp::Rem(_binding_0) => crate::BinOp::Rem(_binding_0), |
1117 | crate::BinOp::And(_binding_0) => crate::BinOp::And(_binding_0), |
1118 | crate::BinOp::Or(_binding_0) => crate::BinOp::Or(_binding_0), |
1119 | crate::BinOp::BitXor(_binding_0) => crate::BinOp::BitXor(_binding_0), |
1120 | crate::BinOp::BitAnd(_binding_0) => crate::BinOp::BitAnd(_binding_0), |
1121 | crate::BinOp::BitOr(_binding_0) => crate::BinOp::BitOr(_binding_0), |
1122 | crate::BinOp::Shl(_binding_0) => crate::BinOp::Shl(_binding_0), |
1123 | crate::BinOp::Shr(_binding_0) => crate::BinOp::Shr(_binding_0), |
1124 | crate::BinOp::Eq(_binding_0) => crate::BinOp::Eq(_binding_0), |
1125 | crate::BinOp::Lt(_binding_0) => crate::BinOp::Lt(_binding_0), |
1126 | crate::BinOp::Le(_binding_0) => crate::BinOp::Le(_binding_0), |
1127 | crate::BinOp::Ne(_binding_0) => crate::BinOp::Ne(_binding_0), |
1128 | crate::BinOp::Ge(_binding_0) => crate::BinOp::Ge(_binding_0), |
1129 | crate::BinOp::Gt(_binding_0) => crate::BinOp::Gt(_binding_0), |
1130 | crate::BinOp::AddAssign(_binding_0) => crate::BinOp::AddAssign(_binding_0), |
1131 | crate::BinOp::SubAssign(_binding_0) => crate::BinOp::SubAssign(_binding_0), |
1132 | crate::BinOp::MulAssign(_binding_0) => crate::BinOp::MulAssign(_binding_0), |
1133 | crate::BinOp::DivAssign(_binding_0) => crate::BinOp::DivAssign(_binding_0), |
1134 | crate::BinOp::RemAssign(_binding_0) => crate::BinOp::RemAssign(_binding_0), |
1135 | crate::BinOp::BitXorAssign(_binding_0) => crate::BinOp::BitXorAssign(_binding_0), |
1136 | crate::BinOp::BitAndAssign(_binding_0) => crate::BinOp::BitAndAssign(_binding_0), |
1137 | crate::BinOp::BitOrAssign(_binding_0) => crate::BinOp::BitOrAssign(_binding_0), |
1138 | crate::BinOp::ShlAssign(_binding_0) => crate::BinOp::ShlAssign(_binding_0), |
1139 | crate::BinOp::ShrAssign(_binding_0) => crate::BinOp::ShrAssign(_binding_0), |
1140 | } |
1141 | } |
1142 | #[cfg (feature = "full" )] |
1143 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1144 | pub fn fold_block<F>(f: &mut F, node: crate::Block) -> crate::Block |
1145 | where |
1146 | F: Fold + ?Sized, |
1147 | { |
1148 | crate::Block { |
1149 | brace_token: node.brace_token, |
1150 | stmts: FoldHelper::lift(self:node.stmts, |it: Stmt| f.fold_stmt(it)), |
1151 | } |
1152 | } |
1153 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1154 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1155 | pub fn fold_bound_lifetimes<F>( |
1156 | f: &mut F, |
1157 | node: crate::BoundLifetimes, |
1158 | ) -> crate::BoundLifetimes |
1159 | where |
1160 | F: Fold + ?Sized, |
1161 | { |
1162 | crate::BoundLifetimes { |
1163 | for_token: node.for_token, |
1164 | lt_token: node.lt_token, |
1165 | lifetimes: FoldHelper::lift(self:node.lifetimes, |it: GenericParam| f.fold_generic_param(it)), |
1166 | gt_token: node.gt_token, |
1167 | } |
1168 | } |
1169 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1170 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1171 | pub fn fold_const_param<F>(f: &mut F, node: crate::ConstParam) -> crate::ConstParam |
1172 | where |
1173 | F: Fold + ?Sized, |
1174 | { |
1175 | crate::ConstParam { |
1176 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1177 | const_token: node.const_token, |
1178 | ident: f.fold_ident(node.ident), |
1179 | colon_token: node.colon_token, |
1180 | ty: f.fold_type(node.ty), |
1181 | eq_token: node.eq_token, |
1182 | default: (node.default).map(|it: Expr| f.fold_expr(it)), |
1183 | } |
1184 | } |
1185 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1186 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1187 | pub fn fold_constraint<F>(f: &mut F, node: crate::Constraint) -> crate::Constraint |
1188 | where |
1189 | F: Fold + ?Sized, |
1190 | { |
1191 | crate::Constraint { |
1192 | ident: f.fold_ident(node.ident), |
1193 | generics: (node.generics).map(|it: AngleBracketedGenericArguments| f.fold_angle_bracketed_generic_arguments(it)), |
1194 | colon_token: node.colon_token, |
1195 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
1196 | } |
1197 | } |
1198 | #[cfg (feature = "derive" )] |
1199 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
1200 | pub fn fold_data<F>(f: &mut F, node: crate::Data) -> crate::Data |
1201 | where |
1202 | F: Fold + ?Sized, |
1203 | { |
1204 | match node { |
1205 | crate::Data::Struct(_binding_0: DataStruct) => { |
1206 | crate::Data::Struct(f.fold_data_struct(_binding_0)) |
1207 | } |
1208 | crate::Data::Enum(_binding_0: DataEnum) => crate::Data::Enum(f.fold_data_enum(_binding_0)), |
1209 | crate::Data::Union(_binding_0: DataUnion) => { |
1210 | crate::Data::Union(f.fold_data_union(_binding_0)) |
1211 | } |
1212 | } |
1213 | } |
1214 | #[cfg (feature = "derive" )] |
1215 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
1216 | pub fn fold_data_enum<F>(f: &mut F, node: crate::DataEnum) -> crate::DataEnum |
1217 | where |
1218 | F: Fold + ?Sized, |
1219 | { |
1220 | crate::DataEnum { |
1221 | enum_token: node.enum_token, |
1222 | brace_token: node.brace_token, |
1223 | variants: FoldHelper::lift(self:node.variants, |it: Variant| f.fold_variant(it)), |
1224 | } |
1225 | } |
1226 | #[cfg (feature = "derive" )] |
1227 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
1228 | pub fn fold_data_struct<F>(f: &mut F, node: crate::DataStruct) -> crate::DataStruct |
1229 | where |
1230 | F: Fold + ?Sized, |
1231 | { |
1232 | crate::DataStruct { |
1233 | struct_token: node.struct_token, |
1234 | fields: f.fold_fields(node.fields), |
1235 | semi_token: node.semi_token, |
1236 | } |
1237 | } |
1238 | #[cfg (feature = "derive" )] |
1239 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
1240 | pub fn fold_data_union<F>(f: &mut F, node: crate::DataUnion) -> crate::DataUnion |
1241 | where |
1242 | F: Fold + ?Sized, |
1243 | { |
1244 | crate::DataUnion { |
1245 | union_token: node.union_token, |
1246 | fields: f.fold_fields_named(node.fields), |
1247 | } |
1248 | } |
1249 | #[cfg (feature = "derive" )] |
1250 | #[cfg_attr (doc_cfg, doc(cfg(feature = "derive" )))] |
1251 | pub fn fold_derive_input<F>(f: &mut F, node: crate::DeriveInput) -> crate::DeriveInput |
1252 | where |
1253 | F: Fold + ?Sized, |
1254 | { |
1255 | crate::DeriveInput { |
1256 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1257 | vis: f.fold_visibility(node.vis), |
1258 | ident: f.fold_ident(node.ident), |
1259 | generics: f.fold_generics(node.generics), |
1260 | data: f.fold_data(node.data), |
1261 | } |
1262 | } |
1263 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1264 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1265 | pub fn fold_expr<F>(f: &mut F, node: crate::Expr) -> crate::Expr |
1266 | where |
1267 | F: Fold + ?Sized, |
1268 | { |
1269 | match node { |
1270 | crate::Expr::Array(_binding_0) => { |
1271 | crate::Expr::Array(full!(f.fold_expr_array(_binding_0))) |
1272 | } |
1273 | crate::Expr::Assign(_binding_0) => { |
1274 | crate::Expr::Assign(full!(f.fold_expr_assign(_binding_0))) |
1275 | } |
1276 | crate::Expr::Async(_binding_0) => { |
1277 | crate::Expr::Async(full!(f.fold_expr_async(_binding_0))) |
1278 | } |
1279 | crate::Expr::Await(_binding_0) => { |
1280 | crate::Expr::Await(full!(f.fold_expr_await(_binding_0))) |
1281 | } |
1282 | crate::Expr::Binary(_binding_0) => { |
1283 | crate::Expr::Binary(f.fold_expr_binary(_binding_0)) |
1284 | } |
1285 | crate::Expr::Block(_binding_0) => { |
1286 | crate::Expr::Block(full!(f.fold_expr_block(_binding_0))) |
1287 | } |
1288 | crate::Expr::Break(_binding_0) => { |
1289 | crate::Expr::Break(full!(f.fold_expr_break(_binding_0))) |
1290 | } |
1291 | crate::Expr::Call(_binding_0) => crate::Expr::Call(f.fold_expr_call(_binding_0)), |
1292 | crate::Expr::Cast(_binding_0) => crate::Expr::Cast(f.fold_expr_cast(_binding_0)), |
1293 | crate::Expr::Closure(_binding_0) => { |
1294 | crate::Expr::Closure(full!(f.fold_expr_closure(_binding_0))) |
1295 | } |
1296 | crate::Expr::Const(_binding_0) => { |
1297 | crate::Expr::Const(full!(f.fold_expr_const(_binding_0))) |
1298 | } |
1299 | crate::Expr::Continue(_binding_0) => { |
1300 | crate::Expr::Continue(full!(f.fold_expr_continue(_binding_0))) |
1301 | } |
1302 | crate::Expr::Field(_binding_0) => { |
1303 | crate::Expr::Field(f.fold_expr_field(_binding_0)) |
1304 | } |
1305 | crate::Expr::ForLoop(_binding_0) => { |
1306 | crate::Expr::ForLoop(full!(f.fold_expr_for_loop(_binding_0))) |
1307 | } |
1308 | crate::Expr::Group(_binding_0) => { |
1309 | crate::Expr::Group(f.fold_expr_group(_binding_0)) |
1310 | } |
1311 | crate::Expr::If(_binding_0) => crate::Expr::If(full!(f.fold_expr_if(_binding_0))), |
1312 | crate::Expr::Index(_binding_0) => { |
1313 | crate::Expr::Index(f.fold_expr_index(_binding_0)) |
1314 | } |
1315 | crate::Expr::Infer(_binding_0) => { |
1316 | crate::Expr::Infer(full!(f.fold_expr_infer(_binding_0))) |
1317 | } |
1318 | crate::Expr::Let(_binding_0) => { |
1319 | crate::Expr::Let(full!(f.fold_expr_let(_binding_0))) |
1320 | } |
1321 | crate::Expr::Lit(_binding_0) => crate::Expr::Lit(f.fold_expr_lit(_binding_0)), |
1322 | crate::Expr::Loop(_binding_0) => { |
1323 | crate::Expr::Loop(full!(f.fold_expr_loop(_binding_0))) |
1324 | } |
1325 | crate::Expr::Macro(_binding_0) => { |
1326 | crate::Expr::Macro(f.fold_expr_macro(_binding_0)) |
1327 | } |
1328 | crate::Expr::Match(_binding_0) => { |
1329 | crate::Expr::Match(full!(f.fold_expr_match(_binding_0))) |
1330 | } |
1331 | crate::Expr::MethodCall(_binding_0) => { |
1332 | crate::Expr::MethodCall(f.fold_expr_method_call(_binding_0)) |
1333 | } |
1334 | crate::Expr::Paren(_binding_0) => { |
1335 | crate::Expr::Paren(f.fold_expr_paren(_binding_0)) |
1336 | } |
1337 | crate::Expr::Path(_binding_0) => crate::Expr::Path(f.fold_expr_path(_binding_0)), |
1338 | crate::Expr::Range(_binding_0) => { |
1339 | crate::Expr::Range(full!(f.fold_expr_range(_binding_0))) |
1340 | } |
1341 | crate::Expr::Reference(_binding_0) => { |
1342 | crate::Expr::Reference(f.fold_expr_reference(_binding_0)) |
1343 | } |
1344 | crate::Expr::Repeat(_binding_0) => { |
1345 | crate::Expr::Repeat(full!(f.fold_expr_repeat(_binding_0))) |
1346 | } |
1347 | crate::Expr::Return(_binding_0) => { |
1348 | crate::Expr::Return(full!(f.fold_expr_return(_binding_0))) |
1349 | } |
1350 | crate::Expr::Struct(_binding_0) => { |
1351 | crate::Expr::Struct(f.fold_expr_struct(_binding_0)) |
1352 | } |
1353 | crate::Expr::Try(_binding_0) => { |
1354 | crate::Expr::Try(full!(f.fold_expr_try(_binding_0))) |
1355 | } |
1356 | crate::Expr::TryBlock(_binding_0) => { |
1357 | crate::Expr::TryBlock(full!(f.fold_expr_try_block(_binding_0))) |
1358 | } |
1359 | crate::Expr::Tuple(_binding_0) => { |
1360 | crate::Expr::Tuple(full!(f.fold_expr_tuple(_binding_0))) |
1361 | } |
1362 | crate::Expr::Unary(_binding_0) => { |
1363 | crate::Expr::Unary(f.fold_expr_unary(_binding_0)) |
1364 | } |
1365 | crate::Expr::Unsafe(_binding_0) => { |
1366 | crate::Expr::Unsafe(full!(f.fold_expr_unsafe(_binding_0))) |
1367 | } |
1368 | crate::Expr::Verbatim(_binding_0) => crate::Expr::Verbatim(_binding_0), |
1369 | crate::Expr::While(_binding_0) => { |
1370 | crate::Expr::While(full!(f.fold_expr_while(_binding_0))) |
1371 | } |
1372 | crate::Expr::Yield(_binding_0) => { |
1373 | crate::Expr::Yield(full!(f.fold_expr_yield(_binding_0))) |
1374 | } |
1375 | } |
1376 | } |
1377 | #[cfg (feature = "full" )] |
1378 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1379 | pub fn fold_expr_array<F>(f: &mut F, node: crate::ExprArray) -> crate::ExprArray |
1380 | where |
1381 | F: Fold + ?Sized, |
1382 | { |
1383 | crate::ExprArray { |
1384 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1385 | bracket_token: node.bracket_token, |
1386 | elems: FoldHelper::lift(self:node.elems, |it: Expr| f.fold_expr(it)), |
1387 | } |
1388 | } |
1389 | #[cfg (feature = "full" )] |
1390 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1391 | pub fn fold_expr_assign<F>(f: &mut F, node: crate::ExprAssign) -> crate::ExprAssign |
1392 | where |
1393 | F: Fold + ?Sized, |
1394 | { |
1395 | crate::ExprAssign { |
1396 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1397 | left: Box::new(f.fold_expr(*node.left)), |
1398 | eq_token: node.eq_token, |
1399 | right: Box::new(f.fold_expr(*node.right)), |
1400 | } |
1401 | } |
1402 | #[cfg (feature = "full" )] |
1403 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1404 | pub fn fold_expr_async<F>(f: &mut F, node: crate::ExprAsync) -> crate::ExprAsync |
1405 | where |
1406 | F: Fold + ?Sized, |
1407 | { |
1408 | crate::ExprAsync { |
1409 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1410 | async_token: node.async_token, |
1411 | capture: node.capture, |
1412 | block: f.fold_block(node.block), |
1413 | } |
1414 | } |
1415 | #[cfg (feature = "full" )] |
1416 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1417 | pub fn fold_expr_await<F>(f: &mut F, node: crate::ExprAwait) -> crate::ExprAwait |
1418 | where |
1419 | F: Fold + ?Sized, |
1420 | { |
1421 | crate::ExprAwait { |
1422 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1423 | base: Box::new(f.fold_expr(*node.base)), |
1424 | dot_token: node.dot_token, |
1425 | await_token: node.await_token, |
1426 | } |
1427 | } |
1428 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1429 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1430 | pub fn fold_expr_binary<F>(f: &mut F, node: crate::ExprBinary) -> crate::ExprBinary |
1431 | where |
1432 | F: Fold + ?Sized, |
1433 | { |
1434 | crate::ExprBinary { |
1435 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1436 | left: Box::new(f.fold_expr(*node.left)), |
1437 | op: f.fold_bin_op(node.op), |
1438 | right: Box::new(f.fold_expr(*node.right)), |
1439 | } |
1440 | } |
1441 | #[cfg (feature = "full" )] |
1442 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1443 | pub fn fold_expr_block<F>(f: &mut F, node: crate::ExprBlock) -> crate::ExprBlock |
1444 | where |
1445 | F: Fold + ?Sized, |
1446 | { |
1447 | crate::ExprBlock { |
1448 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1449 | label: (node.label).map(|it: Label| f.fold_label(it)), |
1450 | block: f.fold_block(node.block), |
1451 | } |
1452 | } |
1453 | #[cfg (feature = "full" )] |
1454 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1455 | pub fn fold_expr_break<F>(f: &mut F, node: crate::ExprBreak) -> crate::ExprBreak |
1456 | where |
1457 | F: Fold + ?Sized, |
1458 | { |
1459 | crate::ExprBreak { |
1460 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1461 | break_token: node.break_token, |
1462 | label: (node.label).map(|it: Lifetime| f.fold_lifetime(it)), |
1463 | expr: (node.expr).map(|it: Box| Box::new(f.fold_expr(*it))), |
1464 | } |
1465 | } |
1466 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1467 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1468 | pub fn fold_expr_call<F>(f: &mut F, node: crate::ExprCall) -> crate::ExprCall |
1469 | where |
1470 | F: Fold + ?Sized, |
1471 | { |
1472 | crate::ExprCall { |
1473 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1474 | func: Box::new(f.fold_expr(*node.func)), |
1475 | paren_token: node.paren_token, |
1476 | args: FoldHelper::lift(self:node.args, |it: Expr| f.fold_expr(it)), |
1477 | } |
1478 | } |
1479 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1480 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1481 | pub fn fold_expr_cast<F>(f: &mut F, node: crate::ExprCast) -> crate::ExprCast |
1482 | where |
1483 | F: Fold + ?Sized, |
1484 | { |
1485 | crate::ExprCast { |
1486 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1487 | expr: Box::new(f.fold_expr(*node.expr)), |
1488 | as_token: node.as_token, |
1489 | ty: Box::new(f.fold_type(*node.ty)), |
1490 | } |
1491 | } |
1492 | #[cfg (feature = "full" )] |
1493 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1494 | pub fn fold_expr_closure<F>(f: &mut F, node: crate::ExprClosure) -> crate::ExprClosure |
1495 | where |
1496 | F: Fold + ?Sized, |
1497 | { |
1498 | crate::ExprClosure { |
1499 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1500 | lifetimes: (node.lifetimes).map(|it: BoundLifetimes| f.fold_bound_lifetimes(it)), |
1501 | constness: node.constness, |
1502 | movability: node.movability, |
1503 | asyncness: node.asyncness, |
1504 | capture: node.capture, |
1505 | or1_token: node.or1_token, |
1506 | inputs: FoldHelper::lift(self:node.inputs, |it: Pat| f.fold_pat(it)), |
1507 | or2_token: node.or2_token, |
1508 | output: f.fold_return_type(node.output), |
1509 | body: Box::new(f.fold_expr(*node.body)), |
1510 | } |
1511 | } |
1512 | #[cfg (feature = "full" )] |
1513 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1514 | pub fn fold_expr_const<F>(f: &mut F, node: crate::ExprConst) -> crate::ExprConst |
1515 | where |
1516 | F: Fold + ?Sized, |
1517 | { |
1518 | crate::ExprConst { |
1519 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1520 | const_token: node.const_token, |
1521 | block: f.fold_block(node.block), |
1522 | } |
1523 | } |
1524 | #[cfg (feature = "full" )] |
1525 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1526 | pub fn fold_expr_continue<F>(f: &mut F, node: crate::ExprContinue) -> crate::ExprContinue |
1527 | where |
1528 | F: Fold + ?Sized, |
1529 | { |
1530 | crate::ExprContinue { |
1531 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1532 | continue_token: node.continue_token, |
1533 | label: (node.label).map(|it: Lifetime| f.fold_lifetime(it)), |
1534 | } |
1535 | } |
1536 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1537 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1538 | pub fn fold_expr_field<F>(f: &mut F, node: crate::ExprField) -> crate::ExprField |
1539 | where |
1540 | F: Fold + ?Sized, |
1541 | { |
1542 | crate::ExprField { |
1543 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1544 | base: Box::new(f.fold_expr(*node.base)), |
1545 | dot_token: node.dot_token, |
1546 | member: f.fold_member(node.member), |
1547 | } |
1548 | } |
1549 | #[cfg (feature = "full" )] |
1550 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1551 | pub fn fold_expr_for_loop<F>(f: &mut F, node: crate::ExprForLoop) -> crate::ExprForLoop |
1552 | where |
1553 | F: Fold + ?Sized, |
1554 | { |
1555 | crate::ExprForLoop { |
1556 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1557 | label: (node.label).map(|it: Label| f.fold_label(it)), |
1558 | for_token: node.for_token, |
1559 | pat: Box::new(f.fold_pat(*node.pat)), |
1560 | in_token: node.in_token, |
1561 | expr: Box::new(f.fold_expr(*node.expr)), |
1562 | body: f.fold_block(node.body), |
1563 | } |
1564 | } |
1565 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1566 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1567 | pub fn fold_expr_group<F>(f: &mut F, node: crate::ExprGroup) -> crate::ExprGroup |
1568 | where |
1569 | F: Fold + ?Sized, |
1570 | { |
1571 | crate::ExprGroup { |
1572 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1573 | group_token: node.group_token, |
1574 | expr: Box::new(f.fold_expr(*node.expr)), |
1575 | } |
1576 | } |
1577 | #[cfg (feature = "full" )] |
1578 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1579 | pub fn fold_expr_if<F>(f: &mut F, node: crate::ExprIf) -> crate::ExprIf |
1580 | where |
1581 | F: Fold + ?Sized, |
1582 | { |
1583 | crate::ExprIf { |
1584 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1585 | if_token: node.if_token, |
1586 | cond: Box::new(f.fold_expr(*node.cond)), |
1587 | then_branch: f.fold_block(node.then_branch), |
1588 | else_branch: (node.else_branch) |
1589 | .map(|it: (Else, Box)| ((it).0, Box::new(f.fold_expr(*(it).1)))), |
1590 | } |
1591 | } |
1592 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1593 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1594 | pub fn fold_expr_index<F>(f: &mut F, node: crate::ExprIndex) -> crate::ExprIndex |
1595 | where |
1596 | F: Fold + ?Sized, |
1597 | { |
1598 | crate::ExprIndex { |
1599 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1600 | expr: Box::new(f.fold_expr(*node.expr)), |
1601 | bracket_token: node.bracket_token, |
1602 | index: Box::new(f.fold_expr(*node.index)), |
1603 | } |
1604 | } |
1605 | #[cfg (feature = "full" )] |
1606 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1607 | pub fn fold_expr_infer<F>(f: &mut F, node: crate::ExprInfer) -> crate::ExprInfer |
1608 | where |
1609 | F: Fold + ?Sized, |
1610 | { |
1611 | crate::ExprInfer { |
1612 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1613 | underscore_token: node.underscore_token, |
1614 | } |
1615 | } |
1616 | #[cfg (feature = "full" )] |
1617 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1618 | pub fn fold_expr_let<F>(f: &mut F, node: crate::ExprLet) -> crate::ExprLet |
1619 | where |
1620 | F: Fold + ?Sized, |
1621 | { |
1622 | crate::ExprLet { |
1623 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1624 | let_token: node.let_token, |
1625 | pat: Box::new(f.fold_pat(*node.pat)), |
1626 | eq_token: node.eq_token, |
1627 | expr: Box::new(f.fold_expr(*node.expr)), |
1628 | } |
1629 | } |
1630 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1631 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1632 | pub fn fold_expr_lit<F>(f: &mut F, node: crate::ExprLit) -> crate::ExprLit |
1633 | where |
1634 | F: Fold + ?Sized, |
1635 | { |
1636 | crate::ExprLit { |
1637 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1638 | lit: f.fold_lit(node.lit), |
1639 | } |
1640 | } |
1641 | #[cfg (feature = "full" )] |
1642 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1643 | pub fn fold_expr_loop<F>(f: &mut F, node: crate::ExprLoop) -> crate::ExprLoop |
1644 | where |
1645 | F: Fold + ?Sized, |
1646 | { |
1647 | crate::ExprLoop { |
1648 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1649 | label: (node.label).map(|it: Label| f.fold_label(it)), |
1650 | loop_token: node.loop_token, |
1651 | body: f.fold_block(node.body), |
1652 | } |
1653 | } |
1654 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1655 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1656 | pub fn fold_expr_macro<F>(f: &mut F, node: crate::ExprMacro) -> crate::ExprMacro |
1657 | where |
1658 | F: Fold + ?Sized, |
1659 | { |
1660 | crate::ExprMacro { |
1661 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1662 | mac: f.fold_macro(node.mac), |
1663 | } |
1664 | } |
1665 | #[cfg (feature = "full" )] |
1666 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1667 | pub fn fold_expr_match<F>(f: &mut F, node: crate::ExprMatch) -> crate::ExprMatch |
1668 | where |
1669 | F: Fold + ?Sized, |
1670 | { |
1671 | crate::ExprMatch { |
1672 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1673 | match_token: node.match_token, |
1674 | expr: Box::new(f.fold_expr(*node.expr)), |
1675 | brace_token: node.brace_token, |
1676 | arms: FoldHelper::lift(self:node.arms, |it: Arm| f.fold_arm(it)), |
1677 | } |
1678 | } |
1679 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1680 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1681 | pub fn fold_expr_method_call<F>( |
1682 | f: &mut F, |
1683 | node: crate::ExprMethodCall, |
1684 | ) -> crate::ExprMethodCall |
1685 | where |
1686 | F: Fold + ?Sized, |
1687 | { |
1688 | crate::ExprMethodCall { |
1689 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1690 | receiver: Box::new(f.fold_expr(*node.receiver)), |
1691 | dot_token: node.dot_token, |
1692 | method: f.fold_ident(node.method), |
1693 | turbofish: (node.turbofish) |
1694 | .map(|it: AngleBracketedGenericArguments| f.fold_angle_bracketed_generic_arguments(it)), |
1695 | paren_token: node.paren_token, |
1696 | args: FoldHelper::lift(self:node.args, |it: Expr| f.fold_expr(it)), |
1697 | } |
1698 | } |
1699 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1700 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1701 | pub fn fold_expr_paren<F>(f: &mut F, node: crate::ExprParen) -> crate::ExprParen |
1702 | where |
1703 | F: Fold + ?Sized, |
1704 | { |
1705 | crate::ExprParen { |
1706 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1707 | paren_token: node.paren_token, |
1708 | expr: Box::new(f.fold_expr(*node.expr)), |
1709 | } |
1710 | } |
1711 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1712 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1713 | pub fn fold_expr_path<F>(f: &mut F, node: crate::ExprPath) -> crate::ExprPath |
1714 | where |
1715 | F: Fold + ?Sized, |
1716 | { |
1717 | crate::ExprPath { |
1718 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1719 | qself: (node.qself).map(|it: QSelf| f.fold_qself(it)), |
1720 | path: f.fold_path(node.path), |
1721 | } |
1722 | } |
1723 | #[cfg (feature = "full" )] |
1724 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1725 | pub fn fold_expr_range<F>(f: &mut F, node: crate::ExprRange) -> crate::ExprRange |
1726 | where |
1727 | F: Fold + ?Sized, |
1728 | { |
1729 | crate::ExprRange { |
1730 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1731 | start: (node.start).map(|it: Box| Box::new(f.fold_expr(*it))), |
1732 | limits: f.fold_range_limits(node.limits), |
1733 | end: (node.end).map(|it: Box| Box::new(f.fold_expr(*it))), |
1734 | } |
1735 | } |
1736 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1737 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1738 | pub fn fold_expr_reference<F>( |
1739 | f: &mut F, |
1740 | node: crate::ExprReference, |
1741 | ) -> crate::ExprReference |
1742 | where |
1743 | F: Fold + ?Sized, |
1744 | { |
1745 | crate::ExprReference { |
1746 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1747 | and_token: node.and_token, |
1748 | mutability: node.mutability, |
1749 | expr: Box::new(f.fold_expr(*node.expr)), |
1750 | } |
1751 | } |
1752 | #[cfg (feature = "full" )] |
1753 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1754 | pub fn fold_expr_repeat<F>(f: &mut F, node: crate::ExprRepeat) -> crate::ExprRepeat |
1755 | where |
1756 | F: Fold + ?Sized, |
1757 | { |
1758 | crate::ExprRepeat { |
1759 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1760 | bracket_token: node.bracket_token, |
1761 | expr: Box::new(f.fold_expr(*node.expr)), |
1762 | semi_token: node.semi_token, |
1763 | len: Box::new(f.fold_expr(*node.len)), |
1764 | } |
1765 | } |
1766 | #[cfg (feature = "full" )] |
1767 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1768 | pub fn fold_expr_return<F>(f: &mut F, node: crate::ExprReturn) -> crate::ExprReturn |
1769 | where |
1770 | F: Fold + ?Sized, |
1771 | { |
1772 | crate::ExprReturn { |
1773 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1774 | return_token: node.return_token, |
1775 | expr: (node.expr).map(|it: Box| Box::new(f.fold_expr(*it))), |
1776 | } |
1777 | } |
1778 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1779 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1780 | pub fn fold_expr_struct<F>(f: &mut F, node: crate::ExprStruct) -> crate::ExprStruct |
1781 | where |
1782 | F: Fold + ?Sized, |
1783 | { |
1784 | crate::ExprStruct { |
1785 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1786 | qself: (node.qself).map(|it: QSelf| f.fold_qself(it)), |
1787 | path: f.fold_path(node.path), |
1788 | brace_token: node.brace_token, |
1789 | fields: FoldHelper::lift(self:node.fields, |it: FieldValue| f.fold_field_value(it)), |
1790 | dot2_token: node.dot2_token, |
1791 | rest: (node.rest).map(|it: Box| Box::new(f.fold_expr(*it))), |
1792 | } |
1793 | } |
1794 | #[cfg (feature = "full" )] |
1795 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1796 | pub fn fold_expr_try<F>(f: &mut F, node: crate::ExprTry) -> crate::ExprTry |
1797 | where |
1798 | F: Fold + ?Sized, |
1799 | { |
1800 | crate::ExprTry { |
1801 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1802 | expr: Box::new(f.fold_expr(*node.expr)), |
1803 | question_token: node.question_token, |
1804 | } |
1805 | } |
1806 | #[cfg (feature = "full" )] |
1807 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1808 | pub fn fold_expr_try_block<F>( |
1809 | f: &mut F, |
1810 | node: crate::ExprTryBlock, |
1811 | ) -> crate::ExprTryBlock |
1812 | where |
1813 | F: Fold + ?Sized, |
1814 | { |
1815 | crate::ExprTryBlock { |
1816 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1817 | try_token: node.try_token, |
1818 | block: f.fold_block(node.block), |
1819 | } |
1820 | } |
1821 | #[cfg (feature = "full" )] |
1822 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1823 | pub fn fold_expr_tuple<F>(f: &mut F, node: crate::ExprTuple) -> crate::ExprTuple |
1824 | where |
1825 | F: Fold + ?Sized, |
1826 | { |
1827 | crate::ExprTuple { |
1828 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1829 | paren_token: node.paren_token, |
1830 | elems: FoldHelper::lift(self:node.elems, |it: Expr| f.fold_expr(it)), |
1831 | } |
1832 | } |
1833 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1834 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1835 | pub fn fold_expr_unary<F>(f: &mut F, node: crate::ExprUnary) -> crate::ExprUnary |
1836 | where |
1837 | F: Fold + ?Sized, |
1838 | { |
1839 | crate::ExprUnary { |
1840 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1841 | op: f.fold_un_op(node.op), |
1842 | expr: Box::new(f.fold_expr(*node.expr)), |
1843 | } |
1844 | } |
1845 | #[cfg (feature = "full" )] |
1846 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1847 | pub fn fold_expr_unsafe<F>(f: &mut F, node: crate::ExprUnsafe) -> crate::ExprUnsafe |
1848 | where |
1849 | F: Fold + ?Sized, |
1850 | { |
1851 | crate::ExprUnsafe { |
1852 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1853 | unsafe_token: node.unsafe_token, |
1854 | block: f.fold_block(node.block), |
1855 | } |
1856 | } |
1857 | #[cfg (feature = "full" )] |
1858 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1859 | pub fn fold_expr_while<F>(f: &mut F, node: crate::ExprWhile) -> crate::ExprWhile |
1860 | where |
1861 | F: Fold + ?Sized, |
1862 | { |
1863 | crate::ExprWhile { |
1864 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1865 | label: (node.label).map(|it: Label| f.fold_label(it)), |
1866 | while_token: node.while_token, |
1867 | cond: Box::new(f.fold_expr(*node.cond)), |
1868 | body: f.fold_block(node.body), |
1869 | } |
1870 | } |
1871 | #[cfg (feature = "full" )] |
1872 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1873 | pub fn fold_expr_yield<F>(f: &mut F, node: crate::ExprYield) -> crate::ExprYield |
1874 | where |
1875 | F: Fold + ?Sized, |
1876 | { |
1877 | crate::ExprYield { |
1878 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1879 | yield_token: node.yield_token, |
1880 | expr: (node.expr).map(|it: Box| Box::new(f.fold_expr(*it))), |
1881 | } |
1882 | } |
1883 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1884 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1885 | pub fn fold_field<F>(f: &mut F, node: crate::Field) -> crate::Field |
1886 | where |
1887 | F: Fold + ?Sized, |
1888 | { |
1889 | crate::Field { |
1890 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1891 | vis: f.fold_visibility(node.vis), |
1892 | mutability: f.fold_field_mutability(node.mutability), |
1893 | ident: (node.ident).map(|it: Ident| f.fold_ident(it)), |
1894 | colon_token: node.colon_token, |
1895 | ty: f.fold_type(node.ty), |
1896 | } |
1897 | } |
1898 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1899 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1900 | pub fn fold_field_mutability<F>( |
1901 | f: &mut F, |
1902 | node: crate::FieldMutability, |
1903 | ) -> crate::FieldMutability |
1904 | where |
1905 | F: Fold + ?Sized, |
1906 | { |
1907 | match node { |
1908 | crate::FieldMutability::None => crate::FieldMutability::None, |
1909 | } |
1910 | } |
1911 | #[cfg (feature = "full" )] |
1912 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1913 | pub fn fold_field_pat<F>(f: &mut F, node: crate::FieldPat) -> crate::FieldPat |
1914 | where |
1915 | F: Fold + ?Sized, |
1916 | { |
1917 | crate::FieldPat { |
1918 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1919 | member: f.fold_member(node.member), |
1920 | colon_token: node.colon_token, |
1921 | pat: Box::new(f.fold_pat(*node.pat)), |
1922 | } |
1923 | } |
1924 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1925 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1926 | pub fn fold_field_value<F>(f: &mut F, node: crate::FieldValue) -> crate::FieldValue |
1927 | where |
1928 | F: Fold + ?Sized, |
1929 | { |
1930 | crate::FieldValue { |
1931 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1932 | member: f.fold_member(node.member), |
1933 | colon_token: node.colon_token, |
1934 | expr: f.fold_expr(node.expr), |
1935 | } |
1936 | } |
1937 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1938 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1939 | pub fn fold_fields<F>(f: &mut F, node: crate::Fields) -> crate::Fields |
1940 | where |
1941 | F: Fold + ?Sized, |
1942 | { |
1943 | match node { |
1944 | crate::Fields::Named(_binding_0: FieldsNamed) => { |
1945 | crate::Fields::Named(f.fold_fields_named(_binding_0)) |
1946 | } |
1947 | crate::Fields::Unnamed(_binding_0: FieldsUnnamed) => { |
1948 | crate::Fields::Unnamed(f.fold_fields_unnamed(_binding_0)) |
1949 | } |
1950 | crate::Fields::Unit => crate::Fields::Unit, |
1951 | } |
1952 | } |
1953 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1954 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1955 | pub fn fold_fields_named<F>(f: &mut F, node: crate::FieldsNamed) -> crate::FieldsNamed |
1956 | where |
1957 | F: Fold + ?Sized, |
1958 | { |
1959 | crate::FieldsNamed { |
1960 | brace_token: node.brace_token, |
1961 | named: FoldHelper::lift(self:node.named, |it: Field| f.fold_field(it)), |
1962 | } |
1963 | } |
1964 | #[cfg (any(feature = "derive" , feature = "full" ))] |
1965 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
1966 | pub fn fold_fields_unnamed<F>( |
1967 | f: &mut F, |
1968 | node: crate::FieldsUnnamed, |
1969 | ) -> crate::FieldsUnnamed |
1970 | where |
1971 | F: Fold + ?Sized, |
1972 | { |
1973 | crate::FieldsUnnamed { |
1974 | paren_token: node.paren_token, |
1975 | unnamed: FoldHelper::lift(self:node.unnamed, |it: Field| f.fold_field(it)), |
1976 | } |
1977 | } |
1978 | #[cfg (feature = "full" )] |
1979 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1980 | pub fn fold_file<F>(f: &mut F, node: crate::File) -> crate::File |
1981 | where |
1982 | F: Fold + ?Sized, |
1983 | { |
1984 | crate::File { |
1985 | shebang: node.shebang, |
1986 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
1987 | items: FoldHelper::lift(self:node.items, |it: Item| f.fold_item(it)), |
1988 | } |
1989 | } |
1990 | #[cfg (feature = "full" )] |
1991 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
1992 | pub fn fold_fn_arg<F>(f: &mut F, node: crate::FnArg) -> crate::FnArg |
1993 | where |
1994 | F: Fold + ?Sized, |
1995 | { |
1996 | match node { |
1997 | crate::FnArg::Receiver(_binding_0: Receiver) => { |
1998 | crate::FnArg::Receiver(f.fold_receiver(_binding_0)) |
1999 | } |
2000 | crate::FnArg::Typed(_binding_0: PatType) => { |
2001 | crate::FnArg::Typed(f.fold_pat_type(_binding_0)) |
2002 | } |
2003 | } |
2004 | } |
2005 | #[cfg (feature = "full" )] |
2006 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2007 | pub fn fold_foreign_item<F>(f: &mut F, node: crate::ForeignItem) -> crate::ForeignItem |
2008 | where |
2009 | F: Fold + ?Sized, |
2010 | { |
2011 | match node { |
2012 | crate::ForeignItem::Fn(_binding_0: ForeignItemFn) => { |
2013 | crate::ForeignItem::Fn(f.fold_foreign_item_fn(_binding_0)) |
2014 | } |
2015 | crate::ForeignItem::Static(_binding_0: ForeignItemStatic) => { |
2016 | crate::ForeignItem::Static(f.fold_foreign_item_static(_binding_0)) |
2017 | } |
2018 | crate::ForeignItem::Type(_binding_0: ForeignItemType) => { |
2019 | crate::ForeignItem::Type(f.fold_foreign_item_type(_binding_0)) |
2020 | } |
2021 | crate::ForeignItem::Macro(_binding_0: ForeignItemMacro) => { |
2022 | crate::ForeignItem::Macro(f.fold_foreign_item_macro(_binding_0)) |
2023 | } |
2024 | crate::ForeignItem::Verbatim(_binding_0: TokenStream) => { |
2025 | crate::ForeignItem::Verbatim(_binding_0) |
2026 | } |
2027 | } |
2028 | } |
2029 | #[cfg (feature = "full" )] |
2030 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2031 | pub fn fold_foreign_item_fn<F>( |
2032 | f: &mut F, |
2033 | node: crate::ForeignItemFn, |
2034 | ) -> crate::ForeignItemFn |
2035 | where |
2036 | F: Fold + ?Sized, |
2037 | { |
2038 | crate::ForeignItemFn { |
2039 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2040 | vis: f.fold_visibility(node.vis), |
2041 | sig: f.fold_signature(node.sig), |
2042 | semi_token: node.semi_token, |
2043 | } |
2044 | } |
2045 | #[cfg (feature = "full" )] |
2046 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2047 | pub fn fold_foreign_item_macro<F>( |
2048 | f: &mut F, |
2049 | node: crate::ForeignItemMacro, |
2050 | ) -> crate::ForeignItemMacro |
2051 | where |
2052 | F: Fold + ?Sized, |
2053 | { |
2054 | crate::ForeignItemMacro { |
2055 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2056 | mac: f.fold_macro(node.mac), |
2057 | semi_token: node.semi_token, |
2058 | } |
2059 | } |
2060 | #[cfg (feature = "full" )] |
2061 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2062 | pub fn fold_foreign_item_static<F>( |
2063 | f: &mut F, |
2064 | node: crate::ForeignItemStatic, |
2065 | ) -> crate::ForeignItemStatic |
2066 | where |
2067 | F: Fold + ?Sized, |
2068 | { |
2069 | crate::ForeignItemStatic { |
2070 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2071 | vis: f.fold_visibility(node.vis), |
2072 | static_token: node.static_token, |
2073 | mutability: f.fold_static_mutability(node.mutability), |
2074 | ident: f.fold_ident(node.ident), |
2075 | colon_token: node.colon_token, |
2076 | ty: Box::new(f.fold_type(*node.ty)), |
2077 | semi_token: node.semi_token, |
2078 | } |
2079 | } |
2080 | #[cfg (feature = "full" )] |
2081 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2082 | pub fn fold_foreign_item_type<F>( |
2083 | f: &mut F, |
2084 | node: crate::ForeignItemType, |
2085 | ) -> crate::ForeignItemType |
2086 | where |
2087 | F: Fold + ?Sized, |
2088 | { |
2089 | crate::ForeignItemType { |
2090 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2091 | vis: f.fold_visibility(node.vis), |
2092 | type_token: node.type_token, |
2093 | ident: f.fold_ident(node.ident), |
2094 | generics: f.fold_generics(node.generics), |
2095 | semi_token: node.semi_token, |
2096 | } |
2097 | } |
2098 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2099 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2100 | pub fn fold_generic_argument<F>( |
2101 | f: &mut F, |
2102 | node: crate::GenericArgument, |
2103 | ) -> crate::GenericArgument |
2104 | where |
2105 | F: Fold + ?Sized, |
2106 | { |
2107 | match node { |
2108 | crate::GenericArgument::Lifetime(_binding_0: Lifetime) => { |
2109 | crate::GenericArgument::Lifetime(f.fold_lifetime(_binding_0)) |
2110 | } |
2111 | crate::GenericArgument::Type(_binding_0: Type) => { |
2112 | crate::GenericArgument::Type(f.fold_type(_binding_0)) |
2113 | } |
2114 | crate::GenericArgument::Const(_binding_0: Expr) => { |
2115 | crate::GenericArgument::Const(f.fold_expr(_binding_0)) |
2116 | } |
2117 | crate::GenericArgument::AssocType(_binding_0: AssocType) => { |
2118 | crate::GenericArgument::AssocType(f.fold_assoc_type(_binding_0)) |
2119 | } |
2120 | crate::GenericArgument::AssocConst(_binding_0: AssocConst) => { |
2121 | crate::GenericArgument::AssocConst(f.fold_assoc_const(_binding_0)) |
2122 | } |
2123 | crate::GenericArgument::Constraint(_binding_0: Constraint) => { |
2124 | crate::GenericArgument::Constraint(f.fold_constraint(_binding_0)) |
2125 | } |
2126 | } |
2127 | } |
2128 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2129 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2130 | pub fn fold_generic_param<F>(f: &mut F, node: crate::GenericParam) -> crate::GenericParam |
2131 | where |
2132 | F: Fold + ?Sized, |
2133 | { |
2134 | match node { |
2135 | crate::GenericParam::Lifetime(_binding_0: LifetimeParam) => { |
2136 | crate::GenericParam::Lifetime(f.fold_lifetime_param(_binding_0)) |
2137 | } |
2138 | crate::GenericParam::Type(_binding_0: TypeParam) => { |
2139 | crate::GenericParam::Type(f.fold_type_param(_binding_0)) |
2140 | } |
2141 | crate::GenericParam::Const(_binding_0: ConstParam) => { |
2142 | crate::GenericParam::Const(f.fold_const_param(_binding_0)) |
2143 | } |
2144 | } |
2145 | } |
2146 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2147 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2148 | pub fn fold_generics<F>(f: &mut F, node: crate::Generics) -> crate::Generics |
2149 | where |
2150 | F: Fold + ?Sized, |
2151 | { |
2152 | crate::Generics { |
2153 | lt_token: node.lt_token, |
2154 | params: FoldHelper::lift(self:node.params, |it: GenericParam| f.fold_generic_param(it)), |
2155 | gt_token: node.gt_token, |
2156 | where_clause: (node.where_clause).map(|it: WhereClause| f.fold_where_clause(it)), |
2157 | } |
2158 | } |
2159 | pub fn fold_ident<F>(f: &mut F, node: proc_macro2::Ident) -> proc_macro2::Ident |
2160 | where |
2161 | F: Fold + ?Sized, |
2162 | { |
2163 | let mut node: Ident = node; |
2164 | let span: Span = f.fold_span(node.span()); |
2165 | node.set_span(span); |
2166 | node |
2167 | } |
2168 | #[cfg (feature = "full" )] |
2169 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2170 | pub fn fold_impl_item<F>(f: &mut F, node: crate::ImplItem) -> crate::ImplItem |
2171 | where |
2172 | F: Fold + ?Sized, |
2173 | { |
2174 | match node { |
2175 | crate::ImplItem::Const(_binding_0: ImplItemConst) => { |
2176 | crate::ImplItem::Const(f.fold_impl_item_const(_binding_0)) |
2177 | } |
2178 | crate::ImplItem::Fn(_binding_0: ImplItemFn) => { |
2179 | crate::ImplItem::Fn(f.fold_impl_item_fn(_binding_0)) |
2180 | } |
2181 | crate::ImplItem::Type(_binding_0: ImplItemType) => { |
2182 | crate::ImplItem::Type(f.fold_impl_item_type(_binding_0)) |
2183 | } |
2184 | crate::ImplItem::Macro(_binding_0: ImplItemMacro) => { |
2185 | crate::ImplItem::Macro(f.fold_impl_item_macro(_binding_0)) |
2186 | } |
2187 | crate::ImplItem::Verbatim(_binding_0: TokenStream) => crate::ImplItem::Verbatim(_binding_0), |
2188 | } |
2189 | } |
2190 | #[cfg (feature = "full" )] |
2191 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2192 | pub fn fold_impl_item_const<F>( |
2193 | f: &mut F, |
2194 | node: crate::ImplItemConst, |
2195 | ) -> crate::ImplItemConst |
2196 | where |
2197 | F: Fold + ?Sized, |
2198 | { |
2199 | crate::ImplItemConst { |
2200 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2201 | vis: f.fold_visibility(node.vis), |
2202 | defaultness: node.defaultness, |
2203 | const_token: node.const_token, |
2204 | ident: f.fold_ident(node.ident), |
2205 | generics: f.fold_generics(node.generics), |
2206 | colon_token: node.colon_token, |
2207 | ty: f.fold_type(node.ty), |
2208 | eq_token: node.eq_token, |
2209 | expr: f.fold_expr(node.expr), |
2210 | semi_token: node.semi_token, |
2211 | } |
2212 | } |
2213 | #[cfg (feature = "full" )] |
2214 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2215 | pub fn fold_impl_item_fn<F>(f: &mut F, node: crate::ImplItemFn) -> crate::ImplItemFn |
2216 | where |
2217 | F: Fold + ?Sized, |
2218 | { |
2219 | crate::ImplItemFn { |
2220 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2221 | vis: f.fold_visibility(node.vis), |
2222 | defaultness: node.defaultness, |
2223 | sig: f.fold_signature(node.sig), |
2224 | block: f.fold_block(node.block), |
2225 | } |
2226 | } |
2227 | #[cfg (feature = "full" )] |
2228 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2229 | pub fn fold_impl_item_macro<F>( |
2230 | f: &mut F, |
2231 | node: crate::ImplItemMacro, |
2232 | ) -> crate::ImplItemMacro |
2233 | where |
2234 | F: Fold + ?Sized, |
2235 | { |
2236 | crate::ImplItemMacro { |
2237 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2238 | mac: f.fold_macro(node.mac), |
2239 | semi_token: node.semi_token, |
2240 | } |
2241 | } |
2242 | #[cfg (feature = "full" )] |
2243 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2244 | pub fn fold_impl_item_type<F>( |
2245 | f: &mut F, |
2246 | node: crate::ImplItemType, |
2247 | ) -> crate::ImplItemType |
2248 | where |
2249 | F: Fold + ?Sized, |
2250 | { |
2251 | crate::ImplItemType { |
2252 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2253 | vis: f.fold_visibility(node.vis), |
2254 | defaultness: node.defaultness, |
2255 | type_token: node.type_token, |
2256 | ident: f.fold_ident(node.ident), |
2257 | generics: f.fold_generics(node.generics), |
2258 | eq_token: node.eq_token, |
2259 | ty: f.fold_type(node.ty), |
2260 | semi_token: node.semi_token, |
2261 | } |
2262 | } |
2263 | #[cfg (feature = "full" )] |
2264 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2265 | pub fn fold_impl_restriction<F>( |
2266 | f: &mut F, |
2267 | node: crate::ImplRestriction, |
2268 | ) -> crate::ImplRestriction |
2269 | where |
2270 | F: Fold + ?Sized, |
2271 | { |
2272 | match node {} |
2273 | } |
2274 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2275 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2276 | pub fn fold_index<F>(f: &mut F, node: crate::Index) -> crate::Index |
2277 | where |
2278 | F: Fold + ?Sized, |
2279 | { |
2280 | crate::Index { |
2281 | index: node.index, |
2282 | span: f.fold_span(node.span), |
2283 | } |
2284 | } |
2285 | #[cfg (feature = "full" )] |
2286 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2287 | pub fn fold_item<F>(f: &mut F, node: crate::Item) -> crate::Item |
2288 | where |
2289 | F: Fold + ?Sized, |
2290 | { |
2291 | match node { |
2292 | crate::Item::Const(_binding_0) => { |
2293 | crate::Item::Const(f.fold_item_const(_binding_0)) |
2294 | } |
2295 | crate::Item::Enum(_binding_0) => crate::Item::Enum(f.fold_item_enum(_binding_0)), |
2296 | crate::Item::ExternCrate(_binding_0) => { |
2297 | crate::Item::ExternCrate(f.fold_item_extern_crate(_binding_0)) |
2298 | } |
2299 | crate::Item::Fn(_binding_0) => crate::Item::Fn(f.fold_item_fn(_binding_0)), |
2300 | crate::Item::ForeignMod(_binding_0) => { |
2301 | crate::Item::ForeignMod(f.fold_item_foreign_mod(_binding_0)) |
2302 | } |
2303 | crate::Item::Impl(_binding_0) => crate::Item::Impl(f.fold_item_impl(_binding_0)), |
2304 | crate::Item::Macro(_binding_0) => { |
2305 | crate::Item::Macro(f.fold_item_macro(_binding_0)) |
2306 | } |
2307 | crate::Item::Mod(_binding_0) => crate::Item::Mod(f.fold_item_mod(_binding_0)), |
2308 | crate::Item::Static(_binding_0) => { |
2309 | crate::Item::Static(f.fold_item_static(_binding_0)) |
2310 | } |
2311 | crate::Item::Struct(_binding_0) => { |
2312 | crate::Item::Struct(f.fold_item_struct(_binding_0)) |
2313 | } |
2314 | crate::Item::Trait(_binding_0) => { |
2315 | crate::Item::Trait(f.fold_item_trait(_binding_0)) |
2316 | } |
2317 | crate::Item::TraitAlias(_binding_0) => { |
2318 | crate::Item::TraitAlias(f.fold_item_trait_alias(_binding_0)) |
2319 | } |
2320 | crate::Item::Type(_binding_0) => crate::Item::Type(f.fold_item_type(_binding_0)), |
2321 | crate::Item::Union(_binding_0) => { |
2322 | crate::Item::Union(f.fold_item_union(_binding_0)) |
2323 | } |
2324 | crate::Item::Use(_binding_0) => crate::Item::Use(f.fold_item_use(_binding_0)), |
2325 | crate::Item::Verbatim(_binding_0) => crate::Item::Verbatim(_binding_0), |
2326 | } |
2327 | } |
2328 | #[cfg (feature = "full" )] |
2329 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2330 | pub fn fold_item_const<F>(f: &mut F, node: crate::ItemConst) -> crate::ItemConst |
2331 | where |
2332 | F: Fold + ?Sized, |
2333 | { |
2334 | crate::ItemConst { |
2335 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2336 | vis: f.fold_visibility(node.vis), |
2337 | const_token: node.const_token, |
2338 | ident: f.fold_ident(node.ident), |
2339 | generics: f.fold_generics(node.generics), |
2340 | colon_token: node.colon_token, |
2341 | ty: Box::new(f.fold_type(*node.ty)), |
2342 | eq_token: node.eq_token, |
2343 | expr: Box::new(f.fold_expr(*node.expr)), |
2344 | semi_token: node.semi_token, |
2345 | } |
2346 | } |
2347 | #[cfg (feature = "full" )] |
2348 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2349 | pub fn fold_item_enum<F>(f: &mut F, node: crate::ItemEnum) -> crate::ItemEnum |
2350 | where |
2351 | F: Fold + ?Sized, |
2352 | { |
2353 | crate::ItemEnum { |
2354 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2355 | vis: f.fold_visibility(node.vis), |
2356 | enum_token: node.enum_token, |
2357 | ident: f.fold_ident(node.ident), |
2358 | generics: f.fold_generics(node.generics), |
2359 | brace_token: node.brace_token, |
2360 | variants: FoldHelper::lift(self:node.variants, |it: Variant| f.fold_variant(it)), |
2361 | } |
2362 | } |
2363 | #[cfg (feature = "full" )] |
2364 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2365 | pub fn fold_item_extern_crate<F>( |
2366 | f: &mut F, |
2367 | node: crate::ItemExternCrate, |
2368 | ) -> crate::ItemExternCrate |
2369 | where |
2370 | F: Fold + ?Sized, |
2371 | { |
2372 | crate::ItemExternCrate { |
2373 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2374 | vis: f.fold_visibility(node.vis), |
2375 | extern_token: node.extern_token, |
2376 | crate_token: node.crate_token, |
2377 | ident: f.fold_ident(node.ident), |
2378 | rename: (node.rename).map(|it: (As, Ident)| ((it).0, f.fold_ident((it).1))), |
2379 | semi_token: node.semi_token, |
2380 | } |
2381 | } |
2382 | #[cfg (feature = "full" )] |
2383 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2384 | pub fn fold_item_fn<F>(f: &mut F, node: crate::ItemFn) -> crate::ItemFn |
2385 | where |
2386 | F: Fold + ?Sized, |
2387 | { |
2388 | crate::ItemFn { |
2389 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2390 | vis: f.fold_visibility(node.vis), |
2391 | sig: f.fold_signature(node.sig), |
2392 | block: Box::new(f.fold_block(*node.block)), |
2393 | } |
2394 | } |
2395 | #[cfg (feature = "full" )] |
2396 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2397 | pub fn fold_item_foreign_mod<F>( |
2398 | f: &mut F, |
2399 | node: crate::ItemForeignMod, |
2400 | ) -> crate::ItemForeignMod |
2401 | where |
2402 | F: Fold + ?Sized, |
2403 | { |
2404 | crate::ItemForeignMod { |
2405 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2406 | unsafety: node.unsafety, |
2407 | abi: f.fold_abi(node.abi), |
2408 | brace_token: node.brace_token, |
2409 | items: FoldHelper::lift(self:node.items, |it: ForeignItem| f.fold_foreign_item(it)), |
2410 | } |
2411 | } |
2412 | #[cfg (feature = "full" )] |
2413 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2414 | pub fn fold_item_impl<F>(f: &mut F, node: crate::ItemImpl) -> crate::ItemImpl |
2415 | where |
2416 | F: Fold + ?Sized, |
2417 | { |
2418 | crate::ItemImpl { |
2419 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2420 | defaultness: node.defaultness, |
2421 | unsafety: node.unsafety, |
2422 | impl_token: node.impl_token, |
2423 | generics: f.fold_generics(node.generics), |
2424 | trait_: (node.trait_).map(|it: (Option, Path, For)| ((it).0, f.fold_path((it).1), (it).2)), |
2425 | self_ty: Box::new(f.fold_type(*node.self_ty)), |
2426 | brace_token: node.brace_token, |
2427 | items: FoldHelper::lift(self:node.items, |it: ImplItem| f.fold_impl_item(it)), |
2428 | } |
2429 | } |
2430 | #[cfg (feature = "full" )] |
2431 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2432 | pub fn fold_item_macro<F>(f: &mut F, node: crate::ItemMacro) -> crate::ItemMacro |
2433 | where |
2434 | F: Fold + ?Sized, |
2435 | { |
2436 | crate::ItemMacro { |
2437 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2438 | ident: (node.ident).map(|it: Ident| f.fold_ident(it)), |
2439 | mac: f.fold_macro(node.mac), |
2440 | semi_token: node.semi_token, |
2441 | } |
2442 | } |
2443 | #[cfg (feature = "full" )] |
2444 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2445 | pub fn fold_item_mod<F>(f: &mut F, node: crate::ItemMod) -> crate::ItemMod |
2446 | where |
2447 | F: Fold + ?Sized, |
2448 | { |
2449 | crate::ItemMod { |
2450 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2451 | vis: f.fold_visibility(node.vis), |
2452 | unsafety: node.unsafety, |
2453 | mod_token: node.mod_token, |
2454 | ident: f.fold_ident(node.ident), |
2455 | content: (node.content) |
2456 | .map(|it: (Brace, Vec- )
| ((it).0, FoldHelper::lift((it).1, |it: Item| f.fold_item(it)))), |
2457 | semi: node.semi, |
2458 | } |
2459 | } |
2460 | #[cfg (feature = "full" )] |
2461 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2462 | pub fn fold_item_static<F>(f: &mut F, node: crate::ItemStatic) -> crate::ItemStatic |
2463 | where |
2464 | F: Fold + ?Sized, |
2465 | { |
2466 | crate::ItemStatic { |
2467 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2468 | vis: f.fold_visibility(node.vis), |
2469 | static_token: node.static_token, |
2470 | mutability: f.fold_static_mutability(node.mutability), |
2471 | ident: f.fold_ident(node.ident), |
2472 | colon_token: node.colon_token, |
2473 | ty: Box::new(f.fold_type(*node.ty)), |
2474 | eq_token: node.eq_token, |
2475 | expr: Box::new(f.fold_expr(*node.expr)), |
2476 | semi_token: node.semi_token, |
2477 | } |
2478 | } |
2479 | #[cfg (feature = "full" )] |
2480 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2481 | pub fn fold_item_struct<F>(f: &mut F, node: crate::ItemStruct) -> crate::ItemStruct |
2482 | where |
2483 | F: Fold + ?Sized, |
2484 | { |
2485 | crate::ItemStruct { |
2486 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2487 | vis: f.fold_visibility(node.vis), |
2488 | struct_token: node.struct_token, |
2489 | ident: f.fold_ident(node.ident), |
2490 | generics: f.fold_generics(node.generics), |
2491 | fields: f.fold_fields(node.fields), |
2492 | semi_token: node.semi_token, |
2493 | } |
2494 | } |
2495 | #[cfg (feature = "full" )] |
2496 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2497 | pub fn fold_item_trait<F>(f: &mut F, node: crate::ItemTrait) -> crate::ItemTrait |
2498 | where |
2499 | F: Fold + ?Sized, |
2500 | { |
2501 | crate::ItemTrait { |
2502 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2503 | vis: f.fold_visibility(node.vis), |
2504 | unsafety: node.unsafety, |
2505 | auto_token: node.auto_token, |
2506 | restriction: (node.restriction).map(|it: ImplRestriction| f.fold_impl_restriction(it)), |
2507 | trait_token: node.trait_token, |
2508 | ident: f.fold_ident(node.ident), |
2509 | generics: f.fold_generics(node.generics), |
2510 | colon_token: node.colon_token, |
2511 | supertraits: FoldHelper::lift( |
2512 | self:node.supertraits, |
2513 | |it: TypeParamBound| f.fold_type_param_bound(it), |
2514 | ), |
2515 | brace_token: node.brace_token, |
2516 | items: FoldHelper::lift(self:node.items, |it: TraitItem| f.fold_trait_item(it)), |
2517 | } |
2518 | } |
2519 | #[cfg (feature = "full" )] |
2520 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2521 | pub fn fold_item_trait_alias<F>( |
2522 | f: &mut F, |
2523 | node: crate::ItemTraitAlias, |
2524 | ) -> crate::ItemTraitAlias |
2525 | where |
2526 | F: Fold + ?Sized, |
2527 | { |
2528 | crate::ItemTraitAlias { |
2529 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2530 | vis: f.fold_visibility(node.vis), |
2531 | trait_token: node.trait_token, |
2532 | ident: f.fold_ident(node.ident), |
2533 | generics: f.fold_generics(node.generics), |
2534 | eq_token: node.eq_token, |
2535 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
2536 | semi_token: node.semi_token, |
2537 | } |
2538 | } |
2539 | #[cfg (feature = "full" )] |
2540 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2541 | pub fn fold_item_type<F>(f: &mut F, node: crate::ItemType) -> crate::ItemType |
2542 | where |
2543 | F: Fold + ?Sized, |
2544 | { |
2545 | crate::ItemType { |
2546 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2547 | vis: f.fold_visibility(node.vis), |
2548 | type_token: node.type_token, |
2549 | ident: f.fold_ident(node.ident), |
2550 | generics: f.fold_generics(node.generics), |
2551 | eq_token: node.eq_token, |
2552 | ty: Box::new(f.fold_type(*node.ty)), |
2553 | semi_token: node.semi_token, |
2554 | } |
2555 | } |
2556 | #[cfg (feature = "full" )] |
2557 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2558 | pub fn fold_item_union<F>(f: &mut F, node: crate::ItemUnion) -> crate::ItemUnion |
2559 | where |
2560 | F: Fold + ?Sized, |
2561 | { |
2562 | crate::ItemUnion { |
2563 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2564 | vis: f.fold_visibility(node.vis), |
2565 | union_token: node.union_token, |
2566 | ident: f.fold_ident(node.ident), |
2567 | generics: f.fold_generics(node.generics), |
2568 | fields: f.fold_fields_named(node.fields), |
2569 | } |
2570 | } |
2571 | #[cfg (feature = "full" )] |
2572 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2573 | pub fn fold_item_use<F>(f: &mut F, node: crate::ItemUse) -> crate::ItemUse |
2574 | where |
2575 | F: Fold + ?Sized, |
2576 | { |
2577 | crate::ItemUse { |
2578 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2579 | vis: f.fold_visibility(node.vis), |
2580 | use_token: node.use_token, |
2581 | leading_colon: node.leading_colon, |
2582 | tree: f.fold_use_tree(node.tree), |
2583 | semi_token: node.semi_token, |
2584 | } |
2585 | } |
2586 | #[cfg (feature = "full" )] |
2587 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2588 | pub fn fold_label<F>(f: &mut F, node: crate::Label) -> crate::Label |
2589 | where |
2590 | F: Fold + ?Sized, |
2591 | { |
2592 | crate::Label { |
2593 | name: f.fold_lifetime(node.name), |
2594 | colon_token: node.colon_token, |
2595 | } |
2596 | } |
2597 | pub fn fold_lifetime<F>(f: &mut F, node: crate::Lifetime) -> crate::Lifetime |
2598 | where |
2599 | F: Fold + ?Sized, |
2600 | { |
2601 | crate::Lifetime { |
2602 | apostrophe: f.fold_span(node.apostrophe), |
2603 | ident: f.fold_ident(node.ident), |
2604 | } |
2605 | } |
2606 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2607 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2608 | pub fn fold_lifetime_param<F>( |
2609 | f: &mut F, |
2610 | node: crate::LifetimeParam, |
2611 | ) -> crate::LifetimeParam |
2612 | where |
2613 | F: Fold + ?Sized, |
2614 | { |
2615 | crate::LifetimeParam { |
2616 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2617 | lifetime: f.fold_lifetime(node.lifetime), |
2618 | colon_token: node.colon_token, |
2619 | bounds: FoldHelper::lift(self:node.bounds, |it: Lifetime| f.fold_lifetime(it)), |
2620 | } |
2621 | } |
2622 | pub fn fold_lit<F>(f: &mut F, node: crate::Lit) -> crate::Lit |
2623 | where |
2624 | F: Fold + ?Sized, |
2625 | { |
2626 | match node { |
2627 | crate::Lit::Str(_binding_0: LitStr) => crate::Lit::Str(f.fold_lit_str(_binding_0)), |
2628 | crate::Lit::ByteStr(_binding_0: LitByteStr) => { |
2629 | crate::Lit::ByteStr(f.fold_lit_byte_str(_binding_0)) |
2630 | } |
2631 | crate::Lit::Byte(_binding_0: LitByte) => crate::Lit::Byte(f.fold_lit_byte(_binding_0)), |
2632 | crate::Lit::Char(_binding_0: LitChar) => crate::Lit::Char(f.fold_lit_char(_binding_0)), |
2633 | crate::Lit::Int(_binding_0: LitInt) => crate::Lit::Int(f.fold_lit_int(_binding_0)), |
2634 | crate::Lit::Float(_binding_0: LitFloat) => crate::Lit::Float(f.fold_lit_float(_binding_0)), |
2635 | crate::Lit::Bool(_binding_0: LitBool) => crate::Lit::Bool(f.fold_lit_bool(_binding_0)), |
2636 | crate::Lit::Verbatim(_binding_0: Literal) => crate::Lit::Verbatim(_binding_0), |
2637 | } |
2638 | } |
2639 | pub fn fold_lit_bool<F>(f: &mut F, node: crate::LitBool) -> crate::LitBool |
2640 | where |
2641 | F: Fold + ?Sized, |
2642 | { |
2643 | crate::LitBool { |
2644 | value: node.value, |
2645 | span: f.fold_span(node.span), |
2646 | } |
2647 | } |
2648 | pub fn fold_lit_byte<F>(f: &mut F, node: crate::LitByte) -> crate::LitByte |
2649 | where |
2650 | F: Fold + ?Sized, |
2651 | { |
2652 | let span: Span = f.fold_span(node.span()); |
2653 | let mut node: LitByte = node; |
2654 | node.set_span(span); |
2655 | node |
2656 | } |
2657 | pub fn fold_lit_byte_str<F>(f: &mut F, node: crate::LitByteStr) -> crate::LitByteStr |
2658 | where |
2659 | F: Fold + ?Sized, |
2660 | { |
2661 | let span: Span = f.fold_span(node.span()); |
2662 | let mut node: LitByteStr = node; |
2663 | node.set_span(span); |
2664 | node |
2665 | } |
2666 | pub fn fold_lit_char<F>(f: &mut F, node: crate::LitChar) -> crate::LitChar |
2667 | where |
2668 | F: Fold + ?Sized, |
2669 | { |
2670 | let span: Span = f.fold_span(node.span()); |
2671 | let mut node: LitChar = node; |
2672 | node.set_span(span); |
2673 | node |
2674 | } |
2675 | pub fn fold_lit_float<F>(f: &mut F, node: crate::LitFloat) -> crate::LitFloat |
2676 | where |
2677 | F: Fold + ?Sized, |
2678 | { |
2679 | let span: Span = f.fold_span(node.span()); |
2680 | let mut node: LitFloat = node; |
2681 | node.set_span(span); |
2682 | node |
2683 | } |
2684 | pub fn fold_lit_int<F>(f: &mut F, node: crate::LitInt) -> crate::LitInt |
2685 | where |
2686 | F: Fold + ?Sized, |
2687 | { |
2688 | let span: Span = f.fold_span(node.span()); |
2689 | let mut node: LitInt = node; |
2690 | node.set_span(span); |
2691 | node |
2692 | } |
2693 | pub fn fold_lit_str<F>(f: &mut F, node: crate::LitStr) -> crate::LitStr |
2694 | where |
2695 | F: Fold + ?Sized, |
2696 | { |
2697 | let span: Span = f.fold_span(node.span()); |
2698 | let mut node: LitStr = node; |
2699 | node.set_span(span); |
2700 | node |
2701 | } |
2702 | #[cfg (feature = "full" )] |
2703 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2704 | pub fn fold_local<F>(f: &mut F, node: crate::Local) -> crate::Local |
2705 | where |
2706 | F: Fold + ?Sized, |
2707 | { |
2708 | crate::Local { |
2709 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2710 | let_token: node.let_token, |
2711 | pat: f.fold_pat(node.pat), |
2712 | init: (node.init).map(|it: LocalInit| f.fold_local_init(it)), |
2713 | semi_token: node.semi_token, |
2714 | } |
2715 | } |
2716 | #[cfg (feature = "full" )] |
2717 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2718 | pub fn fold_local_init<F>(f: &mut F, node: crate::LocalInit) -> crate::LocalInit |
2719 | where |
2720 | F: Fold + ?Sized, |
2721 | { |
2722 | crate::LocalInit { |
2723 | eq_token: node.eq_token, |
2724 | expr: Box::new(f.fold_expr(*node.expr)), |
2725 | diverge: (node.diverge).map(|it: (Else, Box)| ((it).0, Box::new(f.fold_expr(*(it).1)))), |
2726 | } |
2727 | } |
2728 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2729 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2730 | pub fn fold_macro<F>(f: &mut F, node: crate::Macro) -> crate::Macro |
2731 | where |
2732 | F: Fold + ?Sized, |
2733 | { |
2734 | crate::Macro { |
2735 | path: f.fold_path(node.path), |
2736 | bang_token: node.bang_token, |
2737 | delimiter: f.fold_macro_delimiter(node.delimiter), |
2738 | tokens: node.tokens, |
2739 | } |
2740 | } |
2741 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2742 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2743 | pub fn fold_macro_delimiter<F>( |
2744 | f: &mut F, |
2745 | node: crate::MacroDelimiter, |
2746 | ) -> crate::MacroDelimiter |
2747 | where |
2748 | F: Fold + ?Sized, |
2749 | { |
2750 | match node { |
2751 | crate::MacroDelimiter::Paren(_binding_0: Paren) => { |
2752 | crate::MacroDelimiter::Paren(_binding_0) |
2753 | } |
2754 | crate::MacroDelimiter::Brace(_binding_0: Brace) => { |
2755 | crate::MacroDelimiter::Brace(_binding_0) |
2756 | } |
2757 | crate::MacroDelimiter::Bracket(_binding_0: Bracket) => { |
2758 | crate::MacroDelimiter::Bracket(_binding_0) |
2759 | } |
2760 | } |
2761 | } |
2762 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2763 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2764 | pub fn fold_member<F>(f: &mut F, node: crate::Member) -> crate::Member |
2765 | where |
2766 | F: Fold + ?Sized, |
2767 | { |
2768 | match node { |
2769 | crate::Member::Named(_binding_0: Ident) => { |
2770 | crate::Member::Named(f.fold_ident(_binding_0)) |
2771 | } |
2772 | crate::Member::Unnamed(_binding_0: Index) => { |
2773 | crate::Member::Unnamed(f.fold_index(_binding_0)) |
2774 | } |
2775 | } |
2776 | } |
2777 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2778 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2779 | pub fn fold_meta<F>(f: &mut F, node: crate::Meta) -> crate::Meta |
2780 | where |
2781 | F: Fold + ?Sized, |
2782 | { |
2783 | match node { |
2784 | crate::Meta::Path(_binding_0: Path) => crate::Meta::Path(f.fold_path(_binding_0)), |
2785 | crate::Meta::List(_binding_0: MetaList) => crate::Meta::List(f.fold_meta_list(_binding_0)), |
2786 | crate::Meta::NameValue(_binding_0: MetaNameValue) => { |
2787 | crate::Meta::NameValue(f.fold_meta_name_value(_binding_0)) |
2788 | } |
2789 | } |
2790 | } |
2791 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2792 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2793 | pub fn fold_meta_list<F>(f: &mut F, node: crate::MetaList) -> crate::MetaList |
2794 | where |
2795 | F: Fold + ?Sized, |
2796 | { |
2797 | crate::MetaList { |
2798 | path: f.fold_path(node.path), |
2799 | delimiter: f.fold_macro_delimiter(node.delimiter), |
2800 | tokens: node.tokens, |
2801 | } |
2802 | } |
2803 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2804 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2805 | pub fn fold_meta_name_value<F>( |
2806 | f: &mut F, |
2807 | node: crate::MetaNameValue, |
2808 | ) -> crate::MetaNameValue |
2809 | where |
2810 | F: Fold + ?Sized, |
2811 | { |
2812 | crate::MetaNameValue { |
2813 | path: f.fold_path(node.path), |
2814 | eq_token: node.eq_token, |
2815 | value: f.fold_expr(node.value), |
2816 | } |
2817 | } |
2818 | #[cfg (any(feature = "derive" , feature = "full" ))] |
2819 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
2820 | pub fn fold_parenthesized_generic_arguments<F>( |
2821 | f: &mut F, |
2822 | node: crate::ParenthesizedGenericArguments, |
2823 | ) -> crate::ParenthesizedGenericArguments |
2824 | where |
2825 | F: Fold + ?Sized, |
2826 | { |
2827 | crate::ParenthesizedGenericArguments { |
2828 | paren_token: node.paren_token, |
2829 | inputs: FoldHelper::lift(self:node.inputs, |it: Type| f.fold_type(it)), |
2830 | output: f.fold_return_type(node.output), |
2831 | } |
2832 | } |
2833 | #[cfg (feature = "full" )] |
2834 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2835 | pub fn fold_pat<F>(f: &mut F, node: crate::Pat) -> crate::Pat |
2836 | where |
2837 | F: Fold + ?Sized, |
2838 | { |
2839 | match node { |
2840 | crate::Pat::Const(_binding_0) => crate::Pat::Const(f.fold_expr_const(_binding_0)), |
2841 | crate::Pat::Ident(_binding_0) => crate::Pat::Ident(f.fold_pat_ident(_binding_0)), |
2842 | crate::Pat::Lit(_binding_0) => crate::Pat::Lit(f.fold_expr_lit(_binding_0)), |
2843 | crate::Pat::Macro(_binding_0) => crate::Pat::Macro(f.fold_expr_macro(_binding_0)), |
2844 | crate::Pat::Or(_binding_0) => crate::Pat::Or(f.fold_pat_or(_binding_0)), |
2845 | crate::Pat::Paren(_binding_0) => crate::Pat::Paren(f.fold_pat_paren(_binding_0)), |
2846 | crate::Pat::Path(_binding_0) => crate::Pat::Path(f.fold_expr_path(_binding_0)), |
2847 | crate::Pat::Range(_binding_0) => crate::Pat::Range(f.fold_expr_range(_binding_0)), |
2848 | crate::Pat::Reference(_binding_0) => { |
2849 | crate::Pat::Reference(f.fold_pat_reference(_binding_0)) |
2850 | } |
2851 | crate::Pat::Rest(_binding_0) => crate::Pat::Rest(f.fold_pat_rest(_binding_0)), |
2852 | crate::Pat::Slice(_binding_0) => crate::Pat::Slice(f.fold_pat_slice(_binding_0)), |
2853 | crate::Pat::Struct(_binding_0) => { |
2854 | crate::Pat::Struct(f.fold_pat_struct(_binding_0)) |
2855 | } |
2856 | crate::Pat::Tuple(_binding_0) => crate::Pat::Tuple(f.fold_pat_tuple(_binding_0)), |
2857 | crate::Pat::TupleStruct(_binding_0) => { |
2858 | crate::Pat::TupleStruct(f.fold_pat_tuple_struct(_binding_0)) |
2859 | } |
2860 | crate::Pat::Type(_binding_0) => crate::Pat::Type(f.fold_pat_type(_binding_0)), |
2861 | crate::Pat::Verbatim(_binding_0) => crate::Pat::Verbatim(_binding_0), |
2862 | crate::Pat::Wild(_binding_0) => crate::Pat::Wild(f.fold_pat_wild(_binding_0)), |
2863 | } |
2864 | } |
2865 | #[cfg (feature = "full" )] |
2866 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2867 | pub fn fold_pat_ident<F>(f: &mut F, node: crate::PatIdent) -> crate::PatIdent |
2868 | where |
2869 | F: Fold + ?Sized, |
2870 | { |
2871 | crate::PatIdent { |
2872 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2873 | by_ref: node.by_ref, |
2874 | mutability: node.mutability, |
2875 | ident: f.fold_ident(node.ident), |
2876 | subpat: (node.subpat).map(|it: (At, Box)| ((it).0, Box::new(f.fold_pat(*(it).1)))), |
2877 | } |
2878 | } |
2879 | #[cfg (feature = "full" )] |
2880 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2881 | pub fn fold_pat_or<F>(f: &mut F, node: crate::PatOr) -> crate::PatOr |
2882 | where |
2883 | F: Fold + ?Sized, |
2884 | { |
2885 | crate::PatOr { |
2886 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2887 | leading_vert: node.leading_vert, |
2888 | cases: FoldHelper::lift(self:node.cases, |it: Pat| f.fold_pat(it)), |
2889 | } |
2890 | } |
2891 | #[cfg (feature = "full" )] |
2892 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2893 | pub fn fold_pat_paren<F>(f: &mut F, node: crate::PatParen) -> crate::PatParen |
2894 | where |
2895 | F: Fold + ?Sized, |
2896 | { |
2897 | crate::PatParen { |
2898 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2899 | paren_token: node.paren_token, |
2900 | pat: Box::new(f.fold_pat(*node.pat)), |
2901 | } |
2902 | } |
2903 | #[cfg (feature = "full" )] |
2904 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2905 | pub fn fold_pat_reference<F>(f: &mut F, node: crate::PatReference) -> crate::PatReference |
2906 | where |
2907 | F: Fold + ?Sized, |
2908 | { |
2909 | crate::PatReference { |
2910 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2911 | and_token: node.and_token, |
2912 | mutability: node.mutability, |
2913 | pat: Box::new(f.fold_pat(*node.pat)), |
2914 | } |
2915 | } |
2916 | #[cfg (feature = "full" )] |
2917 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2918 | pub fn fold_pat_rest<F>(f: &mut F, node: crate::PatRest) -> crate::PatRest |
2919 | where |
2920 | F: Fold + ?Sized, |
2921 | { |
2922 | crate::PatRest { |
2923 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2924 | dot2_token: node.dot2_token, |
2925 | } |
2926 | } |
2927 | #[cfg (feature = "full" )] |
2928 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2929 | pub fn fold_pat_slice<F>(f: &mut F, node: crate::PatSlice) -> crate::PatSlice |
2930 | where |
2931 | F: Fold + ?Sized, |
2932 | { |
2933 | crate::PatSlice { |
2934 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2935 | bracket_token: node.bracket_token, |
2936 | elems: FoldHelper::lift(self:node.elems, |it: Pat| f.fold_pat(it)), |
2937 | } |
2938 | } |
2939 | #[cfg (feature = "full" )] |
2940 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2941 | pub fn fold_pat_struct<F>(f: &mut F, node: crate::PatStruct) -> crate::PatStruct |
2942 | where |
2943 | F: Fold + ?Sized, |
2944 | { |
2945 | crate::PatStruct { |
2946 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2947 | qself: (node.qself).map(|it: QSelf| f.fold_qself(it)), |
2948 | path: f.fold_path(node.path), |
2949 | brace_token: node.brace_token, |
2950 | fields: FoldHelper::lift(self:node.fields, |it: FieldPat| f.fold_field_pat(it)), |
2951 | rest: (node.rest).map(|it: PatRest| f.fold_pat_rest(it)), |
2952 | } |
2953 | } |
2954 | #[cfg (feature = "full" )] |
2955 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2956 | pub fn fold_pat_tuple<F>(f: &mut F, node: crate::PatTuple) -> crate::PatTuple |
2957 | where |
2958 | F: Fold + ?Sized, |
2959 | { |
2960 | crate::PatTuple { |
2961 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2962 | paren_token: node.paren_token, |
2963 | elems: FoldHelper::lift(self:node.elems, |it: Pat| f.fold_pat(it)), |
2964 | } |
2965 | } |
2966 | #[cfg (feature = "full" )] |
2967 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2968 | pub fn fold_pat_tuple_struct<F>( |
2969 | f: &mut F, |
2970 | node: crate::PatTupleStruct, |
2971 | ) -> crate::PatTupleStruct |
2972 | where |
2973 | F: Fold + ?Sized, |
2974 | { |
2975 | crate::PatTupleStruct { |
2976 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2977 | qself: (node.qself).map(|it: QSelf| f.fold_qself(it)), |
2978 | path: f.fold_path(node.path), |
2979 | paren_token: node.paren_token, |
2980 | elems: FoldHelper::lift(self:node.elems, |it: Pat| f.fold_pat(it)), |
2981 | } |
2982 | } |
2983 | #[cfg (feature = "full" )] |
2984 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2985 | pub fn fold_pat_type<F>(f: &mut F, node: crate::PatType) -> crate::PatType |
2986 | where |
2987 | F: Fold + ?Sized, |
2988 | { |
2989 | crate::PatType { |
2990 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
2991 | pat: Box::new(f.fold_pat(*node.pat)), |
2992 | colon_token: node.colon_token, |
2993 | ty: Box::new(f.fold_type(*node.ty)), |
2994 | } |
2995 | } |
2996 | #[cfg (feature = "full" )] |
2997 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
2998 | pub fn fold_pat_wild<F>(f: &mut F, node: crate::PatWild) -> crate::PatWild |
2999 | where |
3000 | F: Fold + ?Sized, |
3001 | { |
3002 | crate::PatWild { |
3003 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3004 | underscore_token: node.underscore_token, |
3005 | } |
3006 | } |
3007 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3008 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3009 | pub fn fold_path<F>(f: &mut F, node: crate::Path) -> crate::Path |
3010 | where |
3011 | F: Fold + ?Sized, |
3012 | { |
3013 | crate::Path { |
3014 | leading_colon: node.leading_colon, |
3015 | segments: FoldHelper::lift(self:node.segments, |it: PathSegment| f.fold_path_segment(it)), |
3016 | } |
3017 | } |
3018 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3019 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3020 | pub fn fold_path_arguments<F>( |
3021 | f: &mut F, |
3022 | node: crate::PathArguments, |
3023 | ) -> crate::PathArguments |
3024 | where |
3025 | F: Fold + ?Sized, |
3026 | { |
3027 | match node { |
3028 | crate::PathArguments::None => crate::PathArguments::None, |
3029 | crate::PathArguments::AngleBracketed(_binding_0: AngleBracketedGenericArguments) => { |
3030 | crate::PathArguments::AngleBracketed( |
3031 | f.fold_angle_bracketed_generic_arguments(_binding_0), |
3032 | ) |
3033 | } |
3034 | crate::PathArguments::Parenthesized(_binding_0: ParenthesizedGenericArguments) => { |
3035 | crate::PathArguments::Parenthesized( |
3036 | f.fold_parenthesized_generic_arguments(_binding_0), |
3037 | ) |
3038 | } |
3039 | } |
3040 | } |
3041 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3042 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3043 | pub fn fold_path_segment<F>(f: &mut F, node: crate::PathSegment) -> crate::PathSegment |
3044 | where |
3045 | F: Fold + ?Sized, |
3046 | { |
3047 | crate::PathSegment { |
3048 | ident: f.fold_ident(node.ident), |
3049 | arguments: f.fold_path_arguments(node.arguments), |
3050 | } |
3051 | } |
3052 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3053 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3054 | pub fn fold_predicate_lifetime<F>( |
3055 | f: &mut F, |
3056 | node: crate::PredicateLifetime, |
3057 | ) -> crate::PredicateLifetime |
3058 | where |
3059 | F: Fold + ?Sized, |
3060 | { |
3061 | crate::PredicateLifetime { |
3062 | lifetime: f.fold_lifetime(node.lifetime), |
3063 | colon_token: node.colon_token, |
3064 | bounds: FoldHelper::lift(self:node.bounds, |it: Lifetime| f.fold_lifetime(it)), |
3065 | } |
3066 | } |
3067 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3068 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3069 | pub fn fold_predicate_type<F>( |
3070 | f: &mut F, |
3071 | node: crate::PredicateType, |
3072 | ) -> crate::PredicateType |
3073 | where |
3074 | F: Fold + ?Sized, |
3075 | { |
3076 | crate::PredicateType { |
3077 | lifetimes: (node.lifetimes).map(|it: BoundLifetimes| f.fold_bound_lifetimes(it)), |
3078 | bounded_ty: f.fold_type(node.bounded_ty), |
3079 | colon_token: node.colon_token, |
3080 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
3081 | } |
3082 | } |
3083 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3084 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3085 | pub fn fold_qself<F>(f: &mut F, node: crate::QSelf) -> crate::QSelf |
3086 | where |
3087 | F: Fold + ?Sized, |
3088 | { |
3089 | crate::QSelf { |
3090 | lt_token: node.lt_token, |
3091 | ty: Box::new(f.fold_type(*node.ty)), |
3092 | position: node.position, |
3093 | as_token: node.as_token, |
3094 | gt_token: node.gt_token, |
3095 | } |
3096 | } |
3097 | #[cfg (feature = "full" )] |
3098 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3099 | pub fn fold_range_limits<F>(f: &mut F, node: crate::RangeLimits) -> crate::RangeLimits |
3100 | where |
3101 | F: Fold + ?Sized, |
3102 | { |
3103 | match node { |
3104 | crate::RangeLimits::HalfOpen(_binding_0: DotDot) => { |
3105 | crate::RangeLimits::HalfOpen(_binding_0) |
3106 | } |
3107 | crate::RangeLimits::Closed(_binding_0: DotDotEq) => crate::RangeLimits::Closed(_binding_0), |
3108 | } |
3109 | } |
3110 | #[cfg (feature = "full" )] |
3111 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3112 | pub fn fold_receiver<F>(f: &mut F, node: crate::Receiver) -> crate::Receiver |
3113 | where |
3114 | F: Fold + ?Sized, |
3115 | { |
3116 | crate::Receiver { |
3117 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3118 | reference: (node.reference) |
3119 | .map(|it: (And, Option)| ((it).0, ((it).1).map(|it: Lifetime| f.fold_lifetime(it)))), |
3120 | mutability: node.mutability, |
3121 | self_token: node.self_token, |
3122 | colon_token: node.colon_token, |
3123 | ty: Box::new(f.fold_type(*node.ty)), |
3124 | } |
3125 | } |
3126 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3127 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3128 | pub fn fold_return_type<F>(f: &mut F, node: crate::ReturnType) -> crate::ReturnType |
3129 | where |
3130 | F: Fold + ?Sized, |
3131 | { |
3132 | match node { |
3133 | crate::ReturnType::Default => crate::ReturnType::Default, |
3134 | crate::ReturnType::Type(_binding_0: RArrow, _binding_1: Box) => { |
3135 | crate::ReturnType::Type(_binding_0, Box::new(f.fold_type(*_binding_1))) |
3136 | } |
3137 | } |
3138 | } |
3139 | #[cfg (feature = "full" )] |
3140 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3141 | pub fn fold_signature<F>(f: &mut F, node: crate::Signature) -> crate::Signature |
3142 | where |
3143 | F: Fold + ?Sized, |
3144 | { |
3145 | crate::Signature { |
3146 | constness: node.constness, |
3147 | asyncness: node.asyncness, |
3148 | unsafety: node.unsafety, |
3149 | abi: (node.abi).map(|it: Abi| f.fold_abi(it)), |
3150 | fn_token: node.fn_token, |
3151 | ident: f.fold_ident(node.ident), |
3152 | generics: f.fold_generics(node.generics), |
3153 | paren_token: node.paren_token, |
3154 | inputs: FoldHelper::lift(self:node.inputs, |it: FnArg| f.fold_fn_arg(it)), |
3155 | variadic: (node.variadic).map(|it: Variadic| f.fold_variadic(it)), |
3156 | output: f.fold_return_type(node.output), |
3157 | } |
3158 | } |
3159 | pub fn fold_span<F>(f: &mut F, node: proc_macro2::Span) -> proc_macro2::Span |
3160 | where |
3161 | F: Fold + ?Sized, |
3162 | { |
3163 | node |
3164 | } |
3165 | #[cfg (feature = "full" )] |
3166 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3167 | pub fn fold_static_mutability<F>( |
3168 | f: &mut F, |
3169 | node: crate::StaticMutability, |
3170 | ) -> crate::StaticMutability |
3171 | where |
3172 | F: Fold + ?Sized, |
3173 | { |
3174 | match node { |
3175 | crate::StaticMutability::Mut(_binding_0: Mut) => { |
3176 | crate::StaticMutability::Mut(_binding_0) |
3177 | } |
3178 | crate::StaticMutability::None => crate::StaticMutability::None, |
3179 | } |
3180 | } |
3181 | #[cfg (feature = "full" )] |
3182 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3183 | pub fn fold_stmt<F>(f: &mut F, node: crate::Stmt) -> crate::Stmt |
3184 | where |
3185 | F: Fold + ?Sized, |
3186 | { |
3187 | match node { |
3188 | crate::Stmt::Local(_binding_0: Local) => crate::Stmt::Local(f.fold_local(_binding_0)), |
3189 | crate::Stmt::Item(_binding_0: Item) => crate::Stmt::Item(f.fold_item(_binding_0)), |
3190 | crate::Stmt::Expr(_binding_0: Expr, _binding_1: Option) => { |
3191 | crate::Stmt::Expr(f.fold_expr(_binding_0), _binding_1) |
3192 | } |
3193 | crate::Stmt::Macro(_binding_0: StmtMacro) => { |
3194 | crate::Stmt::Macro(f.fold_stmt_macro(_binding_0)) |
3195 | } |
3196 | } |
3197 | } |
3198 | #[cfg (feature = "full" )] |
3199 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3200 | pub fn fold_stmt_macro<F>(f: &mut F, node: crate::StmtMacro) -> crate::StmtMacro |
3201 | where |
3202 | F: Fold + ?Sized, |
3203 | { |
3204 | crate::StmtMacro { |
3205 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3206 | mac: f.fold_macro(node.mac), |
3207 | semi_token: node.semi_token, |
3208 | } |
3209 | } |
3210 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3211 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3212 | pub fn fold_trait_bound<F>(f: &mut F, node: crate::TraitBound) -> crate::TraitBound |
3213 | where |
3214 | F: Fold + ?Sized, |
3215 | { |
3216 | crate::TraitBound { |
3217 | paren_token: node.paren_token, |
3218 | modifier: f.fold_trait_bound_modifier(node.modifier), |
3219 | lifetimes: (node.lifetimes).map(|it: BoundLifetimes| f.fold_bound_lifetimes(it)), |
3220 | path: f.fold_path(node.path), |
3221 | } |
3222 | } |
3223 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3224 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3225 | pub fn fold_trait_bound_modifier<F>( |
3226 | f: &mut F, |
3227 | node: crate::TraitBoundModifier, |
3228 | ) -> crate::TraitBoundModifier |
3229 | where |
3230 | F: Fold + ?Sized, |
3231 | { |
3232 | match node { |
3233 | crate::TraitBoundModifier::None => crate::TraitBoundModifier::None, |
3234 | crate::TraitBoundModifier::Maybe(_binding_0: Question) => { |
3235 | crate::TraitBoundModifier::Maybe(_binding_0) |
3236 | } |
3237 | } |
3238 | } |
3239 | #[cfg (feature = "full" )] |
3240 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3241 | pub fn fold_trait_item<F>(f: &mut F, node: crate::TraitItem) -> crate::TraitItem |
3242 | where |
3243 | F: Fold + ?Sized, |
3244 | { |
3245 | match node { |
3246 | crate::TraitItem::Const(_binding_0: TraitItemConst) => { |
3247 | crate::TraitItem::Const(f.fold_trait_item_const(_binding_0)) |
3248 | } |
3249 | crate::TraitItem::Fn(_binding_0: TraitItemFn) => { |
3250 | crate::TraitItem::Fn(f.fold_trait_item_fn(_binding_0)) |
3251 | } |
3252 | crate::TraitItem::Type(_binding_0: TraitItemType) => { |
3253 | crate::TraitItem::Type(f.fold_trait_item_type(_binding_0)) |
3254 | } |
3255 | crate::TraitItem::Macro(_binding_0: TraitItemMacro) => { |
3256 | crate::TraitItem::Macro(f.fold_trait_item_macro(_binding_0)) |
3257 | } |
3258 | crate::TraitItem::Verbatim(_binding_0: TokenStream) => crate::TraitItem::Verbatim(_binding_0), |
3259 | } |
3260 | } |
3261 | #[cfg (feature = "full" )] |
3262 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3263 | pub fn fold_trait_item_const<F>( |
3264 | f: &mut F, |
3265 | node: crate::TraitItemConst, |
3266 | ) -> crate::TraitItemConst |
3267 | where |
3268 | F: Fold + ?Sized, |
3269 | { |
3270 | crate::TraitItemConst { |
3271 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3272 | const_token: node.const_token, |
3273 | ident: f.fold_ident(node.ident), |
3274 | generics: f.fold_generics(node.generics), |
3275 | colon_token: node.colon_token, |
3276 | ty: f.fold_type(node.ty), |
3277 | default: (node.default).map(|it: (Eq, Expr)| ((it).0, f.fold_expr((it).1))), |
3278 | semi_token: node.semi_token, |
3279 | } |
3280 | } |
3281 | #[cfg (feature = "full" )] |
3282 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3283 | pub fn fold_trait_item_fn<F>(f: &mut F, node: crate::TraitItemFn) -> crate::TraitItemFn |
3284 | where |
3285 | F: Fold + ?Sized, |
3286 | { |
3287 | crate::TraitItemFn { |
3288 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3289 | sig: f.fold_signature(node.sig), |
3290 | default: (node.default).map(|it: Block| f.fold_block(it)), |
3291 | semi_token: node.semi_token, |
3292 | } |
3293 | } |
3294 | #[cfg (feature = "full" )] |
3295 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3296 | pub fn fold_trait_item_macro<F>( |
3297 | f: &mut F, |
3298 | node: crate::TraitItemMacro, |
3299 | ) -> crate::TraitItemMacro |
3300 | where |
3301 | F: Fold + ?Sized, |
3302 | { |
3303 | crate::TraitItemMacro { |
3304 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3305 | mac: f.fold_macro(node.mac), |
3306 | semi_token: node.semi_token, |
3307 | } |
3308 | } |
3309 | #[cfg (feature = "full" )] |
3310 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3311 | pub fn fold_trait_item_type<F>( |
3312 | f: &mut F, |
3313 | node: crate::TraitItemType, |
3314 | ) -> crate::TraitItemType |
3315 | where |
3316 | F: Fold + ?Sized, |
3317 | { |
3318 | crate::TraitItemType { |
3319 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3320 | type_token: node.type_token, |
3321 | ident: f.fold_ident(node.ident), |
3322 | generics: f.fold_generics(node.generics), |
3323 | colon_token: node.colon_token, |
3324 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
3325 | default: (node.default).map(|it: (Eq, Type)| ((it).0, f.fold_type((it).1))), |
3326 | semi_token: node.semi_token, |
3327 | } |
3328 | } |
3329 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3330 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3331 | pub fn fold_type<F>(f: &mut F, node: crate::Type) -> crate::Type |
3332 | where |
3333 | F: Fold + ?Sized, |
3334 | { |
3335 | match node { |
3336 | crate::Type::Array(_binding_0) => { |
3337 | crate::Type::Array(f.fold_type_array(_binding_0)) |
3338 | } |
3339 | crate::Type::BareFn(_binding_0) => { |
3340 | crate::Type::BareFn(f.fold_type_bare_fn(_binding_0)) |
3341 | } |
3342 | crate::Type::Group(_binding_0) => { |
3343 | crate::Type::Group(f.fold_type_group(_binding_0)) |
3344 | } |
3345 | crate::Type::ImplTrait(_binding_0) => { |
3346 | crate::Type::ImplTrait(f.fold_type_impl_trait(_binding_0)) |
3347 | } |
3348 | crate::Type::Infer(_binding_0) => { |
3349 | crate::Type::Infer(f.fold_type_infer(_binding_0)) |
3350 | } |
3351 | crate::Type::Macro(_binding_0) => { |
3352 | crate::Type::Macro(f.fold_type_macro(_binding_0)) |
3353 | } |
3354 | crate::Type::Never(_binding_0) => { |
3355 | crate::Type::Never(f.fold_type_never(_binding_0)) |
3356 | } |
3357 | crate::Type::Paren(_binding_0) => { |
3358 | crate::Type::Paren(f.fold_type_paren(_binding_0)) |
3359 | } |
3360 | crate::Type::Path(_binding_0) => crate::Type::Path(f.fold_type_path(_binding_0)), |
3361 | crate::Type::Ptr(_binding_0) => crate::Type::Ptr(f.fold_type_ptr(_binding_0)), |
3362 | crate::Type::Reference(_binding_0) => { |
3363 | crate::Type::Reference(f.fold_type_reference(_binding_0)) |
3364 | } |
3365 | crate::Type::Slice(_binding_0) => { |
3366 | crate::Type::Slice(f.fold_type_slice(_binding_0)) |
3367 | } |
3368 | crate::Type::TraitObject(_binding_0) => { |
3369 | crate::Type::TraitObject(f.fold_type_trait_object(_binding_0)) |
3370 | } |
3371 | crate::Type::Tuple(_binding_0) => { |
3372 | crate::Type::Tuple(f.fold_type_tuple(_binding_0)) |
3373 | } |
3374 | crate::Type::Verbatim(_binding_0) => crate::Type::Verbatim(_binding_0), |
3375 | } |
3376 | } |
3377 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3378 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3379 | pub fn fold_type_array<F>(f: &mut F, node: crate::TypeArray) -> crate::TypeArray |
3380 | where |
3381 | F: Fold + ?Sized, |
3382 | { |
3383 | crate::TypeArray { |
3384 | bracket_token: node.bracket_token, |
3385 | elem: Box::new(f.fold_type(*node.elem)), |
3386 | semi_token: node.semi_token, |
3387 | len: f.fold_expr(node.len), |
3388 | } |
3389 | } |
3390 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3391 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3392 | pub fn fold_type_bare_fn<F>(f: &mut F, node: crate::TypeBareFn) -> crate::TypeBareFn |
3393 | where |
3394 | F: Fold + ?Sized, |
3395 | { |
3396 | crate::TypeBareFn { |
3397 | lifetimes: (node.lifetimes).map(|it: BoundLifetimes| f.fold_bound_lifetimes(it)), |
3398 | unsafety: node.unsafety, |
3399 | abi: (node.abi).map(|it: Abi| f.fold_abi(it)), |
3400 | fn_token: node.fn_token, |
3401 | paren_token: node.paren_token, |
3402 | inputs: FoldHelper::lift(self:node.inputs, |it: BareFnArg| f.fold_bare_fn_arg(it)), |
3403 | variadic: (node.variadic).map(|it: BareVariadic| f.fold_bare_variadic(it)), |
3404 | output: f.fold_return_type(node.output), |
3405 | } |
3406 | } |
3407 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3408 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3409 | pub fn fold_type_group<F>(f: &mut F, node: crate::TypeGroup) -> crate::TypeGroup |
3410 | where |
3411 | F: Fold + ?Sized, |
3412 | { |
3413 | crate::TypeGroup { |
3414 | group_token: node.group_token, |
3415 | elem: Box::new(f.fold_type(*node.elem)), |
3416 | } |
3417 | } |
3418 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3419 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3420 | pub fn fold_type_impl_trait<F>( |
3421 | f: &mut F, |
3422 | node: crate::TypeImplTrait, |
3423 | ) -> crate::TypeImplTrait |
3424 | where |
3425 | F: Fold + ?Sized, |
3426 | { |
3427 | crate::TypeImplTrait { |
3428 | impl_token: node.impl_token, |
3429 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
3430 | } |
3431 | } |
3432 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3433 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3434 | pub fn fold_type_infer<F>(f: &mut F, node: crate::TypeInfer) -> crate::TypeInfer |
3435 | where |
3436 | F: Fold + ?Sized, |
3437 | { |
3438 | crate::TypeInfer { |
3439 | underscore_token: node.underscore_token, |
3440 | } |
3441 | } |
3442 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3443 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3444 | pub fn fold_type_macro<F>(f: &mut F, node: crate::TypeMacro) -> crate::TypeMacro |
3445 | where |
3446 | F: Fold + ?Sized, |
3447 | { |
3448 | crate::TypeMacro { |
3449 | mac: f.fold_macro(node.mac), |
3450 | } |
3451 | } |
3452 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3453 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3454 | pub fn fold_type_never<F>(f: &mut F, node: crate::TypeNever) -> crate::TypeNever |
3455 | where |
3456 | F: Fold + ?Sized, |
3457 | { |
3458 | crate::TypeNever { |
3459 | bang_token: node.bang_token, |
3460 | } |
3461 | } |
3462 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3463 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3464 | pub fn fold_type_param<F>(f: &mut F, node: crate::TypeParam) -> crate::TypeParam |
3465 | where |
3466 | F: Fold + ?Sized, |
3467 | { |
3468 | crate::TypeParam { |
3469 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3470 | ident: f.fold_ident(node.ident), |
3471 | colon_token: node.colon_token, |
3472 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
3473 | eq_token: node.eq_token, |
3474 | default: (node.default).map(|it: Type| f.fold_type(it)), |
3475 | } |
3476 | } |
3477 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3478 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3479 | pub fn fold_type_param_bound<F>( |
3480 | f: &mut F, |
3481 | node: crate::TypeParamBound, |
3482 | ) -> crate::TypeParamBound |
3483 | where |
3484 | F: Fold + ?Sized, |
3485 | { |
3486 | match node { |
3487 | crate::TypeParamBound::Trait(_binding_0: TraitBound) => { |
3488 | crate::TypeParamBound::Trait(f.fold_trait_bound(_binding_0)) |
3489 | } |
3490 | crate::TypeParamBound::Lifetime(_binding_0: Lifetime) => { |
3491 | crate::TypeParamBound::Lifetime(f.fold_lifetime(_binding_0)) |
3492 | } |
3493 | crate::TypeParamBound::Verbatim(_binding_0: TokenStream) => { |
3494 | crate::TypeParamBound::Verbatim(_binding_0) |
3495 | } |
3496 | } |
3497 | } |
3498 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3499 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3500 | pub fn fold_type_paren<F>(f: &mut F, node: crate::TypeParen) -> crate::TypeParen |
3501 | where |
3502 | F: Fold + ?Sized, |
3503 | { |
3504 | crate::TypeParen { |
3505 | paren_token: node.paren_token, |
3506 | elem: Box::new(f.fold_type(*node.elem)), |
3507 | } |
3508 | } |
3509 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3510 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3511 | pub fn fold_type_path<F>(f: &mut F, node: crate::TypePath) -> crate::TypePath |
3512 | where |
3513 | F: Fold + ?Sized, |
3514 | { |
3515 | crate::TypePath { |
3516 | qself: (node.qself).map(|it: QSelf| f.fold_qself(it)), |
3517 | path: f.fold_path(node.path), |
3518 | } |
3519 | } |
3520 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3521 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3522 | pub fn fold_type_ptr<F>(f: &mut F, node: crate::TypePtr) -> crate::TypePtr |
3523 | where |
3524 | F: Fold + ?Sized, |
3525 | { |
3526 | crate::TypePtr { |
3527 | star_token: node.star_token, |
3528 | const_token: node.const_token, |
3529 | mutability: node.mutability, |
3530 | elem: Box::new(f.fold_type(*node.elem)), |
3531 | } |
3532 | } |
3533 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3534 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3535 | pub fn fold_type_reference<F>( |
3536 | f: &mut F, |
3537 | node: crate::TypeReference, |
3538 | ) -> crate::TypeReference |
3539 | where |
3540 | F: Fold + ?Sized, |
3541 | { |
3542 | crate::TypeReference { |
3543 | and_token: node.and_token, |
3544 | lifetime: (node.lifetime).map(|it: Lifetime| f.fold_lifetime(it)), |
3545 | mutability: node.mutability, |
3546 | elem: Box::new(f.fold_type(*node.elem)), |
3547 | } |
3548 | } |
3549 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3550 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3551 | pub fn fold_type_slice<F>(f: &mut F, node: crate::TypeSlice) -> crate::TypeSlice |
3552 | where |
3553 | F: Fold + ?Sized, |
3554 | { |
3555 | crate::TypeSlice { |
3556 | bracket_token: node.bracket_token, |
3557 | elem: Box::new(f.fold_type(*node.elem)), |
3558 | } |
3559 | } |
3560 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3561 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3562 | pub fn fold_type_trait_object<F>( |
3563 | f: &mut F, |
3564 | node: crate::TypeTraitObject, |
3565 | ) -> crate::TypeTraitObject |
3566 | where |
3567 | F: Fold + ?Sized, |
3568 | { |
3569 | crate::TypeTraitObject { |
3570 | dyn_token: node.dyn_token, |
3571 | bounds: FoldHelper::lift(self:node.bounds, |it: TypeParamBound| f.fold_type_param_bound(it)), |
3572 | } |
3573 | } |
3574 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3575 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3576 | pub fn fold_type_tuple<F>(f: &mut F, node: crate::TypeTuple) -> crate::TypeTuple |
3577 | where |
3578 | F: Fold + ?Sized, |
3579 | { |
3580 | crate::TypeTuple { |
3581 | paren_token: node.paren_token, |
3582 | elems: FoldHelper::lift(self:node.elems, |it: Type| f.fold_type(it)), |
3583 | } |
3584 | } |
3585 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3586 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3587 | pub fn fold_un_op<F>(f: &mut F, node: crate::UnOp) -> crate::UnOp |
3588 | where |
3589 | F: Fold + ?Sized, |
3590 | { |
3591 | match node { |
3592 | crate::UnOp::Deref(_binding_0: Star) => crate::UnOp::Deref(_binding_0), |
3593 | crate::UnOp::Not(_binding_0: Not) => crate::UnOp::Not(_binding_0), |
3594 | crate::UnOp::Neg(_binding_0: Minus) => crate::UnOp::Neg(_binding_0), |
3595 | } |
3596 | } |
3597 | #[cfg (feature = "full" )] |
3598 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3599 | pub fn fold_use_glob<F>(f: &mut F, node: crate::UseGlob) -> crate::UseGlob |
3600 | where |
3601 | F: Fold + ?Sized, |
3602 | { |
3603 | crate::UseGlob { |
3604 | star_token: node.star_token, |
3605 | } |
3606 | } |
3607 | #[cfg (feature = "full" )] |
3608 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3609 | pub fn fold_use_group<F>(f: &mut F, node: crate::UseGroup) -> crate::UseGroup |
3610 | where |
3611 | F: Fold + ?Sized, |
3612 | { |
3613 | crate::UseGroup { |
3614 | brace_token: node.brace_token, |
3615 | items: FoldHelper::lift(self:node.items, |it: UseTree| f.fold_use_tree(it)), |
3616 | } |
3617 | } |
3618 | #[cfg (feature = "full" )] |
3619 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3620 | pub fn fold_use_name<F>(f: &mut F, node: crate::UseName) -> crate::UseName |
3621 | where |
3622 | F: Fold + ?Sized, |
3623 | { |
3624 | crate::UseName { |
3625 | ident: f.fold_ident(node.ident), |
3626 | } |
3627 | } |
3628 | #[cfg (feature = "full" )] |
3629 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3630 | pub fn fold_use_path<F>(f: &mut F, node: crate::UsePath) -> crate::UsePath |
3631 | where |
3632 | F: Fold + ?Sized, |
3633 | { |
3634 | crate::UsePath { |
3635 | ident: f.fold_ident(node.ident), |
3636 | colon2_token: node.colon2_token, |
3637 | tree: Box::new(f.fold_use_tree(*node.tree)), |
3638 | } |
3639 | } |
3640 | #[cfg (feature = "full" )] |
3641 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3642 | pub fn fold_use_rename<F>(f: &mut F, node: crate::UseRename) -> crate::UseRename |
3643 | where |
3644 | F: Fold + ?Sized, |
3645 | { |
3646 | crate::UseRename { |
3647 | ident: f.fold_ident(node.ident), |
3648 | as_token: node.as_token, |
3649 | rename: f.fold_ident(node.rename), |
3650 | } |
3651 | } |
3652 | #[cfg (feature = "full" )] |
3653 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3654 | pub fn fold_use_tree<F>(f: &mut F, node: crate::UseTree) -> crate::UseTree |
3655 | where |
3656 | F: Fold + ?Sized, |
3657 | { |
3658 | match node { |
3659 | crate::UseTree::Path(_binding_0: UsePath) => { |
3660 | crate::UseTree::Path(f.fold_use_path(_binding_0)) |
3661 | } |
3662 | crate::UseTree::Name(_binding_0: UseName) => { |
3663 | crate::UseTree::Name(f.fold_use_name(_binding_0)) |
3664 | } |
3665 | crate::UseTree::Rename(_binding_0: UseRename) => { |
3666 | crate::UseTree::Rename(f.fold_use_rename(_binding_0)) |
3667 | } |
3668 | crate::UseTree::Glob(_binding_0: UseGlob) => { |
3669 | crate::UseTree::Glob(f.fold_use_glob(_binding_0)) |
3670 | } |
3671 | crate::UseTree::Group(_binding_0: UseGroup) => { |
3672 | crate::UseTree::Group(f.fold_use_group(_binding_0)) |
3673 | } |
3674 | } |
3675 | } |
3676 | #[cfg (feature = "full" )] |
3677 | #[cfg_attr (doc_cfg, doc(cfg(feature = "full" )))] |
3678 | pub fn fold_variadic<F>(f: &mut F, node: crate::Variadic) -> crate::Variadic |
3679 | where |
3680 | F: Fold + ?Sized, |
3681 | { |
3682 | crate::Variadic { |
3683 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3684 | pat: (node.pat).map(|it: (Box, Colon)| (Box::new(f.fold_pat(*(it).0)), (it).1)), |
3685 | dots: node.dots, |
3686 | comma: node.comma, |
3687 | } |
3688 | } |
3689 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3690 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3691 | pub fn fold_variant<F>(f: &mut F, node: crate::Variant) -> crate::Variant |
3692 | where |
3693 | F: Fold + ?Sized, |
3694 | { |
3695 | crate::Variant { |
3696 | attrs: FoldHelper::lift(self:node.attrs, |it: Attribute| f.fold_attribute(it)), |
3697 | ident: f.fold_ident(node.ident), |
3698 | fields: f.fold_fields(node.fields), |
3699 | discriminant: (node.discriminant).map(|it: (Eq, Expr)| ((it).0, f.fold_expr((it).1))), |
3700 | } |
3701 | } |
3702 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3703 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3704 | pub fn fold_vis_restricted<F>( |
3705 | f: &mut F, |
3706 | node: crate::VisRestricted, |
3707 | ) -> crate::VisRestricted |
3708 | where |
3709 | F: Fold + ?Sized, |
3710 | { |
3711 | crate::VisRestricted { |
3712 | pub_token: node.pub_token, |
3713 | paren_token: node.paren_token, |
3714 | in_token: node.in_token, |
3715 | path: Box::new(f.fold_path(*node.path)), |
3716 | } |
3717 | } |
3718 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3719 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3720 | pub fn fold_visibility<F>(f: &mut F, node: crate::Visibility) -> crate::Visibility |
3721 | where |
3722 | F: Fold + ?Sized, |
3723 | { |
3724 | match node { |
3725 | crate::Visibility::Public(_binding_0: Pub) => crate::Visibility::Public(_binding_0), |
3726 | crate::Visibility::Restricted(_binding_0: VisRestricted) => { |
3727 | crate::Visibility::Restricted(f.fold_vis_restricted(_binding_0)) |
3728 | } |
3729 | crate::Visibility::Inherited => crate::Visibility::Inherited, |
3730 | } |
3731 | } |
3732 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3733 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3734 | pub fn fold_where_clause<F>(f: &mut F, node: crate::WhereClause) -> crate::WhereClause |
3735 | where |
3736 | F: Fold + ?Sized, |
3737 | { |
3738 | crate::WhereClause { |
3739 | where_token: node.where_token, |
3740 | predicates: FoldHelper::lift(self:node.predicates, |it: WherePredicate| f.fold_where_predicate(it)), |
3741 | } |
3742 | } |
3743 | #[cfg (any(feature = "derive" , feature = "full" ))] |
3744 | #[cfg_attr (doc_cfg, doc(cfg(any(feature = "derive" , feature = "full" ))))] |
3745 | pub fn fold_where_predicate<F>( |
3746 | f: &mut F, |
3747 | node: crate::WherePredicate, |
3748 | ) -> crate::WherePredicate |
3749 | where |
3750 | F: Fold + ?Sized, |
3751 | { |
3752 | match node { |
3753 | crate::WherePredicate::Lifetime(_binding_0: PredicateLifetime) => { |
3754 | crate::WherePredicate::Lifetime(f.fold_predicate_lifetime(_binding_0)) |
3755 | } |
3756 | crate::WherePredicate::Type(_binding_0: PredicateType) => { |
3757 | crate::WherePredicate::Type(f.fold_predicate_type(_binding_0)) |
3758 | } |
3759 | } |
3760 | } |
3761 | |