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