1 // This file is @generated by syn-internal-codegen.
2 // It is not intended for manual editing.
3
4 #![allow(unreachable_code, unused_variables)]
5 #![allow(
6 clippy::match_wildcard_for_single_variants,
7 clippy::needless_match,
8 clippy::needless_pass_by_ref_mut,
9 )]
10 #[cfg(any(feature = "full", feature = "derive"))]
11 use crate::gen::helper::fold::*;
12 use crate::*;
13 use proc_macro2::Span;
14 #[cfg(feature = "full")]
15 macro_rules! full {
16 ($e:expr) => {
17 $e
18 };
19 }
20 #[cfg(all(feature = "derive", not(feature = "full")))]
21 macro_rules! full {
22 ($e:expr) => {
23 unreachable!()
24 };
25 }
26 /// Syntax tree traversal to transform the nodes of an owned syntax tree.
27 ///
28 /// See the [module documentation] for details.
29 ///
30 /// [module documentation]: self
31 pub trait Fold {
32 #[cfg(any(feature = "derive", feature = "full"))]
33 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_abinull34 fn fold_abi(&mut self, i: Abi) -> Abi {
35 fold_abi(self, i)
36 }
37 #[cfg(any(feature = "derive", feature = "full"))]
38 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_angle_bracketed_generic_argumentsnull39 fn fold_angle_bracketed_generic_arguments(
40 &mut self,
41 i: AngleBracketedGenericArguments,
42 ) -> AngleBracketedGenericArguments {
43 fold_angle_bracketed_generic_arguments(self, i)
44 }
45 #[cfg(feature = "full")]
46 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_armnull47 fn fold_arm(&mut self, i: Arm) -> Arm {
48 fold_arm(self, i)
49 }
50 #[cfg(any(feature = "derive", feature = "full"))]
51 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_assoc_constnull52 fn fold_assoc_const(&mut self, i: AssocConst) -> AssocConst {
53 fold_assoc_const(self, i)
54 }
55 #[cfg(any(feature = "derive", feature = "full"))]
56 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_assoc_typenull57 fn fold_assoc_type(&mut self, i: AssocType) -> AssocType {
58 fold_assoc_type(self, i)
59 }
60 #[cfg(any(feature = "derive", feature = "full"))]
61 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_attr_stylenull62 fn fold_attr_style(&mut self, i: AttrStyle) -> AttrStyle {
63 fold_attr_style(self, i)
64 }
65 #[cfg(any(feature = "derive", feature = "full"))]
66 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_attributenull67 fn fold_attribute(&mut self, i: Attribute) -> Attribute {
68 fold_attribute(self, i)
69 }
70 #[cfg(any(feature = "derive", feature = "full"))]
71 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bare_fn_argnull72 fn fold_bare_fn_arg(&mut self, i: BareFnArg) -> BareFnArg {
73 fold_bare_fn_arg(self, i)
74 }
75 #[cfg(any(feature = "derive", feature = "full"))]
76 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bare_variadicnull77 fn fold_bare_variadic(&mut self, i: BareVariadic) -> BareVariadic {
78 fold_bare_variadic(self, i)
79 }
80 #[cfg(any(feature = "derive", feature = "full"))]
81 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bin_opnull82 fn fold_bin_op(&mut self, i: BinOp) -> BinOp {
83 fold_bin_op(self, i)
84 }
85 #[cfg(feature = "full")]
86 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_blocknull87 fn fold_block(&mut self, i: Block) -> Block {
88 fold_block(self, i)
89 }
90 #[cfg(any(feature = "derive", feature = "full"))]
91 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bound_lifetimesnull92 fn fold_bound_lifetimes(&mut self, i: BoundLifetimes) -> BoundLifetimes {
93 fold_bound_lifetimes(self, i)
94 }
95 #[cfg(any(feature = "derive", feature = "full"))]
96 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_const_paramnull97 fn fold_const_param(&mut self, i: ConstParam) -> ConstParam {
98 fold_const_param(self, i)
99 }
100 #[cfg(any(feature = "derive", feature = "full"))]
101 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_constraintnull102 fn fold_constraint(&mut self, i: Constraint) -> Constraint {
103 fold_constraint(self, i)
104 }
105 #[cfg(feature = "derive")]
106 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_datanull107 fn fold_data(&mut self, i: Data) -> Data {
108 fold_data(self, i)
109 }
110 #[cfg(feature = "derive")]
111 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_enumnull112 fn fold_data_enum(&mut self, i: DataEnum) -> DataEnum {
113 fold_data_enum(self, i)
114 }
115 #[cfg(feature = "derive")]
116 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_structnull117 fn fold_data_struct(&mut self, i: DataStruct) -> DataStruct {
118 fold_data_struct(self, i)
119 }
120 #[cfg(feature = "derive")]
121 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_unionnull122 fn fold_data_union(&mut self, i: DataUnion) -> DataUnion {
123 fold_data_union(self, i)
124 }
125 #[cfg(feature = "derive")]
126 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_derive_inputnull127 fn fold_derive_input(&mut self, i: DeriveInput) -> DeriveInput {
128 fold_derive_input(self, i)
129 }
130 #[cfg(any(feature = "derive", feature = "full"))]
131 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_exprnull132 fn fold_expr(&mut self, i: Expr) -> Expr {
133 fold_expr(self, i)
134 }
135 #[cfg(feature = "full")]
136 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_arraynull137 fn fold_expr_array(&mut self, i: ExprArray) -> ExprArray {
138 fold_expr_array(self, i)
139 }
140 #[cfg(feature = "full")]
141 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_assignnull142 fn fold_expr_assign(&mut self, i: ExprAssign) -> ExprAssign {
143 fold_expr_assign(self, i)
144 }
145 #[cfg(feature = "full")]
146 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_asyncnull147 fn fold_expr_async(&mut self, i: ExprAsync) -> ExprAsync {
148 fold_expr_async(self, i)
149 }
150 #[cfg(feature = "full")]
151 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_awaitnull152 fn fold_expr_await(&mut self, i: ExprAwait) -> ExprAwait {
153 fold_expr_await(self, i)
154 }
155 #[cfg(any(feature = "derive", feature = "full"))]
156 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_binarynull157 fn fold_expr_binary(&mut self, i: ExprBinary) -> ExprBinary {
158 fold_expr_binary(self, i)
159 }
160 #[cfg(feature = "full")]
161 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_blocknull162 fn fold_expr_block(&mut self, i: ExprBlock) -> ExprBlock {
163 fold_expr_block(self, i)
164 }
165 #[cfg(feature = "full")]
166 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_breaknull167 fn fold_expr_break(&mut self, i: ExprBreak) -> ExprBreak {
168 fold_expr_break(self, i)
169 }
170 #[cfg(any(feature = "derive", feature = "full"))]
171 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_callnull172 fn fold_expr_call(&mut self, i: ExprCall) -> ExprCall {
173 fold_expr_call(self, i)
174 }
175 #[cfg(any(feature = "derive", feature = "full"))]
176 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_castnull177 fn fold_expr_cast(&mut self, i: ExprCast) -> ExprCast {
178 fold_expr_cast(self, i)
179 }
180 #[cfg(feature = "full")]
181 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_closurenull182 fn fold_expr_closure(&mut self, i: ExprClosure) -> ExprClosure {
183 fold_expr_closure(self, i)
184 }
185 #[cfg(feature = "full")]
186 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_constnull187 fn fold_expr_const(&mut self, i: ExprConst) -> ExprConst {
188 fold_expr_const(self, i)
189 }
190 #[cfg(feature = "full")]
191 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_continuenull192 fn fold_expr_continue(&mut self, i: ExprContinue) -> ExprContinue {
193 fold_expr_continue(self, i)
194 }
195 #[cfg(any(feature = "derive", feature = "full"))]
196 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_fieldnull197 fn fold_expr_field(&mut self, i: ExprField) -> ExprField {
198 fold_expr_field(self, i)
199 }
200 #[cfg(feature = "full")]
201 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_for_loopnull202 fn fold_expr_for_loop(&mut self, i: ExprForLoop) -> ExprForLoop {
203 fold_expr_for_loop(self, i)
204 }
205 #[cfg(any(feature = "derive", feature = "full"))]
206 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_groupnull207 fn fold_expr_group(&mut self, i: ExprGroup) -> ExprGroup {
208 fold_expr_group(self, i)
209 }
210 #[cfg(feature = "full")]
211 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_ifnull212 fn fold_expr_if(&mut self, i: ExprIf) -> ExprIf {
213 fold_expr_if(self, i)
214 }
215 #[cfg(any(feature = "derive", feature = "full"))]
216 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_indexnull217 fn fold_expr_index(&mut self, i: ExprIndex) -> ExprIndex {
218 fold_expr_index(self, i)
219 }
220 #[cfg(feature = "full")]
221 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_infernull222 fn fold_expr_infer(&mut self, i: ExprInfer) -> ExprInfer {
223 fold_expr_infer(self, i)
224 }
225 #[cfg(feature = "full")]
226 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_letnull227 fn fold_expr_let(&mut self, i: ExprLet) -> ExprLet {
228 fold_expr_let(self, i)
229 }
230 #[cfg(any(feature = "derive", feature = "full"))]
231 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_litnull232 fn fold_expr_lit(&mut self, i: ExprLit) -> ExprLit {
233 fold_expr_lit(self, i)
234 }
235 #[cfg(feature = "full")]
236 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_loopnull237 fn fold_expr_loop(&mut self, i: ExprLoop) -> ExprLoop {
238 fold_expr_loop(self, i)
239 }
240 #[cfg(any(feature = "derive", feature = "full"))]
241 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_macronull242 fn fold_expr_macro(&mut self, i: ExprMacro) -> ExprMacro {
243 fold_expr_macro(self, i)
244 }
245 #[cfg(feature = "full")]
246 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_matchnull247 fn fold_expr_match(&mut self, i: ExprMatch) -> ExprMatch {
248 fold_expr_match(self, i)
249 }
250 #[cfg(any(feature = "derive", feature = "full"))]
251 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_method_callnull252 fn fold_expr_method_call(&mut self, i: ExprMethodCall) -> ExprMethodCall {
253 fold_expr_method_call(self, i)
254 }
255 #[cfg(any(feature = "derive", feature = "full"))]
256 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_parennull257 fn fold_expr_paren(&mut self, i: ExprParen) -> ExprParen {
258 fold_expr_paren(self, i)
259 }
260 #[cfg(any(feature = "derive", feature = "full"))]
261 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_pathnull262 fn fold_expr_path(&mut self, i: ExprPath) -> ExprPath {
263 fold_expr_path(self, i)
264 }
265 #[cfg(feature = "full")]
266 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_rangenull267 fn fold_expr_range(&mut self, i: ExprRange) -> ExprRange {
268 fold_expr_range(self, i)
269 }
270 #[cfg(any(feature = "derive", feature = "full"))]
271 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_referencenull272 fn fold_expr_reference(&mut self, i: ExprReference) -> ExprReference {
273 fold_expr_reference(self, i)
274 }
275 #[cfg(feature = "full")]
276 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_repeatnull277 fn fold_expr_repeat(&mut self, i: ExprRepeat) -> ExprRepeat {
278 fold_expr_repeat(self, i)
279 }
280 #[cfg(feature = "full")]
281 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_returnnull282 fn fold_expr_return(&mut self, i: ExprReturn) -> ExprReturn {
283 fold_expr_return(self, i)
284 }
285 #[cfg(any(feature = "derive", feature = "full"))]
286 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_structnull287 fn fold_expr_struct(&mut self, i: ExprStruct) -> ExprStruct {
288 fold_expr_struct(self, i)
289 }
290 #[cfg(feature = "full")]
291 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_trynull292 fn fold_expr_try(&mut self, i: ExprTry) -> ExprTry {
293 fold_expr_try(self, i)
294 }
295 #[cfg(feature = "full")]
296 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_try_blocknull297 fn fold_expr_try_block(&mut self, i: ExprTryBlock) -> ExprTryBlock {
298 fold_expr_try_block(self, i)
299 }
300 #[cfg(feature = "full")]
301 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_tuplenull302 fn fold_expr_tuple(&mut self, i: ExprTuple) -> ExprTuple {
303 fold_expr_tuple(self, i)
304 }
305 #[cfg(any(feature = "derive", feature = "full"))]
306 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_unarynull307 fn fold_expr_unary(&mut self, i: ExprUnary) -> ExprUnary {
308 fold_expr_unary(self, i)
309 }
310 #[cfg(feature = "full")]
311 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_unsafenull312 fn fold_expr_unsafe(&mut self, i: ExprUnsafe) -> ExprUnsafe {
313 fold_expr_unsafe(self, i)
314 }
315 #[cfg(feature = "full")]
316 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_whilenull317 fn fold_expr_while(&mut self, i: ExprWhile) -> ExprWhile {
318 fold_expr_while(self, i)
319 }
320 #[cfg(feature = "full")]
321 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_yieldnull322 fn fold_expr_yield(&mut self, i: ExprYield) -> ExprYield {
323 fold_expr_yield(self, i)
324 }
325 #[cfg(any(feature = "derive", feature = "full"))]
326 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fieldnull327 fn fold_field(&mut self, i: Field) -> Field {
328 fold_field(self, i)
329 }
330 #[cfg(any(feature = "derive", feature = "full"))]
331 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_field_mutabilitynull332 fn fold_field_mutability(&mut self, i: FieldMutability) -> FieldMutability {
333 fold_field_mutability(self, i)
334 }
335 #[cfg(feature = "full")]
336 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_field_patnull337 fn fold_field_pat(&mut self, i: FieldPat) -> FieldPat {
338 fold_field_pat(self, i)
339 }
340 #[cfg(any(feature = "derive", feature = "full"))]
341 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_field_valuenull342 fn fold_field_value(&mut self, i: FieldValue) -> FieldValue {
343 fold_field_value(self, i)
344 }
345 #[cfg(any(feature = "derive", feature = "full"))]
346 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fieldsnull347 fn fold_fields(&mut self, i: Fields) -> Fields {
348 fold_fields(self, i)
349 }
350 #[cfg(any(feature = "derive", feature = "full"))]
351 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fields_namednull352 fn fold_fields_named(&mut self, i: FieldsNamed) -> FieldsNamed {
353 fold_fields_named(self, i)
354 }
355 #[cfg(any(feature = "derive", feature = "full"))]
356 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fields_unnamednull357 fn fold_fields_unnamed(&mut self, i: FieldsUnnamed) -> FieldsUnnamed {
358 fold_fields_unnamed(self, i)
359 }
360 #[cfg(feature = "full")]
361 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_filenull362 fn fold_file(&mut self, i: File) -> File {
363 fold_file(self, i)
364 }
365 #[cfg(feature = "full")]
366 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_fn_argnull367 fn fold_fn_arg(&mut self, i: FnArg) -> FnArg {
368 fold_fn_arg(self, i)
369 }
370 #[cfg(feature = "full")]
371 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_itemnull372 fn fold_foreign_item(&mut self, i: ForeignItem) -> ForeignItem {
373 fold_foreign_item(self, i)
374 }
375 #[cfg(feature = "full")]
376 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_fnnull377 fn fold_foreign_item_fn(&mut self, i: ForeignItemFn) -> ForeignItemFn {
378 fold_foreign_item_fn(self, i)
379 }
380 #[cfg(feature = "full")]
381 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_macronull382 fn fold_foreign_item_macro(&mut self, i: ForeignItemMacro) -> ForeignItemMacro {
383 fold_foreign_item_macro(self, i)
384 }
385 #[cfg(feature = "full")]
386 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_staticnull387 fn fold_foreign_item_static(&mut self, i: ForeignItemStatic) -> ForeignItemStatic {
388 fold_foreign_item_static(self, i)
389 }
390 #[cfg(feature = "full")]
391 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_typenull392 fn fold_foreign_item_type(&mut self, i: ForeignItemType) -> ForeignItemType {
393 fold_foreign_item_type(self, i)
394 }
395 #[cfg(any(feature = "derive", feature = "full"))]
396 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_generic_argumentnull397 fn fold_generic_argument(&mut self, i: GenericArgument) -> GenericArgument {
398 fold_generic_argument(self, i)
399 }
400 #[cfg(any(feature = "derive", feature = "full"))]
401 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_generic_paramnull402 fn fold_generic_param(&mut self, i: GenericParam) -> GenericParam {
403 fold_generic_param(self, i)
404 }
405 #[cfg(any(feature = "derive", feature = "full"))]
406 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_genericsnull407 fn fold_generics(&mut self, i: Generics) -> Generics {
408 fold_generics(self, i)
409 }
fold_identnull410 fn fold_ident(&mut self, i: Ident) -> Ident {
411 fold_ident(self, i)
412 }
413 #[cfg(feature = "full")]
414 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_itemnull415 fn fold_impl_item(&mut self, i: ImplItem) -> ImplItem {
416 fold_impl_item(self, i)
417 }
418 #[cfg(feature = "full")]
419 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_constnull420 fn fold_impl_item_const(&mut self, i: ImplItemConst) -> ImplItemConst {
421 fold_impl_item_const(self, i)
422 }
423 #[cfg(feature = "full")]
424 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_fnnull425 fn fold_impl_item_fn(&mut self, i: ImplItemFn) -> ImplItemFn {
426 fold_impl_item_fn(self, i)
427 }
428 #[cfg(feature = "full")]
429 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_macronull430 fn fold_impl_item_macro(&mut self, i: ImplItemMacro) -> ImplItemMacro {
431 fold_impl_item_macro(self, i)
432 }
433 #[cfg(feature = "full")]
434 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_typenull435 fn fold_impl_item_type(&mut self, i: ImplItemType) -> ImplItemType {
436 fold_impl_item_type(self, i)
437 }
438 #[cfg(feature = "full")]
439 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_restrictionnull440 fn fold_impl_restriction(&mut self, i: ImplRestriction) -> ImplRestriction {
441 fold_impl_restriction(self, i)
442 }
443 #[cfg(any(feature = "derive", feature = "full"))]
444 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_indexnull445 fn fold_index(&mut self, i: Index) -> Index {
446 fold_index(self, i)
447 }
448 #[cfg(feature = "full")]
449 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_itemnull450 fn fold_item(&mut self, i: Item) -> Item {
451 fold_item(self, i)
452 }
453 #[cfg(feature = "full")]
454 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_constnull455 fn fold_item_const(&mut self, i: ItemConst) -> ItemConst {
456 fold_item_const(self, i)
457 }
458 #[cfg(feature = "full")]
459 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_enumnull460 fn fold_item_enum(&mut self, i: ItemEnum) -> ItemEnum {
461 fold_item_enum(self, i)
462 }
463 #[cfg(feature = "full")]
464 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_extern_cratenull465 fn fold_item_extern_crate(&mut self, i: ItemExternCrate) -> ItemExternCrate {
466 fold_item_extern_crate(self, i)
467 }
468 #[cfg(feature = "full")]
469 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_fnnull470 fn fold_item_fn(&mut self, i: ItemFn) -> ItemFn {
471 fold_item_fn(self, i)
472 }
473 #[cfg(feature = "full")]
474 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_foreign_modnull475 fn fold_item_foreign_mod(&mut self, i: ItemForeignMod) -> ItemForeignMod {
476 fold_item_foreign_mod(self, i)
477 }
478 #[cfg(feature = "full")]
479 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_implnull480 fn fold_item_impl(&mut self, i: ItemImpl) -> ItemImpl {
481 fold_item_impl(self, i)
482 }
483 #[cfg(feature = "full")]
484 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_macronull485 fn fold_item_macro(&mut self, i: ItemMacro) -> ItemMacro {
486 fold_item_macro(self, i)
487 }
488 #[cfg(feature = "full")]
489 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_modnull490 fn fold_item_mod(&mut self, i: ItemMod) -> ItemMod {
491 fold_item_mod(self, i)
492 }
493 #[cfg(feature = "full")]
494 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_staticnull495 fn fold_item_static(&mut self, i: ItemStatic) -> ItemStatic {
496 fold_item_static(self, i)
497 }
498 #[cfg(feature = "full")]
499 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_structnull500 fn fold_item_struct(&mut self, i: ItemStruct) -> ItemStruct {
501 fold_item_struct(self, i)
502 }
503 #[cfg(feature = "full")]
504 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_traitnull505 fn fold_item_trait(&mut self, i: ItemTrait) -> ItemTrait {
506 fold_item_trait(self, i)
507 }
508 #[cfg(feature = "full")]
509 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_trait_aliasnull510 fn fold_item_trait_alias(&mut self, i: ItemTraitAlias) -> ItemTraitAlias {
511 fold_item_trait_alias(self, i)
512 }
513 #[cfg(feature = "full")]
514 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_typenull515 fn fold_item_type(&mut self, i: ItemType) -> ItemType {
516 fold_item_type(self, i)
517 }
518 #[cfg(feature = "full")]
519 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_unionnull520 fn fold_item_union(&mut self, i: ItemUnion) -> ItemUnion {
521 fold_item_union(self, i)
522 }
523 #[cfg(feature = "full")]
524 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_usenull525 fn fold_item_use(&mut self, i: ItemUse) -> ItemUse {
526 fold_item_use(self, i)
527 }
528 #[cfg(feature = "full")]
529 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_labelnull530 fn fold_label(&mut self, i: Label) -> Label {
531 fold_label(self, i)
532 }
fold_lifetimenull533 fn fold_lifetime(&mut self, i: Lifetime) -> Lifetime {
534 fold_lifetime(self, i)
535 }
536 #[cfg(any(feature = "derive", feature = "full"))]
537 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_lifetime_paramnull538 fn fold_lifetime_param(&mut self, i: LifetimeParam) -> LifetimeParam {
539 fold_lifetime_param(self, i)
540 }
fold_litnull541 fn fold_lit(&mut self, i: Lit) -> Lit {
542 fold_lit(self, i)
543 }
fold_lit_boolnull544 fn fold_lit_bool(&mut self, i: LitBool) -> LitBool {
545 fold_lit_bool(self, i)
546 }
fold_lit_bytenull547 fn fold_lit_byte(&mut self, i: LitByte) -> LitByte {
548 fold_lit_byte(self, i)
549 }
fold_lit_byte_strnull550 fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr {
551 fold_lit_byte_str(self, i)
552 }
fold_lit_charnull553 fn fold_lit_char(&mut self, i: LitChar) -> LitChar {
554 fold_lit_char(self, i)
555 }
fold_lit_floatnull556 fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat {
557 fold_lit_float(self, i)
558 }
fold_lit_intnull559 fn fold_lit_int(&mut self, i: LitInt) -> LitInt {
560 fold_lit_int(self, i)
561 }
fold_lit_strnull562 fn fold_lit_str(&mut self, i: LitStr) -> LitStr {
563 fold_lit_str(self, i)
564 }
565 #[cfg(feature = "full")]
566 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_localnull567 fn fold_local(&mut self, i: Local) -> Local {
568 fold_local(self, i)
569 }
570 #[cfg(feature = "full")]
571 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_local_initnull572 fn fold_local_init(&mut self, i: LocalInit) -> LocalInit {
573 fold_local_init(self, i)
574 }
575 #[cfg(any(feature = "derive", feature = "full"))]
576 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_macronull577 fn fold_macro(&mut self, i: Macro) -> Macro {
578 fold_macro(self, i)
579 }
580 #[cfg(any(feature = "derive", feature = "full"))]
581 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_macro_delimiternull582 fn fold_macro_delimiter(&mut self, i: MacroDelimiter) -> MacroDelimiter {
583 fold_macro_delimiter(self, i)
584 }
585 #[cfg(any(feature = "derive", feature = "full"))]
586 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_membernull587 fn fold_member(&mut self, i: Member) -> Member {
588 fold_member(self, i)
589 }
590 #[cfg(any(feature = "derive", feature = "full"))]
591 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_metanull592 fn fold_meta(&mut self, i: Meta) -> Meta {
593 fold_meta(self, i)
594 }
595 #[cfg(any(feature = "derive", feature = "full"))]
596 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_meta_listnull597 fn fold_meta_list(&mut self, i: MetaList) -> MetaList {
598 fold_meta_list(self, i)
599 }
600 #[cfg(any(feature = "derive", feature = "full"))]
601 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_meta_name_valuenull602 fn fold_meta_name_value(&mut self, i: MetaNameValue) -> MetaNameValue {
603 fold_meta_name_value(self, i)
604 }
605 #[cfg(any(feature = "derive", feature = "full"))]
606 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_parenthesized_generic_argumentsnull607 fn fold_parenthesized_generic_arguments(
608 &mut self,
609 i: ParenthesizedGenericArguments,
610 ) -> ParenthesizedGenericArguments {
611 fold_parenthesized_generic_arguments(self, i)
612 }
613 #[cfg(feature = "full")]
614 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_patnull615 fn fold_pat(&mut self, i: Pat) -> Pat {
616 fold_pat(self, i)
617 }
618 #[cfg(feature = "full")]
619 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_identnull620 fn fold_pat_ident(&mut self, i: PatIdent) -> PatIdent {
621 fold_pat_ident(self, i)
622 }
623 #[cfg(feature = "full")]
624 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_ornull625 fn fold_pat_or(&mut self, i: PatOr) -> PatOr {
626 fold_pat_or(self, i)
627 }
628 #[cfg(feature = "full")]
629 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_parennull630 fn fold_pat_paren(&mut self, i: PatParen) -> PatParen {
631 fold_pat_paren(self, i)
632 }
633 #[cfg(feature = "full")]
634 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_referencenull635 fn fold_pat_reference(&mut self, i: PatReference) -> PatReference {
636 fold_pat_reference(self, i)
637 }
638 #[cfg(feature = "full")]
639 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_restnull640 fn fold_pat_rest(&mut self, i: PatRest) -> PatRest {
641 fold_pat_rest(self, i)
642 }
643 #[cfg(feature = "full")]
644 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_slicenull645 fn fold_pat_slice(&mut self, i: PatSlice) -> PatSlice {
646 fold_pat_slice(self, i)
647 }
648 #[cfg(feature = "full")]
649 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_structnull650 fn fold_pat_struct(&mut self, i: PatStruct) -> PatStruct {
651 fold_pat_struct(self, i)
652 }
653 #[cfg(feature = "full")]
654 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_tuplenull655 fn fold_pat_tuple(&mut self, i: PatTuple) -> PatTuple {
656 fold_pat_tuple(self, i)
657 }
658 #[cfg(feature = "full")]
659 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_tuple_structnull660 fn fold_pat_tuple_struct(&mut self, i: PatTupleStruct) -> PatTupleStruct {
661 fold_pat_tuple_struct(self, i)
662 }
663 #[cfg(feature = "full")]
664 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_typenull665 fn fold_pat_type(&mut self, i: PatType) -> PatType {
666 fold_pat_type(self, i)
667 }
668 #[cfg(feature = "full")]
669 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_wildnull670 fn fold_pat_wild(&mut self, i: PatWild) -> PatWild {
671 fold_pat_wild(self, i)
672 }
673 #[cfg(any(feature = "derive", feature = "full"))]
674 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_pathnull675 fn fold_path(&mut self, i: Path) -> Path {
676 fold_path(self, i)
677 }
678 #[cfg(any(feature = "derive", feature = "full"))]
679 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_path_argumentsnull680 fn fold_path_arguments(&mut self, i: PathArguments) -> PathArguments {
681 fold_path_arguments(self, i)
682 }
683 #[cfg(any(feature = "derive", feature = "full"))]
684 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_path_segmentnull685 fn fold_path_segment(&mut self, i: PathSegment) -> PathSegment {
686 fold_path_segment(self, i)
687 }
688 #[cfg(any(feature = "derive", feature = "full"))]
689 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_predicate_lifetimenull690 fn fold_predicate_lifetime(&mut self, i: PredicateLifetime) -> PredicateLifetime {
691 fold_predicate_lifetime(self, i)
692 }
693 #[cfg(any(feature = "derive", feature = "full"))]
694 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_predicate_typenull695 fn fold_predicate_type(&mut self, i: PredicateType) -> PredicateType {
696 fold_predicate_type(self, i)
697 }
698 #[cfg(any(feature = "derive", feature = "full"))]
699 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_qselfnull700 fn fold_qself(&mut self, i: QSelf) -> QSelf {
701 fold_qself(self, i)
702 }
703 #[cfg(feature = "full")]
704 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_range_limitsnull705 fn fold_range_limits(&mut self, i: RangeLimits) -> RangeLimits {
706 fold_range_limits(self, i)
707 }
708 #[cfg(feature = "full")]
709 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_receivernull710 fn fold_receiver(&mut self, i: Receiver) -> Receiver {
711 fold_receiver(self, i)
712 }
713 #[cfg(any(feature = "derive", feature = "full"))]
714 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_return_typenull715 fn fold_return_type(&mut self, i: ReturnType) -> ReturnType {
716 fold_return_type(self, i)
717 }
718 #[cfg(feature = "full")]
719 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_signaturenull720 fn fold_signature(&mut self, i: Signature) -> Signature {
721 fold_signature(self, i)
722 }
fold_spannull723 fn fold_span(&mut self, i: Span) -> Span {
724 fold_span(self, i)
725 }
726 #[cfg(feature = "full")]
727 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_static_mutabilitynull728 fn fold_static_mutability(&mut self, i: StaticMutability) -> StaticMutability {
729 fold_static_mutability(self, i)
730 }
731 #[cfg(feature = "full")]
732 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_stmtnull733 fn fold_stmt(&mut self, i: Stmt) -> Stmt {
734 fold_stmt(self, i)
735 }
736 #[cfg(feature = "full")]
737 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_stmt_macronull738 fn fold_stmt_macro(&mut self, i: StmtMacro) -> StmtMacro {
739 fold_stmt_macro(self, i)
740 }
741 #[cfg(any(feature = "derive", feature = "full"))]
742 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_trait_boundnull743 fn fold_trait_bound(&mut self, i: TraitBound) -> TraitBound {
744 fold_trait_bound(self, i)
745 }
746 #[cfg(any(feature = "derive", feature = "full"))]
747 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_trait_bound_modifiernull748 fn fold_trait_bound_modifier(
749 &mut self,
750 i: TraitBoundModifier,
751 ) -> TraitBoundModifier {
752 fold_trait_bound_modifier(self, i)
753 }
754 #[cfg(feature = "full")]
755 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_itemnull756 fn fold_trait_item(&mut self, i: TraitItem) -> TraitItem {
757 fold_trait_item(self, i)
758 }
759 #[cfg(feature = "full")]
760 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_constnull761 fn fold_trait_item_const(&mut self, i: TraitItemConst) -> TraitItemConst {
762 fold_trait_item_const(self, i)
763 }
764 #[cfg(feature = "full")]
765 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_fnnull766 fn fold_trait_item_fn(&mut self, i: TraitItemFn) -> TraitItemFn {
767 fold_trait_item_fn(self, i)
768 }
769 #[cfg(feature = "full")]
770 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_macronull771 fn fold_trait_item_macro(&mut self, i: TraitItemMacro) -> TraitItemMacro {
772 fold_trait_item_macro(self, i)
773 }
774 #[cfg(feature = "full")]
775 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_typenull776 fn fold_trait_item_type(&mut self, i: TraitItemType) -> TraitItemType {
777 fold_trait_item_type(self, i)
778 }
779 #[cfg(any(feature = "derive", feature = "full"))]
780 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_typenull781 fn fold_type(&mut self, i: Type) -> Type {
782 fold_type(self, i)
783 }
784 #[cfg(any(feature = "derive", feature = "full"))]
785 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_arraynull786 fn fold_type_array(&mut self, i: TypeArray) -> TypeArray {
787 fold_type_array(self, i)
788 }
789 #[cfg(any(feature = "derive", feature = "full"))]
790 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_bare_fnnull791 fn fold_type_bare_fn(&mut self, i: TypeBareFn) -> TypeBareFn {
792 fold_type_bare_fn(self, i)
793 }
794 #[cfg(any(feature = "derive", feature = "full"))]
795 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_groupnull796 fn fold_type_group(&mut self, i: TypeGroup) -> TypeGroup {
797 fold_type_group(self, i)
798 }
799 #[cfg(any(feature = "derive", feature = "full"))]
800 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_impl_traitnull801 fn fold_type_impl_trait(&mut self, i: TypeImplTrait) -> TypeImplTrait {
802 fold_type_impl_trait(self, i)
803 }
804 #[cfg(any(feature = "derive", feature = "full"))]
805 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_infernull806 fn fold_type_infer(&mut self, i: TypeInfer) -> TypeInfer {
807 fold_type_infer(self, i)
808 }
809 #[cfg(any(feature = "derive", feature = "full"))]
810 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_macronull811 fn fold_type_macro(&mut self, i: TypeMacro) -> TypeMacro {
812 fold_type_macro(self, i)
813 }
814 #[cfg(any(feature = "derive", feature = "full"))]
815 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_nevernull816 fn fold_type_never(&mut self, i: TypeNever) -> TypeNever {
817 fold_type_never(self, i)
818 }
819 #[cfg(any(feature = "derive", feature = "full"))]
820 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_paramnull821 fn fold_type_param(&mut self, i: TypeParam) -> TypeParam {
822 fold_type_param(self, i)
823 }
824 #[cfg(any(feature = "derive", feature = "full"))]
825 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_param_boundnull826 fn fold_type_param_bound(&mut self, i: TypeParamBound) -> TypeParamBound {
827 fold_type_param_bound(self, i)
828 }
829 #[cfg(any(feature = "derive", feature = "full"))]
830 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_parennull831 fn fold_type_paren(&mut self, i: TypeParen) -> TypeParen {
832 fold_type_paren(self, i)
833 }
834 #[cfg(any(feature = "derive", feature = "full"))]
835 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_pathnull836 fn fold_type_path(&mut self, i: TypePath) -> TypePath {
837 fold_type_path(self, i)
838 }
839 #[cfg(any(feature = "derive", feature = "full"))]
840 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_ptrnull841 fn fold_type_ptr(&mut self, i: TypePtr) -> TypePtr {
842 fold_type_ptr(self, i)
843 }
844 #[cfg(any(feature = "derive", feature = "full"))]
845 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_referencenull846 fn fold_type_reference(&mut self, i: TypeReference) -> TypeReference {
847 fold_type_reference(self, i)
848 }
849 #[cfg(any(feature = "derive", feature = "full"))]
850 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_slicenull851 fn fold_type_slice(&mut self, i: TypeSlice) -> TypeSlice {
852 fold_type_slice(self, i)
853 }
854 #[cfg(any(feature = "derive", feature = "full"))]
855 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_trait_objectnull856 fn fold_type_trait_object(&mut self, i: TypeTraitObject) -> TypeTraitObject {
857 fold_type_trait_object(self, i)
858 }
859 #[cfg(any(feature = "derive", feature = "full"))]
860 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_tuplenull861 fn fold_type_tuple(&mut self, i: TypeTuple) -> TypeTuple {
862 fold_type_tuple(self, i)
863 }
864 #[cfg(any(feature = "derive", feature = "full"))]
865 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_un_opnull866 fn fold_un_op(&mut self, i: UnOp) -> UnOp {
867 fold_un_op(self, i)
868 }
869 #[cfg(feature = "full")]
870 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_globnull871 fn fold_use_glob(&mut self, i: UseGlob) -> UseGlob {
872 fold_use_glob(self, i)
873 }
874 #[cfg(feature = "full")]
875 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_groupnull876 fn fold_use_group(&mut self, i: UseGroup) -> UseGroup {
877 fold_use_group(self, i)
878 }
879 #[cfg(feature = "full")]
880 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_namenull881 fn fold_use_name(&mut self, i: UseName) -> UseName {
882 fold_use_name(self, i)
883 }
884 #[cfg(feature = "full")]
885 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_pathnull886 fn fold_use_path(&mut self, i: UsePath) -> UsePath {
887 fold_use_path(self, i)
888 }
889 #[cfg(feature = "full")]
890 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_renamenull891 fn fold_use_rename(&mut self, i: UseRename) -> UseRename {
892 fold_use_rename(self, i)
893 }
894 #[cfg(feature = "full")]
895 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_treenull896 fn fold_use_tree(&mut self, i: UseTree) -> UseTree {
897 fold_use_tree(self, i)
898 }
899 #[cfg(feature = "full")]
900 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_variadicnull901 fn fold_variadic(&mut self, i: Variadic) -> Variadic {
902 fold_variadic(self, i)
903 }
904 #[cfg(any(feature = "derive", feature = "full"))]
905 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_variantnull906 fn fold_variant(&mut self, i: Variant) -> Variant {
907 fold_variant(self, i)
908 }
909 #[cfg(any(feature = "derive", feature = "full"))]
910 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_vis_restrictednull911 fn fold_vis_restricted(&mut self, i: VisRestricted) -> VisRestricted {
912 fold_vis_restricted(self, i)
913 }
914 #[cfg(any(feature = "derive", feature = "full"))]
915 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_visibilitynull916 fn fold_visibility(&mut self, i: Visibility) -> Visibility {
917 fold_visibility(self, i)
918 }
919 #[cfg(any(feature = "derive", feature = "full"))]
920 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_where_clausenull921 fn fold_where_clause(&mut self, i: WhereClause) -> WhereClause {
922 fold_where_clause(self, i)
923 }
924 #[cfg(any(feature = "derive", feature = "full"))]
925 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_where_predicatenull926 fn fold_where_predicate(&mut self, i: WherePredicate) -> WherePredicate {
927 fold_where_predicate(self, i)
928 }
929 }
930 #[cfg(any(feature = "derive", feature = "full"))]
931 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_abinull932 pub fn fold_abi<F>(f: &mut F, node: Abi) -> Abi
933 where
934 F: Fold + ?Sized,
935 {
936 Abi {
937 extern_token: node.extern_token,
938 name: (node.name).map(|it| f.fold_lit_str(it)),
939 }
940 }
941 #[cfg(any(feature = "derive", feature = "full"))]
942 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_angle_bracketed_generic_argumentsnull943 pub fn fold_angle_bracketed_generic_arguments<F>(
944 f: &mut F,
945 node: AngleBracketedGenericArguments,
946 ) -> AngleBracketedGenericArguments
947 where
948 F: Fold + ?Sized,
949 {
950 AngleBracketedGenericArguments {
951 colon2_token: node.colon2_token,
952 lt_token: node.lt_token,
953 args: FoldHelper::lift(node.args, |it| f.fold_generic_argument(it)),
954 gt_token: node.gt_token,
955 }
956 }
957 #[cfg(feature = "full")]
958 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_armnull959 pub fn fold_arm<F>(f: &mut F, node: Arm) -> Arm
960 where
961 F: Fold + ?Sized,
962 {
963 Arm {
964 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
965 pat: f.fold_pat(node.pat),
966 guard: (node.guard).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
967 fat_arrow_token: node.fat_arrow_token,
968 body: Box::new(f.fold_expr(*node.body)),
969 comma: node.comma,
970 }
971 }
972 #[cfg(any(feature = "derive", feature = "full"))]
973 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_assoc_constnull974 pub fn fold_assoc_const<F>(f: &mut F, node: AssocConst) -> AssocConst
975 where
976 F: Fold + ?Sized,
977 {
978 AssocConst {
979 ident: f.fold_ident(node.ident),
980 generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
981 eq_token: node.eq_token,
982 value: f.fold_expr(node.value),
983 }
984 }
985 #[cfg(any(feature = "derive", feature = "full"))]
986 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_assoc_typenull987 pub fn fold_assoc_type<F>(f: &mut F, node: AssocType) -> AssocType
988 where
989 F: Fold + ?Sized,
990 {
991 AssocType {
992 ident: f.fold_ident(node.ident),
993 generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
994 eq_token: node.eq_token,
995 ty: f.fold_type(node.ty),
996 }
997 }
998 #[cfg(any(feature = "derive", feature = "full"))]
999 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_attr_stylenull1000 pub fn fold_attr_style<F>(f: &mut F, node: AttrStyle) -> AttrStyle
1001 where
1002 F: Fold + ?Sized,
1003 {
1004 match node {
1005 AttrStyle::Outer => AttrStyle::Outer,
1006 AttrStyle::Inner(_binding_0) => AttrStyle::Inner(_binding_0),
1007 }
1008 }
1009 #[cfg(any(feature = "derive", feature = "full"))]
1010 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_attributenull1011 pub fn fold_attribute<F>(f: &mut F, node: Attribute) -> Attribute
1012 where
1013 F: Fold + ?Sized,
1014 {
1015 Attribute {
1016 pound_token: node.pound_token,
1017 style: f.fold_attr_style(node.style),
1018 bracket_token: node.bracket_token,
1019 meta: f.fold_meta(node.meta),
1020 }
1021 }
1022 #[cfg(any(feature = "derive", feature = "full"))]
1023 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bare_fn_argnull1024 pub fn fold_bare_fn_arg<F>(f: &mut F, node: BareFnArg) -> BareFnArg
1025 where
1026 F: Fold + ?Sized,
1027 {
1028 BareFnArg {
1029 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1030 name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
1031 ty: f.fold_type(node.ty),
1032 }
1033 }
1034 #[cfg(any(feature = "derive", feature = "full"))]
1035 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bare_variadicnull1036 pub fn fold_bare_variadic<F>(f: &mut F, node: BareVariadic) -> BareVariadic
1037 where
1038 F: Fold + ?Sized,
1039 {
1040 BareVariadic {
1041 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1042 name: (node.name).map(|it| (f.fold_ident((it).0), (it).1)),
1043 dots: node.dots,
1044 comma: node.comma,
1045 }
1046 }
1047 #[cfg(any(feature = "derive", feature = "full"))]
1048 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bin_opnull1049 pub fn fold_bin_op<F>(f: &mut F, node: BinOp) -> BinOp
1050 where
1051 F: Fold + ?Sized,
1052 {
1053 match node {
1054 BinOp::Add(_binding_0) => BinOp::Add(_binding_0),
1055 BinOp::Sub(_binding_0) => BinOp::Sub(_binding_0),
1056 BinOp::Mul(_binding_0) => BinOp::Mul(_binding_0),
1057 BinOp::Div(_binding_0) => BinOp::Div(_binding_0),
1058 BinOp::Rem(_binding_0) => BinOp::Rem(_binding_0),
1059 BinOp::And(_binding_0) => BinOp::And(_binding_0),
1060 BinOp::Or(_binding_0) => BinOp::Or(_binding_0),
1061 BinOp::BitXor(_binding_0) => BinOp::BitXor(_binding_0),
1062 BinOp::BitAnd(_binding_0) => BinOp::BitAnd(_binding_0),
1063 BinOp::BitOr(_binding_0) => BinOp::BitOr(_binding_0),
1064 BinOp::Shl(_binding_0) => BinOp::Shl(_binding_0),
1065 BinOp::Shr(_binding_0) => BinOp::Shr(_binding_0),
1066 BinOp::Eq(_binding_0) => BinOp::Eq(_binding_0),
1067 BinOp::Lt(_binding_0) => BinOp::Lt(_binding_0),
1068 BinOp::Le(_binding_0) => BinOp::Le(_binding_0),
1069 BinOp::Ne(_binding_0) => BinOp::Ne(_binding_0),
1070 BinOp::Ge(_binding_0) => BinOp::Ge(_binding_0),
1071 BinOp::Gt(_binding_0) => BinOp::Gt(_binding_0),
1072 BinOp::AddAssign(_binding_0) => BinOp::AddAssign(_binding_0),
1073 BinOp::SubAssign(_binding_0) => BinOp::SubAssign(_binding_0),
1074 BinOp::MulAssign(_binding_0) => BinOp::MulAssign(_binding_0),
1075 BinOp::DivAssign(_binding_0) => BinOp::DivAssign(_binding_0),
1076 BinOp::RemAssign(_binding_0) => BinOp::RemAssign(_binding_0),
1077 BinOp::BitXorAssign(_binding_0) => BinOp::BitXorAssign(_binding_0),
1078 BinOp::BitAndAssign(_binding_0) => BinOp::BitAndAssign(_binding_0),
1079 BinOp::BitOrAssign(_binding_0) => BinOp::BitOrAssign(_binding_0),
1080 BinOp::ShlAssign(_binding_0) => BinOp::ShlAssign(_binding_0),
1081 BinOp::ShrAssign(_binding_0) => BinOp::ShrAssign(_binding_0),
1082 }
1083 }
1084 #[cfg(feature = "full")]
1085 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_blocknull1086 pub fn fold_block<F>(f: &mut F, node: Block) -> Block
1087 where
1088 F: Fold + ?Sized,
1089 {
1090 Block {
1091 brace_token: node.brace_token,
1092 stmts: FoldHelper::lift(node.stmts, |it| f.fold_stmt(it)),
1093 }
1094 }
1095 #[cfg(any(feature = "derive", feature = "full"))]
1096 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_bound_lifetimesnull1097 pub fn fold_bound_lifetimes<F>(f: &mut F, node: BoundLifetimes) -> BoundLifetimes
1098 where
1099 F: Fold + ?Sized,
1100 {
1101 BoundLifetimes {
1102 for_token: node.for_token,
1103 lt_token: node.lt_token,
1104 lifetimes: FoldHelper::lift(node.lifetimes, |it| f.fold_generic_param(it)),
1105 gt_token: node.gt_token,
1106 }
1107 }
1108 #[cfg(any(feature = "derive", feature = "full"))]
1109 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_const_paramnull1110 pub fn fold_const_param<F>(f: &mut F, node: ConstParam) -> ConstParam
1111 where
1112 F: Fold + ?Sized,
1113 {
1114 ConstParam {
1115 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1116 const_token: node.const_token,
1117 ident: f.fold_ident(node.ident),
1118 colon_token: node.colon_token,
1119 ty: f.fold_type(node.ty),
1120 eq_token: node.eq_token,
1121 default: (node.default).map(|it| f.fold_expr(it)),
1122 }
1123 }
1124 #[cfg(any(feature = "derive", feature = "full"))]
1125 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_constraintnull1126 pub fn fold_constraint<F>(f: &mut F, node: Constraint) -> Constraint
1127 where
1128 F: Fold + ?Sized,
1129 {
1130 Constraint {
1131 ident: f.fold_ident(node.ident),
1132 generics: (node.generics).map(|it| f.fold_angle_bracketed_generic_arguments(it)),
1133 colon_token: node.colon_token,
1134 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
1135 }
1136 }
1137 #[cfg(feature = "derive")]
1138 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_datanull1139 pub fn fold_data<F>(f: &mut F, node: Data) -> Data
1140 where
1141 F: Fold + ?Sized,
1142 {
1143 match node {
1144 Data::Struct(_binding_0) => Data::Struct(f.fold_data_struct(_binding_0)),
1145 Data::Enum(_binding_0) => Data::Enum(f.fold_data_enum(_binding_0)),
1146 Data::Union(_binding_0) => Data::Union(f.fold_data_union(_binding_0)),
1147 }
1148 }
1149 #[cfg(feature = "derive")]
1150 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_enumnull1151 pub fn fold_data_enum<F>(f: &mut F, node: DataEnum) -> DataEnum
1152 where
1153 F: Fold + ?Sized,
1154 {
1155 DataEnum {
1156 enum_token: node.enum_token,
1157 brace_token: node.brace_token,
1158 variants: FoldHelper::lift(node.variants, |it| f.fold_variant(it)),
1159 }
1160 }
1161 #[cfg(feature = "derive")]
1162 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_structnull1163 pub fn fold_data_struct<F>(f: &mut F, node: DataStruct) -> DataStruct
1164 where
1165 F: Fold + ?Sized,
1166 {
1167 DataStruct {
1168 struct_token: node.struct_token,
1169 fields: f.fold_fields(node.fields),
1170 semi_token: node.semi_token,
1171 }
1172 }
1173 #[cfg(feature = "derive")]
1174 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_data_unionnull1175 pub fn fold_data_union<F>(f: &mut F, node: DataUnion) -> DataUnion
1176 where
1177 F: Fold + ?Sized,
1178 {
1179 DataUnion {
1180 union_token: node.union_token,
1181 fields: f.fold_fields_named(node.fields),
1182 }
1183 }
1184 #[cfg(feature = "derive")]
1185 #[cfg_attr(doc_cfg, doc(cfg(feature = "derive")))]
fold_derive_inputnull1186 pub fn fold_derive_input<F>(f: &mut F, node: DeriveInput) -> DeriveInput
1187 where
1188 F: Fold + ?Sized,
1189 {
1190 DeriveInput {
1191 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1192 vis: f.fold_visibility(node.vis),
1193 ident: f.fold_ident(node.ident),
1194 generics: f.fold_generics(node.generics),
1195 data: f.fold_data(node.data),
1196 }
1197 }
1198 #[cfg(any(feature = "derive", feature = "full"))]
1199 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_exprnull1200 pub fn fold_expr<F>(f: &mut F, node: Expr) -> Expr
1201 where
1202 F: Fold + ?Sized,
1203 {
1204 match node {
1205 Expr::Array(_binding_0) => Expr::Array(full!(f.fold_expr_array(_binding_0))),
1206 Expr::Assign(_binding_0) => Expr::Assign(full!(f.fold_expr_assign(_binding_0))),
1207 Expr::Async(_binding_0) => Expr::Async(full!(f.fold_expr_async(_binding_0))),
1208 Expr::Await(_binding_0) => Expr::Await(full!(f.fold_expr_await(_binding_0))),
1209 Expr::Binary(_binding_0) => Expr::Binary(f.fold_expr_binary(_binding_0)),
1210 Expr::Block(_binding_0) => Expr::Block(full!(f.fold_expr_block(_binding_0))),
1211 Expr::Break(_binding_0) => Expr::Break(full!(f.fold_expr_break(_binding_0))),
1212 Expr::Call(_binding_0) => Expr::Call(f.fold_expr_call(_binding_0)),
1213 Expr::Cast(_binding_0) => Expr::Cast(f.fold_expr_cast(_binding_0)),
1214 Expr::Closure(_binding_0) => {
1215 Expr::Closure(full!(f.fold_expr_closure(_binding_0)))
1216 }
1217 Expr::Const(_binding_0) => Expr::Const(full!(f.fold_expr_const(_binding_0))),
1218 Expr::Continue(_binding_0) => {
1219 Expr::Continue(full!(f.fold_expr_continue(_binding_0)))
1220 }
1221 Expr::Field(_binding_0) => Expr::Field(f.fold_expr_field(_binding_0)),
1222 Expr::ForLoop(_binding_0) => {
1223 Expr::ForLoop(full!(f.fold_expr_for_loop(_binding_0)))
1224 }
1225 Expr::Group(_binding_0) => Expr::Group(f.fold_expr_group(_binding_0)),
1226 Expr::If(_binding_0) => Expr::If(full!(f.fold_expr_if(_binding_0))),
1227 Expr::Index(_binding_0) => Expr::Index(f.fold_expr_index(_binding_0)),
1228 Expr::Infer(_binding_0) => Expr::Infer(full!(f.fold_expr_infer(_binding_0))),
1229 Expr::Let(_binding_0) => Expr::Let(full!(f.fold_expr_let(_binding_0))),
1230 Expr::Lit(_binding_0) => Expr::Lit(f.fold_expr_lit(_binding_0)),
1231 Expr::Loop(_binding_0) => Expr::Loop(full!(f.fold_expr_loop(_binding_0))),
1232 Expr::Macro(_binding_0) => Expr::Macro(f.fold_expr_macro(_binding_0)),
1233 Expr::Match(_binding_0) => Expr::Match(full!(f.fold_expr_match(_binding_0))),
1234 Expr::MethodCall(_binding_0) => {
1235 Expr::MethodCall(f.fold_expr_method_call(_binding_0))
1236 }
1237 Expr::Paren(_binding_0) => Expr::Paren(f.fold_expr_paren(_binding_0)),
1238 Expr::Path(_binding_0) => Expr::Path(f.fold_expr_path(_binding_0)),
1239 Expr::Range(_binding_0) => Expr::Range(full!(f.fold_expr_range(_binding_0))),
1240 Expr::Reference(_binding_0) => Expr::Reference(f.fold_expr_reference(_binding_0)),
1241 Expr::Repeat(_binding_0) => Expr::Repeat(full!(f.fold_expr_repeat(_binding_0))),
1242 Expr::Return(_binding_0) => Expr::Return(full!(f.fold_expr_return(_binding_0))),
1243 Expr::Struct(_binding_0) => Expr::Struct(f.fold_expr_struct(_binding_0)),
1244 Expr::Try(_binding_0) => Expr::Try(full!(f.fold_expr_try(_binding_0))),
1245 Expr::TryBlock(_binding_0) => {
1246 Expr::TryBlock(full!(f.fold_expr_try_block(_binding_0)))
1247 }
1248 Expr::Tuple(_binding_0) => Expr::Tuple(full!(f.fold_expr_tuple(_binding_0))),
1249 Expr::Unary(_binding_0) => Expr::Unary(f.fold_expr_unary(_binding_0)),
1250 Expr::Unsafe(_binding_0) => Expr::Unsafe(full!(f.fold_expr_unsafe(_binding_0))),
1251 Expr::Verbatim(_binding_0) => Expr::Verbatim(_binding_0),
1252 Expr::While(_binding_0) => Expr::While(full!(f.fold_expr_while(_binding_0))),
1253 Expr::Yield(_binding_0) => Expr::Yield(full!(f.fold_expr_yield(_binding_0))),
1254 }
1255 }
1256 #[cfg(feature = "full")]
1257 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_arraynull1258 pub fn fold_expr_array<F>(f: &mut F, node: ExprArray) -> ExprArray
1259 where
1260 F: Fold + ?Sized,
1261 {
1262 ExprArray {
1263 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1264 bracket_token: node.bracket_token,
1265 elems: FoldHelper::lift(node.elems, |it| f.fold_expr(it)),
1266 }
1267 }
1268 #[cfg(feature = "full")]
1269 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_assignnull1270 pub fn fold_expr_assign<F>(f: &mut F, node: ExprAssign) -> ExprAssign
1271 where
1272 F: Fold + ?Sized,
1273 {
1274 ExprAssign {
1275 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1276 left: Box::new(f.fold_expr(*node.left)),
1277 eq_token: node.eq_token,
1278 right: Box::new(f.fold_expr(*node.right)),
1279 }
1280 }
1281 #[cfg(feature = "full")]
1282 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_asyncnull1283 pub fn fold_expr_async<F>(f: &mut F, node: ExprAsync) -> ExprAsync
1284 where
1285 F: Fold + ?Sized,
1286 {
1287 ExprAsync {
1288 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1289 async_token: node.async_token,
1290 capture: node.capture,
1291 block: f.fold_block(node.block),
1292 }
1293 }
1294 #[cfg(feature = "full")]
1295 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_awaitnull1296 pub fn fold_expr_await<F>(f: &mut F, node: ExprAwait) -> ExprAwait
1297 where
1298 F: Fold + ?Sized,
1299 {
1300 ExprAwait {
1301 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1302 base: Box::new(f.fold_expr(*node.base)),
1303 dot_token: node.dot_token,
1304 await_token: node.await_token,
1305 }
1306 }
1307 #[cfg(any(feature = "derive", feature = "full"))]
1308 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_binarynull1309 pub fn fold_expr_binary<F>(f: &mut F, node: ExprBinary) -> ExprBinary
1310 where
1311 F: Fold + ?Sized,
1312 {
1313 ExprBinary {
1314 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1315 left: Box::new(f.fold_expr(*node.left)),
1316 op: f.fold_bin_op(node.op),
1317 right: Box::new(f.fold_expr(*node.right)),
1318 }
1319 }
1320 #[cfg(feature = "full")]
1321 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_blocknull1322 pub fn fold_expr_block<F>(f: &mut F, node: ExprBlock) -> ExprBlock
1323 where
1324 F: Fold + ?Sized,
1325 {
1326 ExprBlock {
1327 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1328 label: (node.label).map(|it| f.fold_label(it)),
1329 block: f.fold_block(node.block),
1330 }
1331 }
1332 #[cfg(feature = "full")]
1333 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_breaknull1334 pub fn fold_expr_break<F>(f: &mut F, node: ExprBreak) -> ExprBreak
1335 where
1336 F: Fold + ?Sized,
1337 {
1338 ExprBreak {
1339 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1340 break_token: node.break_token,
1341 label: (node.label).map(|it| f.fold_lifetime(it)),
1342 expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
1343 }
1344 }
1345 #[cfg(any(feature = "derive", feature = "full"))]
1346 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_callnull1347 pub fn fold_expr_call<F>(f: &mut F, node: ExprCall) -> ExprCall
1348 where
1349 F: Fold + ?Sized,
1350 {
1351 ExprCall {
1352 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1353 func: Box::new(f.fold_expr(*node.func)),
1354 paren_token: node.paren_token,
1355 args: FoldHelper::lift(node.args, |it| f.fold_expr(it)),
1356 }
1357 }
1358 #[cfg(any(feature = "derive", feature = "full"))]
1359 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_castnull1360 pub fn fold_expr_cast<F>(f: &mut F, node: ExprCast) -> ExprCast
1361 where
1362 F: Fold + ?Sized,
1363 {
1364 ExprCast {
1365 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1366 expr: Box::new(f.fold_expr(*node.expr)),
1367 as_token: node.as_token,
1368 ty: Box::new(f.fold_type(*node.ty)),
1369 }
1370 }
1371 #[cfg(feature = "full")]
1372 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_closurenull1373 pub fn fold_expr_closure<F>(f: &mut F, node: ExprClosure) -> ExprClosure
1374 where
1375 F: Fold + ?Sized,
1376 {
1377 ExprClosure {
1378 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1379 lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
1380 constness: node.constness,
1381 movability: node.movability,
1382 asyncness: node.asyncness,
1383 capture: node.capture,
1384 or1_token: node.or1_token,
1385 inputs: FoldHelper::lift(node.inputs, |it| f.fold_pat(it)),
1386 or2_token: node.or2_token,
1387 output: f.fold_return_type(node.output),
1388 body: Box::new(f.fold_expr(*node.body)),
1389 }
1390 }
1391 #[cfg(feature = "full")]
1392 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_constnull1393 pub fn fold_expr_const<F>(f: &mut F, node: ExprConst) -> ExprConst
1394 where
1395 F: Fold + ?Sized,
1396 {
1397 ExprConst {
1398 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1399 const_token: node.const_token,
1400 block: f.fold_block(node.block),
1401 }
1402 }
1403 #[cfg(feature = "full")]
1404 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_continuenull1405 pub fn fold_expr_continue<F>(f: &mut F, node: ExprContinue) -> ExprContinue
1406 where
1407 F: Fold + ?Sized,
1408 {
1409 ExprContinue {
1410 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1411 continue_token: node.continue_token,
1412 label: (node.label).map(|it| f.fold_lifetime(it)),
1413 }
1414 }
1415 #[cfg(any(feature = "derive", feature = "full"))]
1416 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_fieldnull1417 pub fn fold_expr_field<F>(f: &mut F, node: ExprField) -> ExprField
1418 where
1419 F: Fold + ?Sized,
1420 {
1421 ExprField {
1422 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1423 base: Box::new(f.fold_expr(*node.base)),
1424 dot_token: node.dot_token,
1425 member: f.fold_member(node.member),
1426 }
1427 }
1428 #[cfg(feature = "full")]
1429 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_for_loopnull1430 pub fn fold_expr_for_loop<F>(f: &mut F, node: ExprForLoop) -> ExprForLoop
1431 where
1432 F: Fold + ?Sized,
1433 {
1434 ExprForLoop {
1435 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1436 label: (node.label).map(|it| f.fold_label(it)),
1437 for_token: node.for_token,
1438 pat: Box::new(f.fold_pat(*node.pat)),
1439 in_token: node.in_token,
1440 expr: Box::new(f.fold_expr(*node.expr)),
1441 body: f.fold_block(node.body),
1442 }
1443 }
1444 #[cfg(any(feature = "derive", feature = "full"))]
1445 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_groupnull1446 pub fn fold_expr_group<F>(f: &mut F, node: ExprGroup) -> ExprGroup
1447 where
1448 F: Fold + ?Sized,
1449 {
1450 ExprGroup {
1451 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1452 group_token: node.group_token,
1453 expr: Box::new(f.fold_expr(*node.expr)),
1454 }
1455 }
1456 #[cfg(feature = "full")]
1457 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_ifnull1458 pub fn fold_expr_if<F>(f: &mut F, node: ExprIf) -> ExprIf
1459 where
1460 F: Fold + ?Sized,
1461 {
1462 ExprIf {
1463 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1464 if_token: node.if_token,
1465 cond: Box::new(f.fold_expr(*node.cond)),
1466 then_branch: f.fold_block(node.then_branch),
1467 else_branch: (node.else_branch)
1468 .map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
1469 }
1470 }
1471 #[cfg(any(feature = "derive", feature = "full"))]
1472 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_indexnull1473 pub fn fold_expr_index<F>(f: &mut F, node: ExprIndex) -> ExprIndex
1474 where
1475 F: Fold + ?Sized,
1476 {
1477 ExprIndex {
1478 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1479 expr: Box::new(f.fold_expr(*node.expr)),
1480 bracket_token: node.bracket_token,
1481 index: Box::new(f.fold_expr(*node.index)),
1482 }
1483 }
1484 #[cfg(feature = "full")]
1485 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_infernull1486 pub fn fold_expr_infer<F>(f: &mut F, node: ExprInfer) -> ExprInfer
1487 where
1488 F: Fold + ?Sized,
1489 {
1490 ExprInfer {
1491 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1492 underscore_token: node.underscore_token,
1493 }
1494 }
1495 #[cfg(feature = "full")]
1496 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_letnull1497 pub fn fold_expr_let<F>(f: &mut F, node: ExprLet) -> ExprLet
1498 where
1499 F: Fold + ?Sized,
1500 {
1501 ExprLet {
1502 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1503 let_token: node.let_token,
1504 pat: Box::new(f.fold_pat(*node.pat)),
1505 eq_token: node.eq_token,
1506 expr: Box::new(f.fold_expr(*node.expr)),
1507 }
1508 }
1509 #[cfg(any(feature = "derive", feature = "full"))]
1510 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_litnull1511 pub fn fold_expr_lit<F>(f: &mut F, node: ExprLit) -> ExprLit
1512 where
1513 F: Fold + ?Sized,
1514 {
1515 ExprLit {
1516 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1517 lit: f.fold_lit(node.lit),
1518 }
1519 }
1520 #[cfg(feature = "full")]
1521 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_loopnull1522 pub fn fold_expr_loop<F>(f: &mut F, node: ExprLoop) -> ExprLoop
1523 where
1524 F: Fold + ?Sized,
1525 {
1526 ExprLoop {
1527 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1528 label: (node.label).map(|it| f.fold_label(it)),
1529 loop_token: node.loop_token,
1530 body: f.fold_block(node.body),
1531 }
1532 }
1533 #[cfg(any(feature = "derive", feature = "full"))]
1534 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_macronull1535 pub fn fold_expr_macro<F>(f: &mut F, node: ExprMacro) -> ExprMacro
1536 where
1537 F: Fold + ?Sized,
1538 {
1539 ExprMacro {
1540 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1541 mac: f.fold_macro(node.mac),
1542 }
1543 }
1544 #[cfg(feature = "full")]
1545 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_matchnull1546 pub fn fold_expr_match<F>(f: &mut F, node: ExprMatch) -> ExprMatch
1547 where
1548 F: Fold + ?Sized,
1549 {
1550 ExprMatch {
1551 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1552 match_token: node.match_token,
1553 expr: Box::new(f.fold_expr(*node.expr)),
1554 brace_token: node.brace_token,
1555 arms: FoldHelper::lift(node.arms, |it| f.fold_arm(it)),
1556 }
1557 }
1558 #[cfg(any(feature = "derive", feature = "full"))]
1559 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_method_callnull1560 pub fn fold_expr_method_call<F>(f: &mut F, node: ExprMethodCall) -> ExprMethodCall
1561 where
1562 F: Fold + ?Sized,
1563 {
1564 ExprMethodCall {
1565 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1566 receiver: Box::new(f.fold_expr(*node.receiver)),
1567 dot_token: node.dot_token,
1568 method: f.fold_ident(node.method),
1569 turbofish: (node.turbofish)
1570 .map(|it| f.fold_angle_bracketed_generic_arguments(it)),
1571 paren_token: node.paren_token,
1572 args: FoldHelper::lift(node.args, |it| f.fold_expr(it)),
1573 }
1574 }
1575 #[cfg(any(feature = "derive", feature = "full"))]
1576 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_parennull1577 pub fn fold_expr_paren<F>(f: &mut F, node: ExprParen) -> ExprParen
1578 where
1579 F: Fold + ?Sized,
1580 {
1581 ExprParen {
1582 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1583 paren_token: node.paren_token,
1584 expr: Box::new(f.fold_expr(*node.expr)),
1585 }
1586 }
1587 #[cfg(any(feature = "derive", feature = "full"))]
1588 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_pathnull1589 pub fn fold_expr_path<F>(f: &mut F, node: ExprPath) -> ExprPath
1590 where
1591 F: Fold + ?Sized,
1592 {
1593 ExprPath {
1594 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1595 qself: (node.qself).map(|it| f.fold_qself(it)),
1596 path: f.fold_path(node.path),
1597 }
1598 }
1599 #[cfg(feature = "full")]
1600 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_rangenull1601 pub fn fold_expr_range<F>(f: &mut F, node: ExprRange) -> ExprRange
1602 where
1603 F: Fold + ?Sized,
1604 {
1605 ExprRange {
1606 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1607 start: (node.start).map(|it| Box::new(f.fold_expr(*it))),
1608 limits: f.fold_range_limits(node.limits),
1609 end: (node.end).map(|it| Box::new(f.fold_expr(*it))),
1610 }
1611 }
1612 #[cfg(any(feature = "derive", feature = "full"))]
1613 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_referencenull1614 pub fn fold_expr_reference<F>(f: &mut F, node: ExprReference) -> ExprReference
1615 where
1616 F: Fold + ?Sized,
1617 {
1618 ExprReference {
1619 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1620 and_token: node.and_token,
1621 mutability: node.mutability,
1622 expr: Box::new(f.fold_expr(*node.expr)),
1623 }
1624 }
1625 #[cfg(feature = "full")]
1626 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_repeatnull1627 pub fn fold_expr_repeat<F>(f: &mut F, node: ExprRepeat) -> ExprRepeat
1628 where
1629 F: Fold + ?Sized,
1630 {
1631 ExprRepeat {
1632 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1633 bracket_token: node.bracket_token,
1634 expr: Box::new(f.fold_expr(*node.expr)),
1635 semi_token: node.semi_token,
1636 len: Box::new(f.fold_expr(*node.len)),
1637 }
1638 }
1639 #[cfg(feature = "full")]
1640 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_returnnull1641 pub fn fold_expr_return<F>(f: &mut F, node: ExprReturn) -> ExprReturn
1642 where
1643 F: Fold + ?Sized,
1644 {
1645 ExprReturn {
1646 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1647 return_token: node.return_token,
1648 expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
1649 }
1650 }
1651 #[cfg(any(feature = "derive", feature = "full"))]
1652 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_structnull1653 pub fn fold_expr_struct<F>(f: &mut F, node: ExprStruct) -> ExprStruct
1654 where
1655 F: Fold + ?Sized,
1656 {
1657 ExprStruct {
1658 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1659 qself: (node.qself).map(|it| f.fold_qself(it)),
1660 path: f.fold_path(node.path),
1661 brace_token: node.brace_token,
1662 fields: FoldHelper::lift(node.fields, |it| f.fold_field_value(it)),
1663 dot2_token: node.dot2_token,
1664 rest: (node.rest).map(|it| Box::new(f.fold_expr(*it))),
1665 }
1666 }
1667 #[cfg(feature = "full")]
1668 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_trynull1669 pub fn fold_expr_try<F>(f: &mut F, node: ExprTry) -> ExprTry
1670 where
1671 F: Fold + ?Sized,
1672 {
1673 ExprTry {
1674 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1675 expr: Box::new(f.fold_expr(*node.expr)),
1676 question_token: node.question_token,
1677 }
1678 }
1679 #[cfg(feature = "full")]
1680 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_try_blocknull1681 pub fn fold_expr_try_block<F>(f: &mut F, node: ExprTryBlock) -> ExprTryBlock
1682 where
1683 F: Fold + ?Sized,
1684 {
1685 ExprTryBlock {
1686 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1687 try_token: node.try_token,
1688 block: f.fold_block(node.block),
1689 }
1690 }
1691 #[cfg(feature = "full")]
1692 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_tuplenull1693 pub fn fold_expr_tuple<F>(f: &mut F, node: ExprTuple) -> ExprTuple
1694 where
1695 F: Fold + ?Sized,
1696 {
1697 ExprTuple {
1698 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1699 paren_token: node.paren_token,
1700 elems: FoldHelper::lift(node.elems, |it| f.fold_expr(it)),
1701 }
1702 }
1703 #[cfg(any(feature = "derive", feature = "full"))]
1704 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_expr_unarynull1705 pub fn fold_expr_unary<F>(f: &mut F, node: ExprUnary) -> ExprUnary
1706 where
1707 F: Fold + ?Sized,
1708 {
1709 ExprUnary {
1710 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1711 op: f.fold_un_op(node.op),
1712 expr: Box::new(f.fold_expr(*node.expr)),
1713 }
1714 }
1715 #[cfg(feature = "full")]
1716 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_unsafenull1717 pub fn fold_expr_unsafe<F>(f: &mut F, node: ExprUnsafe) -> ExprUnsafe
1718 where
1719 F: Fold + ?Sized,
1720 {
1721 ExprUnsafe {
1722 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1723 unsafe_token: node.unsafe_token,
1724 block: f.fold_block(node.block),
1725 }
1726 }
1727 #[cfg(feature = "full")]
1728 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_whilenull1729 pub fn fold_expr_while<F>(f: &mut F, node: ExprWhile) -> ExprWhile
1730 where
1731 F: Fold + ?Sized,
1732 {
1733 ExprWhile {
1734 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1735 label: (node.label).map(|it| f.fold_label(it)),
1736 while_token: node.while_token,
1737 cond: Box::new(f.fold_expr(*node.cond)),
1738 body: f.fold_block(node.body),
1739 }
1740 }
1741 #[cfg(feature = "full")]
1742 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_expr_yieldnull1743 pub fn fold_expr_yield<F>(f: &mut F, node: ExprYield) -> ExprYield
1744 where
1745 F: Fold + ?Sized,
1746 {
1747 ExprYield {
1748 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1749 yield_token: node.yield_token,
1750 expr: (node.expr).map(|it| Box::new(f.fold_expr(*it))),
1751 }
1752 }
1753 #[cfg(any(feature = "derive", feature = "full"))]
1754 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fieldnull1755 pub fn fold_field<F>(f: &mut F, node: Field) -> Field
1756 where
1757 F: Fold + ?Sized,
1758 {
1759 Field {
1760 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1761 vis: f.fold_visibility(node.vis),
1762 mutability: f.fold_field_mutability(node.mutability),
1763 ident: (node.ident).map(|it| f.fold_ident(it)),
1764 colon_token: node.colon_token,
1765 ty: f.fold_type(node.ty),
1766 }
1767 }
1768 #[cfg(any(feature = "derive", feature = "full"))]
1769 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_field_mutabilitynull1770 pub fn fold_field_mutability<F>(f: &mut F, node: FieldMutability) -> FieldMutability
1771 where
1772 F: Fold + ?Sized,
1773 {
1774 match node {
1775 FieldMutability::None => FieldMutability::None,
1776 }
1777 }
1778 #[cfg(feature = "full")]
1779 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_field_patnull1780 pub fn fold_field_pat<F>(f: &mut F, node: FieldPat) -> FieldPat
1781 where
1782 F: Fold + ?Sized,
1783 {
1784 FieldPat {
1785 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1786 member: f.fold_member(node.member),
1787 colon_token: node.colon_token,
1788 pat: Box::new(f.fold_pat(*node.pat)),
1789 }
1790 }
1791 #[cfg(any(feature = "derive", feature = "full"))]
1792 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_field_valuenull1793 pub fn fold_field_value<F>(f: &mut F, node: FieldValue) -> FieldValue
1794 where
1795 F: Fold + ?Sized,
1796 {
1797 FieldValue {
1798 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1799 member: f.fold_member(node.member),
1800 colon_token: node.colon_token,
1801 expr: f.fold_expr(node.expr),
1802 }
1803 }
1804 #[cfg(any(feature = "derive", feature = "full"))]
1805 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fieldsnull1806 pub fn fold_fields<F>(f: &mut F, node: Fields) -> Fields
1807 where
1808 F: Fold + ?Sized,
1809 {
1810 match node {
1811 Fields::Named(_binding_0) => Fields::Named(f.fold_fields_named(_binding_0)),
1812 Fields::Unnamed(_binding_0) => Fields::Unnamed(f.fold_fields_unnamed(_binding_0)),
1813 Fields::Unit => Fields::Unit,
1814 }
1815 }
1816 #[cfg(any(feature = "derive", feature = "full"))]
1817 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fields_namednull1818 pub fn fold_fields_named<F>(f: &mut F, node: FieldsNamed) -> FieldsNamed
1819 where
1820 F: Fold + ?Sized,
1821 {
1822 FieldsNamed {
1823 brace_token: node.brace_token,
1824 named: FoldHelper::lift(node.named, |it| f.fold_field(it)),
1825 }
1826 }
1827 #[cfg(any(feature = "derive", feature = "full"))]
1828 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_fields_unnamednull1829 pub fn fold_fields_unnamed<F>(f: &mut F, node: FieldsUnnamed) -> FieldsUnnamed
1830 where
1831 F: Fold + ?Sized,
1832 {
1833 FieldsUnnamed {
1834 paren_token: node.paren_token,
1835 unnamed: FoldHelper::lift(node.unnamed, |it| f.fold_field(it)),
1836 }
1837 }
1838 #[cfg(feature = "full")]
1839 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_filenull1840 pub fn fold_file<F>(f: &mut F, node: File) -> File
1841 where
1842 F: Fold + ?Sized,
1843 {
1844 File {
1845 shebang: node.shebang,
1846 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1847 items: FoldHelper::lift(node.items, |it| f.fold_item(it)),
1848 }
1849 }
1850 #[cfg(feature = "full")]
1851 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_fn_argnull1852 pub fn fold_fn_arg<F>(f: &mut F, node: FnArg) -> FnArg
1853 where
1854 F: Fold + ?Sized,
1855 {
1856 match node {
1857 FnArg::Receiver(_binding_0) => FnArg::Receiver(f.fold_receiver(_binding_0)),
1858 FnArg::Typed(_binding_0) => FnArg::Typed(f.fold_pat_type(_binding_0)),
1859 }
1860 }
1861 #[cfg(feature = "full")]
1862 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_itemnull1863 pub fn fold_foreign_item<F>(f: &mut F, node: ForeignItem) -> ForeignItem
1864 where
1865 F: Fold + ?Sized,
1866 {
1867 match node {
1868 ForeignItem::Fn(_binding_0) => {
1869 ForeignItem::Fn(f.fold_foreign_item_fn(_binding_0))
1870 }
1871 ForeignItem::Static(_binding_0) => {
1872 ForeignItem::Static(f.fold_foreign_item_static(_binding_0))
1873 }
1874 ForeignItem::Type(_binding_0) => {
1875 ForeignItem::Type(f.fold_foreign_item_type(_binding_0))
1876 }
1877 ForeignItem::Macro(_binding_0) => {
1878 ForeignItem::Macro(f.fold_foreign_item_macro(_binding_0))
1879 }
1880 ForeignItem::Verbatim(_binding_0) => ForeignItem::Verbatim(_binding_0),
1881 }
1882 }
1883 #[cfg(feature = "full")]
1884 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_fnnull1885 pub fn fold_foreign_item_fn<F>(f: &mut F, node: ForeignItemFn) -> ForeignItemFn
1886 where
1887 F: Fold + ?Sized,
1888 {
1889 ForeignItemFn {
1890 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1891 vis: f.fold_visibility(node.vis),
1892 sig: f.fold_signature(node.sig),
1893 semi_token: node.semi_token,
1894 }
1895 }
1896 #[cfg(feature = "full")]
1897 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_macronull1898 pub fn fold_foreign_item_macro<F>(f: &mut F, node: ForeignItemMacro) -> ForeignItemMacro
1899 where
1900 F: Fold + ?Sized,
1901 {
1902 ForeignItemMacro {
1903 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1904 mac: f.fold_macro(node.mac),
1905 semi_token: node.semi_token,
1906 }
1907 }
1908 #[cfg(feature = "full")]
1909 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_staticnull1910 pub fn fold_foreign_item_static<F>(
1911 f: &mut F,
1912 node: ForeignItemStatic,
1913 ) -> ForeignItemStatic
1914 where
1915 F: Fold + ?Sized,
1916 {
1917 ForeignItemStatic {
1918 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1919 vis: f.fold_visibility(node.vis),
1920 static_token: node.static_token,
1921 mutability: f.fold_static_mutability(node.mutability),
1922 ident: f.fold_ident(node.ident),
1923 colon_token: node.colon_token,
1924 ty: Box::new(f.fold_type(*node.ty)),
1925 semi_token: node.semi_token,
1926 }
1927 }
1928 #[cfg(feature = "full")]
1929 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_foreign_item_typenull1930 pub fn fold_foreign_item_type<F>(f: &mut F, node: ForeignItemType) -> ForeignItemType
1931 where
1932 F: Fold + ?Sized,
1933 {
1934 ForeignItemType {
1935 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
1936 vis: f.fold_visibility(node.vis),
1937 type_token: node.type_token,
1938 ident: f.fold_ident(node.ident),
1939 generics: f.fold_generics(node.generics),
1940 semi_token: node.semi_token,
1941 }
1942 }
1943 #[cfg(any(feature = "derive", feature = "full"))]
1944 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_generic_argumentnull1945 pub fn fold_generic_argument<F>(f: &mut F, node: GenericArgument) -> GenericArgument
1946 where
1947 F: Fold + ?Sized,
1948 {
1949 match node {
1950 GenericArgument::Lifetime(_binding_0) => {
1951 GenericArgument::Lifetime(f.fold_lifetime(_binding_0))
1952 }
1953 GenericArgument::Type(_binding_0) => {
1954 GenericArgument::Type(f.fold_type(_binding_0))
1955 }
1956 GenericArgument::Const(_binding_0) => {
1957 GenericArgument::Const(f.fold_expr(_binding_0))
1958 }
1959 GenericArgument::AssocType(_binding_0) => {
1960 GenericArgument::AssocType(f.fold_assoc_type(_binding_0))
1961 }
1962 GenericArgument::AssocConst(_binding_0) => {
1963 GenericArgument::AssocConst(f.fold_assoc_const(_binding_0))
1964 }
1965 GenericArgument::Constraint(_binding_0) => {
1966 GenericArgument::Constraint(f.fold_constraint(_binding_0))
1967 }
1968 }
1969 }
1970 #[cfg(any(feature = "derive", feature = "full"))]
1971 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_generic_paramnull1972 pub fn fold_generic_param<F>(f: &mut F, node: GenericParam) -> GenericParam
1973 where
1974 F: Fold + ?Sized,
1975 {
1976 match node {
1977 GenericParam::Lifetime(_binding_0) => {
1978 GenericParam::Lifetime(f.fold_lifetime_param(_binding_0))
1979 }
1980 GenericParam::Type(_binding_0) => {
1981 GenericParam::Type(f.fold_type_param(_binding_0))
1982 }
1983 GenericParam::Const(_binding_0) => {
1984 GenericParam::Const(f.fold_const_param(_binding_0))
1985 }
1986 }
1987 }
1988 #[cfg(any(feature = "derive", feature = "full"))]
1989 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_genericsnull1990 pub fn fold_generics<F>(f: &mut F, node: Generics) -> Generics
1991 where
1992 F: Fold + ?Sized,
1993 {
1994 Generics {
1995 lt_token: node.lt_token,
1996 params: FoldHelper::lift(node.params, |it| f.fold_generic_param(it)),
1997 gt_token: node.gt_token,
1998 where_clause: (node.where_clause).map(|it| f.fold_where_clause(it)),
1999 }
2000 }
fold_identnull2001 pub fn fold_ident<F>(f: &mut F, node: Ident) -> Ident
2002 where
2003 F: Fold + ?Sized,
2004 {
2005 let mut node = node;
2006 let span = f.fold_span(node.span());
2007 node.set_span(span);
2008 node
2009 }
2010 #[cfg(feature = "full")]
2011 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_itemnull2012 pub fn fold_impl_item<F>(f: &mut F, node: ImplItem) -> ImplItem
2013 where
2014 F: Fold + ?Sized,
2015 {
2016 match node {
2017 ImplItem::Const(_binding_0) => {
2018 ImplItem::Const(f.fold_impl_item_const(_binding_0))
2019 }
2020 ImplItem::Fn(_binding_0) => ImplItem::Fn(f.fold_impl_item_fn(_binding_0)),
2021 ImplItem::Type(_binding_0) => ImplItem::Type(f.fold_impl_item_type(_binding_0)),
2022 ImplItem::Macro(_binding_0) => {
2023 ImplItem::Macro(f.fold_impl_item_macro(_binding_0))
2024 }
2025 ImplItem::Verbatim(_binding_0) => ImplItem::Verbatim(_binding_0),
2026 }
2027 }
2028 #[cfg(feature = "full")]
2029 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_constnull2030 pub fn fold_impl_item_const<F>(f: &mut F, node: ImplItemConst) -> ImplItemConst
2031 where
2032 F: Fold + ?Sized,
2033 {
2034 ImplItemConst {
2035 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2036 vis: f.fold_visibility(node.vis),
2037 defaultness: node.defaultness,
2038 const_token: node.const_token,
2039 ident: f.fold_ident(node.ident),
2040 generics: f.fold_generics(node.generics),
2041 colon_token: node.colon_token,
2042 ty: f.fold_type(node.ty),
2043 eq_token: node.eq_token,
2044 expr: f.fold_expr(node.expr),
2045 semi_token: node.semi_token,
2046 }
2047 }
2048 #[cfg(feature = "full")]
2049 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_fnnull2050 pub fn fold_impl_item_fn<F>(f: &mut F, node: ImplItemFn) -> ImplItemFn
2051 where
2052 F: Fold + ?Sized,
2053 {
2054 ImplItemFn {
2055 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2056 vis: f.fold_visibility(node.vis),
2057 defaultness: node.defaultness,
2058 sig: f.fold_signature(node.sig),
2059 block: f.fold_block(node.block),
2060 }
2061 }
2062 #[cfg(feature = "full")]
2063 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_macronull2064 pub fn fold_impl_item_macro<F>(f: &mut F, node: ImplItemMacro) -> ImplItemMacro
2065 where
2066 F: Fold + ?Sized,
2067 {
2068 ImplItemMacro {
2069 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2070 mac: f.fold_macro(node.mac),
2071 semi_token: node.semi_token,
2072 }
2073 }
2074 #[cfg(feature = "full")]
2075 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_item_typenull2076 pub fn fold_impl_item_type<F>(f: &mut F, node: ImplItemType) -> ImplItemType
2077 where
2078 F: Fold + ?Sized,
2079 {
2080 ImplItemType {
2081 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2082 vis: f.fold_visibility(node.vis),
2083 defaultness: node.defaultness,
2084 type_token: node.type_token,
2085 ident: f.fold_ident(node.ident),
2086 generics: f.fold_generics(node.generics),
2087 eq_token: node.eq_token,
2088 ty: f.fold_type(node.ty),
2089 semi_token: node.semi_token,
2090 }
2091 }
2092 #[cfg(feature = "full")]
2093 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_impl_restrictionnull2094 pub fn fold_impl_restriction<F>(f: &mut F, node: ImplRestriction) -> ImplRestriction
2095 where
2096 F: Fold + ?Sized,
2097 {
2098 match node {}
2099 }
2100 #[cfg(any(feature = "derive", feature = "full"))]
2101 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_indexnull2102 pub fn fold_index<F>(f: &mut F, node: Index) -> Index
2103 where
2104 F: Fold + ?Sized,
2105 {
2106 Index {
2107 index: node.index,
2108 span: f.fold_span(node.span),
2109 }
2110 }
2111 #[cfg(feature = "full")]
2112 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_itemnull2113 pub fn fold_item<F>(f: &mut F, node: Item) -> Item
2114 where
2115 F: Fold + ?Sized,
2116 {
2117 match node {
2118 Item::Const(_binding_0) => Item::Const(f.fold_item_const(_binding_0)),
2119 Item::Enum(_binding_0) => Item::Enum(f.fold_item_enum(_binding_0)),
2120 Item::ExternCrate(_binding_0) => {
2121 Item::ExternCrate(f.fold_item_extern_crate(_binding_0))
2122 }
2123 Item::Fn(_binding_0) => Item::Fn(f.fold_item_fn(_binding_0)),
2124 Item::ForeignMod(_binding_0) => {
2125 Item::ForeignMod(f.fold_item_foreign_mod(_binding_0))
2126 }
2127 Item::Impl(_binding_0) => Item::Impl(f.fold_item_impl(_binding_0)),
2128 Item::Macro(_binding_0) => Item::Macro(f.fold_item_macro(_binding_0)),
2129 Item::Mod(_binding_0) => Item::Mod(f.fold_item_mod(_binding_0)),
2130 Item::Static(_binding_0) => Item::Static(f.fold_item_static(_binding_0)),
2131 Item::Struct(_binding_0) => Item::Struct(f.fold_item_struct(_binding_0)),
2132 Item::Trait(_binding_0) => Item::Trait(f.fold_item_trait(_binding_0)),
2133 Item::TraitAlias(_binding_0) => {
2134 Item::TraitAlias(f.fold_item_trait_alias(_binding_0))
2135 }
2136 Item::Type(_binding_0) => Item::Type(f.fold_item_type(_binding_0)),
2137 Item::Union(_binding_0) => Item::Union(f.fold_item_union(_binding_0)),
2138 Item::Use(_binding_0) => Item::Use(f.fold_item_use(_binding_0)),
2139 Item::Verbatim(_binding_0) => Item::Verbatim(_binding_0),
2140 }
2141 }
2142 #[cfg(feature = "full")]
2143 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_constnull2144 pub fn fold_item_const<F>(f: &mut F, node: ItemConst) -> ItemConst
2145 where
2146 F: Fold + ?Sized,
2147 {
2148 ItemConst {
2149 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2150 vis: f.fold_visibility(node.vis),
2151 const_token: node.const_token,
2152 ident: f.fold_ident(node.ident),
2153 generics: f.fold_generics(node.generics),
2154 colon_token: node.colon_token,
2155 ty: Box::new(f.fold_type(*node.ty)),
2156 eq_token: node.eq_token,
2157 expr: Box::new(f.fold_expr(*node.expr)),
2158 semi_token: node.semi_token,
2159 }
2160 }
2161 #[cfg(feature = "full")]
2162 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_enumnull2163 pub fn fold_item_enum<F>(f: &mut F, node: ItemEnum) -> ItemEnum
2164 where
2165 F: Fold + ?Sized,
2166 {
2167 ItemEnum {
2168 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2169 vis: f.fold_visibility(node.vis),
2170 enum_token: node.enum_token,
2171 ident: f.fold_ident(node.ident),
2172 generics: f.fold_generics(node.generics),
2173 brace_token: node.brace_token,
2174 variants: FoldHelper::lift(node.variants, |it| f.fold_variant(it)),
2175 }
2176 }
2177 #[cfg(feature = "full")]
2178 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_extern_cratenull2179 pub fn fold_item_extern_crate<F>(f: &mut F, node: ItemExternCrate) -> ItemExternCrate
2180 where
2181 F: Fold + ?Sized,
2182 {
2183 ItemExternCrate {
2184 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2185 vis: f.fold_visibility(node.vis),
2186 extern_token: node.extern_token,
2187 crate_token: node.crate_token,
2188 ident: f.fold_ident(node.ident),
2189 rename: (node.rename).map(|it| ((it).0, f.fold_ident((it).1))),
2190 semi_token: node.semi_token,
2191 }
2192 }
2193 #[cfg(feature = "full")]
2194 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_fnnull2195 pub fn fold_item_fn<F>(f: &mut F, node: ItemFn) -> ItemFn
2196 where
2197 F: Fold + ?Sized,
2198 {
2199 ItemFn {
2200 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2201 vis: f.fold_visibility(node.vis),
2202 sig: f.fold_signature(node.sig),
2203 block: Box::new(f.fold_block(*node.block)),
2204 }
2205 }
2206 #[cfg(feature = "full")]
2207 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_foreign_modnull2208 pub fn fold_item_foreign_mod<F>(f: &mut F, node: ItemForeignMod) -> ItemForeignMod
2209 where
2210 F: Fold + ?Sized,
2211 {
2212 ItemForeignMod {
2213 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2214 unsafety: node.unsafety,
2215 abi: f.fold_abi(node.abi),
2216 brace_token: node.brace_token,
2217 items: FoldHelper::lift(node.items, |it| f.fold_foreign_item(it)),
2218 }
2219 }
2220 #[cfg(feature = "full")]
2221 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_implnull2222 pub fn fold_item_impl<F>(f: &mut F, node: ItemImpl) -> ItemImpl
2223 where
2224 F: Fold + ?Sized,
2225 {
2226 ItemImpl {
2227 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2228 defaultness: node.defaultness,
2229 unsafety: node.unsafety,
2230 impl_token: node.impl_token,
2231 generics: f.fold_generics(node.generics),
2232 trait_: (node.trait_).map(|it| ((it).0, f.fold_path((it).1), (it).2)),
2233 self_ty: Box::new(f.fold_type(*node.self_ty)),
2234 brace_token: node.brace_token,
2235 items: FoldHelper::lift(node.items, |it| f.fold_impl_item(it)),
2236 }
2237 }
2238 #[cfg(feature = "full")]
2239 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_macronull2240 pub fn fold_item_macro<F>(f: &mut F, node: ItemMacro) -> ItemMacro
2241 where
2242 F: Fold + ?Sized,
2243 {
2244 ItemMacro {
2245 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2246 ident: (node.ident).map(|it| f.fold_ident(it)),
2247 mac: f.fold_macro(node.mac),
2248 semi_token: node.semi_token,
2249 }
2250 }
2251 #[cfg(feature = "full")]
2252 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_modnull2253 pub fn fold_item_mod<F>(f: &mut F, node: ItemMod) -> ItemMod
2254 where
2255 F: Fold + ?Sized,
2256 {
2257 ItemMod {
2258 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2259 vis: f.fold_visibility(node.vis),
2260 unsafety: node.unsafety,
2261 mod_token: node.mod_token,
2262 ident: f.fold_ident(node.ident),
2263 content: (node.content)
2264 .map(|it| ((it).0, FoldHelper::lift((it).1, |it| f.fold_item(it)))),
2265 semi: node.semi,
2266 }
2267 }
2268 #[cfg(feature = "full")]
2269 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_staticnull2270 pub fn fold_item_static<F>(f: &mut F, node: ItemStatic) -> ItemStatic
2271 where
2272 F: Fold + ?Sized,
2273 {
2274 ItemStatic {
2275 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2276 vis: f.fold_visibility(node.vis),
2277 static_token: node.static_token,
2278 mutability: f.fold_static_mutability(node.mutability),
2279 ident: f.fold_ident(node.ident),
2280 colon_token: node.colon_token,
2281 ty: Box::new(f.fold_type(*node.ty)),
2282 eq_token: node.eq_token,
2283 expr: Box::new(f.fold_expr(*node.expr)),
2284 semi_token: node.semi_token,
2285 }
2286 }
2287 #[cfg(feature = "full")]
2288 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_structnull2289 pub fn fold_item_struct<F>(f: &mut F, node: ItemStruct) -> ItemStruct
2290 where
2291 F: Fold + ?Sized,
2292 {
2293 ItemStruct {
2294 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2295 vis: f.fold_visibility(node.vis),
2296 struct_token: node.struct_token,
2297 ident: f.fold_ident(node.ident),
2298 generics: f.fold_generics(node.generics),
2299 fields: f.fold_fields(node.fields),
2300 semi_token: node.semi_token,
2301 }
2302 }
2303 #[cfg(feature = "full")]
2304 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_traitnull2305 pub fn fold_item_trait<F>(f: &mut F, node: ItemTrait) -> ItemTrait
2306 where
2307 F: Fold + ?Sized,
2308 {
2309 ItemTrait {
2310 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2311 vis: f.fold_visibility(node.vis),
2312 unsafety: node.unsafety,
2313 auto_token: node.auto_token,
2314 restriction: (node.restriction).map(|it| f.fold_impl_restriction(it)),
2315 trait_token: node.trait_token,
2316 ident: f.fold_ident(node.ident),
2317 generics: f.fold_generics(node.generics),
2318 colon_token: node.colon_token,
2319 supertraits: FoldHelper::lift(
2320 node.supertraits,
2321 |it| f.fold_type_param_bound(it),
2322 ),
2323 brace_token: node.brace_token,
2324 items: FoldHelper::lift(node.items, |it| f.fold_trait_item(it)),
2325 }
2326 }
2327 #[cfg(feature = "full")]
2328 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_trait_aliasnull2329 pub fn fold_item_trait_alias<F>(f: &mut F, node: ItemTraitAlias) -> ItemTraitAlias
2330 where
2331 F: Fold + ?Sized,
2332 {
2333 ItemTraitAlias {
2334 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2335 vis: f.fold_visibility(node.vis),
2336 trait_token: node.trait_token,
2337 ident: f.fold_ident(node.ident),
2338 generics: f.fold_generics(node.generics),
2339 eq_token: node.eq_token,
2340 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
2341 semi_token: node.semi_token,
2342 }
2343 }
2344 #[cfg(feature = "full")]
2345 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_typenull2346 pub fn fold_item_type<F>(f: &mut F, node: ItemType) -> ItemType
2347 where
2348 F: Fold + ?Sized,
2349 {
2350 ItemType {
2351 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2352 vis: f.fold_visibility(node.vis),
2353 type_token: node.type_token,
2354 ident: f.fold_ident(node.ident),
2355 generics: f.fold_generics(node.generics),
2356 eq_token: node.eq_token,
2357 ty: Box::new(f.fold_type(*node.ty)),
2358 semi_token: node.semi_token,
2359 }
2360 }
2361 #[cfg(feature = "full")]
2362 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_unionnull2363 pub fn fold_item_union<F>(f: &mut F, node: ItemUnion) -> ItemUnion
2364 where
2365 F: Fold + ?Sized,
2366 {
2367 ItemUnion {
2368 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2369 vis: f.fold_visibility(node.vis),
2370 union_token: node.union_token,
2371 ident: f.fold_ident(node.ident),
2372 generics: f.fold_generics(node.generics),
2373 fields: f.fold_fields_named(node.fields),
2374 }
2375 }
2376 #[cfg(feature = "full")]
2377 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_item_usenull2378 pub fn fold_item_use<F>(f: &mut F, node: ItemUse) -> ItemUse
2379 where
2380 F: Fold + ?Sized,
2381 {
2382 ItemUse {
2383 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2384 vis: f.fold_visibility(node.vis),
2385 use_token: node.use_token,
2386 leading_colon: node.leading_colon,
2387 tree: f.fold_use_tree(node.tree),
2388 semi_token: node.semi_token,
2389 }
2390 }
2391 #[cfg(feature = "full")]
2392 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_labelnull2393 pub fn fold_label<F>(f: &mut F, node: Label) -> Label
2394 where
2395 F: Fold + ?Sized,
2396 {
2397 Label {
2398 name: f.fold_lifetime(node.name),
2399 colon_token: node.colon_token,
2400 }
2401 }
fold_lifetimenull2402 pub fn fold_lifetime<F>(f: &mut F, node: Lifetime) -> Lifetime
2403 where
2404 F: Fold + ?Sized,
2405 {
2406 Lifetime {
2407 apostrophe: f.fold_span(node.apostrophe),
2408 ident: f.fold_ident(node.ident),
2409 }
2410 }
2411 #[cfg(any(feature = "derive", feature = "full"))]
2412 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_lifetime_paramnull2413 pub fn fold_lifetime_param<F>(f: &mut F, node: LifetimeParam) -> LifetimeParam
2414 where
2415 F: Fold + ?Sized,
2416 {
2417 LifetimeParam {
2418 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2419 lifetime: f.fold_lifetime(node.lifetime),
2420 colon_token: node.colon_token,
2421 bounds: FoldHelper::lift(node.bounds, |it| f.fold_lifetime(it)),
2422 }
2423 }
fold_litnull2424 pub fn fold_lit<F>(f: &mut F, node: Lit) -> Lit
2425 where
2426 F: Fold + ?Sized,
2427 {
2428 match node {
2429 Lit::Str(_binding_0) => Lit::Str(f.fold_lit_str(_binding_0)),
2430 Lit::ByteStr(_binding_0) => Lit::ByteStr(f.fold_lit_byte_str(_binding_0)),
2431 Lit::Byte(_binding_0) => Lit::Byte(f.fold_lit_byte(_binding_0)),
2432 Lit::Char(_binding_0) => Lit::Char(f.fold_lit_char(_binding_0)),
2433 Lit::Int(_binding_0) => Lit::Int(f.fold_lit_int(_binding_0)),
2434 Lit::Float(_binding_0) => Lit::Float(f.fold_lit_float(_binding_0)),
2435 Lit::Bool(_binding_0) => Lit::Bool(f.fold_lit_bool(_binding_0)),
2436 Lit::Verbatim(_binding_0) => Lit::Verbatim(_binding_0),
2437 }
2438 }
fold_lit_boolnull2439 pub fn fold_lit_bool<F>(f: &mut F, node: LitBool) -> LitBool
2440 where
2441 F: Fold + ?Sized,
2442 {
2443 LitBool {
2444 value: node.value,
2445 span: f.fold_span(node.span),
2446 }
2447 }
fold_lit_bytenull2448 pub fn fold_lit_byte<F>(f: &mut F, node: LitByte) -> LitByte
2449 where
2450 F: Fold + ?Sized,
2451 {
2452 let span = f.fold_span(node.span());
2453 let mut node = node;
2454 node.set_span(span);
2455 node
2456 }
fold_lit_byte_strnull2457 pub fn fold_lit_byte_str<F>(f: &mut F, node: LitByteStr) -> LitByteStr
2458 where
2459 F: Fold + ?Sized,
2460 {
2461 let span = f.fold_span(node.span());
2462 let mut node = node;
2463 node.set_span(span);
2464 node
2465 }
fold_lit_charnull2466 pub fn fold_lit_char<F>(f: &mut F, node: LitChar) -> LitChar
2467 where
2468 F: Fold + ?Sized,
2469 {
2470 let span = f.fold_span(node.span());
2471 let mut node = node;
2472 node.set_span(span);
2473 node
2474 }
fold_lit_floatnull2475 pub fn fold_lit_float<F>(f: &mut F, node: LitFloat) -> LitFloat
2476 where
2477 F: Fold + ?Sized,
2478 {
2479 let span = f.fold_span(node.span());
2480 let mut node = node;
2481 node.set_span(span);
2482 node
2483 }
fold_lit_intnull2484 pub fn fold_lit_int<F>(f: &mut F, node: LitInt) -> LitInt
2485 where
2486 F: Fold + ?Sized,
2487 {
2488 let span = f.fold_span(node.span());
2489 let mut node = node;
2490 node.set_span(span);
2491 node
2492 }
fold_lit_strnull2493 pub fn fold_lit_str<F>(f: &mut F, node: LitStr) -> LitStr
2494 where
2495 F: Fold + ?Sized,
2496 {
2497 let span = f.fold_span(node.span());
2498 let mut node = node;
2499 node.set_span(span);
2500 node
2501 }
2502 #[cfg(feature = "full")]
2503 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_localnull2504 pub fn fold_local<F>(f: &mut F, node: Local) -> Local
2505 where
2506 F: Fold + ?Sized,
2507 {
2508 Local {
2509 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2510 let_token: node.let_token,
2511 pat: f.fold_pat(node.pat),
2512 init: (node.init).map(|it| f.fold_local_init(it)),
2513 semi_token: node.semi_token,
2514 }
2515 }
2516 #[cfg(feature = "full")]
2517 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_local_initnull2518 pub fn fold_local_init<F>(f: &mut F, node: LocalInit) -> LocalInit
2519 where
2520 F: Fold + ?Sized,
2521 {
2522 LocalInit {
2523 eq_token: node.eq_token,
2524 expr: Box::new(f.fold_expr(*node.expr)),
2525 diverge: (node.diverge).map(|it| ((it).0, Box::new(f.fold_expr(*(it).1)))),
2526 }
2527 }
2528 #[cfg(any(feature = "derive", feature = "full"))]
2529 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_macronull2530 pub fn fold_macro<F>(f: &mut F, node: Macro) -> Macro
2531 where
2532 F: Fold + ?Sized,
2533 {
2534 Macro {
2535 path: f.fold_path(node.path),
2536 bang_token: node.bang_token,
2537 delimiter: f.fold_macro_delimiter(node.delimiter),
2538 tokens: node.tokens,
2539 }
2540 }
2541 #[cfg(any(feature = "derive", feature = "full"))]
2542 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_macro_delimiternull2543 pub fn fold_macro_delimiter<F>(f: &mut F, node: MacroDelimiter) -> MacroDelimiter
2544 where
2545 F: Fold + ?Sized,
2546 {
2547 match node {
2548 MacroDelimiter::Paren(_binding_0) => MacroDelimiter::Paren(_binding_0),
2549 MacroDelimiter::Brace(_binding_0) => MacroDelimiter::Brace(_binding_0),
2550 MacroDelimiter::Bracket(_binding_0) => MacroDelimiter::Bracket(_binding_0),
2551 }
2552 }
2553 #[cfg(any(feature = "derive", feature = "full"))]
2554 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_membernull2555 pub fn fold_member<F>(f: &mut F, node: Member) -> Member
2556 where
2557 F: Fold + ?Sized,
2558 {
2559 match node {
2560 Member::Named(_binding_0) => Member::Named(f.fold_ident(_binding_0)),
2561 Member::Unnamed(_binding_0) => Member::Unnamed(f.fold_index(_binding_0)),
2562 }
2563 }
2564 #[cfg(any(feature = "derive", feature = "full"))]
2565 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_metanull2566 pub fn fold_meta<F>(f: &mut F, node: Meta) -> Meta
2567 where
2568 F: Fold + ?Sized,
2569 {
2570 match node {
2571 Meta::Path(_binding_0) => Meta::Path(f.fold_path(_binding_0)),
2572 Meta::List(_binding_0) => Meta::List(f.fold_meta_list(_binding_0)),
2573 Meta::NameValue(_binding_0) => {
2574 Meta::NameValue(f.fold_meta_name_value(_binding_0))
2575 }
2576 }
2577 }
2578 #[cfg(any(feature = "derive", feature = "full"))]
2579 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_meta_listnull2580 pub fn fold_meta_list<F>(f: &mut F, node: MetaList) -> MetaList
2581 where
2582 F: Fold + ?Sized,
2583 {
2584 MetaList {
2585 path: f.fold_path(node.path),
2586 delimiter: f.fold_macro_delimiter(node.delimiter),
2587 tokens: node.tokens,
2588 }
2589 }
2590 #[cfg(any(feature = "derive", feature = "full"))]
2591 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_meta_name_valuenull2592 pub fn fold_meta_name_value<F>(f: &mut F, node: MetaNameValue) -> MetaNameValue
2593 where
2594 F: Fold + ?Sized,
2595 {
2596 MetaNameValue {
2597 path: f.fold_path(node.path),
2598 eq_token: node.eq_token,
2599 value: f.fold_expr(node.value),
2600 }
2601 }
2602 #[cfg(any(feature = "derive", feature = "full"))]
2603 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_parenthesized_generic_argumentsnull2604 pub fn fold_parenthesized_generic_arguments<F>(
2605 f: &mut F,
2606 node: ParenthesizedGenericArguments,
2607 ) -> ParenthesizedGenericArguments
2608 where
2609 F: Fold + ?Sized,
2610 {
2611 ParenthesizedGenericArguments {
2612 paren_token: node.paren_token,
2613 inputs: FoldHelper::lift(node.inputs, |it| f.fold_type(it)),
2614 output: f.fold_return_type(node.output),
2615 }
2616 }
2617 #[cfg(feature = "full")]
2618 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_patnull2619 pub fn fold_pat<F>(f: &mut F, node: Pat) -> Pat
2620 where
2621 F: Fold + ?Sized,
2622 {
2623 match node {
2624 Pat::Const(_binding_0) => Pat::Const(f.fold_expr_const(_binding_0)),
2625 Pat::Ident(_binding_0) => Pat::Ident(f.fold_pat_ident(_binding_0)),
2626 Pat::Lit(_binding_0) => Pat::Lit(f.fold_expr_lit(_binding_0)),
2627 Pat::Macro(_binding_0) => Pat::Macro(f.fold_expr_macro(_binding_0)),
2628 Pat::Or(_binding_0) => Pat::Or(f.fold_pat_or(_binding_0)),
2629 Pat::Paren(_binding_0) => Pat::Paren(f.fold_pat_paren(_binding_0)),
2630 Pat::Path(_binding_0) => Pat::Path(f.fold_expr_path(_binding_0)),
2631 Pat::Range(_binding_0) => Pat::Range(f.fold_expr_range(_binding_0)),
2632 Pat::Reference(_binding_0) => Pat::Reference(f.fold_pat_reference(_binding_0)),
2633 Pat::Rest(_binding_0) => Pat::Rest(f.fold_pat_rest(_binding_0)),
2634 Pat::Slice(_binding_0) => Pat::Slice(f.fold_pat_slice(_binding_0)),
2635 Pat::Struct(_binding_0) => Pat::Struct(f.fold_pat_struct(_binding_0)),
2636 Pat::Tuple(_binding_0) => Pat::Tuple(f.fold_pat_tuple(_binding_0)),
2637 Pat::TupleStruct(_binding_0) => {
2638 Pat::TupleStruct(f.fold_pat_tuple_struct(_binding_0))
2639 }
2640 Pat::Type(_binding_0) => Pat::Type(f.fold_pat_type(_binding_0)),
2641 Pat::Verbatim(_binding_0) => Pat::Verbatim(_binding_0),
2642 Pat::Wild(_binding_0) => Pat::Wild(f.fold_pat_wild(_binding_0)),
2643 }
2644 }
2645 #[cfg(feature = "full")]
2646 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_identnull2647 pub fn fold_pat_ident<F>(f: &mut F, node: PatIdent) -> PatIdent
2648 where
2649 F: Fold + ?Sized,
2650 {
2651 PatIdent {
2652 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2653 by_ref: node.by_ref,
2654 mutability: node.mutability,
2655 ident: f.fold_ident(node.ident),
2656 subpat: (node.subpat).map(|it| ((it).0, Box::new(f.fold_pat(*(it).1)))),
2657 }
2658 }
2659 #[cfg(feature = "full")]
2660 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_ornull2661 pub fn fold_pat_or<F>(f: &mut F, node: PatOr) -> PatOr
2662 where
2663 F: Fold + ?Sized,
2664 {
2665 PatOr {
2666 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2667 leading_vert: node.leading_vert,
2668 cases: FoldHelper::lift(node.cases, |it| f.fold_pat(it)),
2669 }
2670 }
2671 #[cfg(feature = "full")]
2672 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_parennull2673 pub fn fold_pat_paren<F>(f: &mut F, node: PatParen) -> PatParen
2674 where
2675 F: Fold + ?Sized,
2676 {
2677 PatParen {
2678 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2679 paren_token: node.paren_token,
2680 pat: Box::new(f.fold_pat(*node.pat)),
2681 }
2682 }
2683 #[cfg(feature = "full")]
2684 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_referencenull2685 pub fn fold_pat_reference<F>(f: &mut F, node: PatReference) -> PatReference
2686 where
2687 F: Fold + ?Sized,
2688 {
2689 PatReference {
2690 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2691 and_token: node.and_token,
2692 mutability: node.mutability,
2693 pat: Box::new(f.fold_pat(*node.pat)),
2694 }
2695 }
2696 #[cfg(feature = "full")]
2697 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_restnull2698 pub fn fold_pat_rest<F>(f: &mut F, node: PatRest) -> PatRest
2699 where
2700 F: Fold + ?Sized,
2701 {
2702 PatRest {
2703 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2704 dot2_token: node.dot2_token,
2705 }
2706 }
2707 #[cfg(feature = "full")]
2708 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_slicenull2709 pub fn fold_pat_slice<F>(f: &mut F, node: PatSlice) -> PatSlice
2710 where
2711 F: Fold + ?Sized,
2712 {
2713 PatSlice {
2714 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2715 bracket_token: node.bracket_token,
2716 elems: FoldHelper::lift(node.elems, |it| f.fold_pat(it)),
2717 }
2718 }
2719 #[cfg(feature = "full")]
2720 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_structnull2721 pub fn fold_pat_struct<F>(f: &mut F, node: PatStruct) -> PatStruct
2722 where
2723 F: Fold + ?Sized,
2724 {
2725 PatStruct {
2726 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2727 qself: (node.qself).map(|it| f.fold_qself(it)),
2728 path: f.fold_path(node.path),
2729 brace_token: node.brace_token,
2730 fields: FoldHelper::lift(node.fields, |it| f.fold_field_pat(it)),
2731 rest: (node.rest).map(|it| f.fold_pat_rest(it)),
2732 }
2733 }
2734 #[cfg(feature = "full")]
2735 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_tuplenull2736 pub fn fold_pat_tuple<F>(f: &mut F, node: PatTuple) -> PatTuple
2737 where
2738 F: Fold + ?Sized,
2739 {
2740 PatTuple {
2741 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2742 paren_token: node.paren_token,
2743 elems: FoldHelper::lift(node.elems, |it| f.fold_pat(it)),
2744 }
2745 }
2746 #[cfg(feature = "full")]
2747 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_tuple_structnull2748 pub fn fold_pat_tuple_struct<F>(f: &mut F, node: PatTupleStruct) -> PatTupleStruct
2749 where
2750 F: Fold + ?Sized,
2751 {
2752 PatTupleStruct {
2753 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2754 qself: (node.qself).map(|it| f.fold_qself(it)),
2755 path: f.fold_path(node.path),
2756 paren_token: node.paren_token,
2757 elems: FoldHelper::lift(node.elems, |it| f.fold_pat(it)),
2758 }
2759 }
2760 #[cfg(feature = "full")]
2761 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_typenull2762 pub fn fold_pat_type<F>(f: &mut F, node: PatType) -> PatType
2763 where
2764 F: Fold + ?Sized,
2765 {
2766 PatType {
2767 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2768 pat: Box::new(f.fold_pat(*node.pat)),
2769 colon_token: node.colon_token,
2770 ty: Box::new(f.fold_type(*node.ty)),
2771 }
2772 }
2773 #[cfg(feature = "full")]
2774 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_pat_wildnull2775 pub fn fold_pat_wild<F>(f: &mut F, node: PatWild) -> PatWild
2776 where
2777 F: Fold + ?Sized,
2778 {
2779 PatWild {
2780 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2781 underscore_token: node.underscore_token,
2782 }
2783 }
2784 #[cfg(any(feature = "derive", feature = "full"))]
2785 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_pathnull2786 pub fn fold_path<F>(f: &mut F, node: Path) -> Path
2787 where
2788 F: Fold + ?Sized,
2789 {
2790 Path {
2791 leading_colon: node.leading_colon,
2792 segments: FoldHelper::lift(node.segments, |it| f.fold_path_segment(it)),
2793 }
2794 }
2795 #[cfg(any(feature = "derive", feature = "full"))]
2796 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_path_argumentsnull2797 pub fn fold_path_arguments<F>(f: &mut F, node: PathArguments) -> PathArguments
2798 where
2799 F: Fold + ?Sized,
2800 {
2801 match node {
2802 PathArguments::None => PathArguments::None,
2803 PathArguments::AngleBracketed(_binding_0) => {
2804 PathArguments::AngleBracketed(
2805 f.fold_angle_bracketed_generic_arguments(_binding_0),
2806 )
2807 }
2808 PathArguments::Parenthesized(_binding_0) => {
2809 PathArguments::Parenthesized(
2810 f.fold_parenthesized_generic_arguments(_binding_0),
2811 )
2812 }
2813 }
2814 }
2815 #[cfg(any(feature = "derive", feature = "full"))]
2816 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_path_segmentnull2817 pub fn fold_path_segment<F>(f: &mut F, node: PathSegment) -> PathSegment
2818 where
2819 F: Fold + ?Sized,
2820 {
2821 PathSegment {
2822 ident: f.fold_ident(node.ident),
2823 arguments: f.fold_path_arguments(node.arguments),
2824 }
2825 }
2826 #[cfg(any(feature = "derive", feature = "full"))]
2827 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_predicate_lifetimenull2828 pub fn fold_predicate_lifetime<F>(
2829 f: &mut F,
2830 node: PredicateLifetime,
2831 ) -> PredicateLifetime
2832 where
2833 F: Fold + ?Sized,
2834 {
2835 PredicateLifetime {
2836 lifetime: f.fold_lifetime(node.lifetime),
2837 colon_token: node.colon_token,
2838 bounds: FoldHelper::lift(node.bounds, |it| f.fold_lifetime(it)),
2839 }
2840 }
2841 #[cfg(any(feature = "derive", feature = "full"))]
2842 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_predicate_typenull2843 pub fn fold_predicate_type<F>(f: &mut F, node: PredicateType) -> PredicateType
2844 where
2845 F: Fold + ?Sized,
2846 {
2847 PredicateType {
2848 lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
2849 bounded_ty: f.fold_type(node.bounded_ty),
2850 colon_token: node.colon_token,
2851 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
2852 }
2853 }
2854 #[cfg(any(feature = "derive", feature = "full"))]
2855 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_qselfnull2856 pub fn fold_qself<F>(f: &mut F, node: QSelf) -> QSelf
2857 where
2858 F: Fold + ?Sized,
2859 {
2860 QSelf {
2861 lt_token: node.lt_token,
2862 ty: Box::new(f.fold_type(*node.ty)),
2863 position: node.position,
2864 as_token: node.as_token,
2865 gt_token: node.gt_token,
2866 }
2867 }
2868 #[cfg(feature = "full")]
2869 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_range_limitsnull2870 pub fn fold_range_limits<F>(f: &mut F, node: RangeLimits) -> RangeLimits
2871 where
2872 F: Fold + ?Sized,
2873 {
2874 match node {
2875 RangeLimits::HalfOpen(_binding_0) => RangeLimits::HalfOpen(_binding_0),
2876 RangeLimits::Closed(_binding_0) => RangeLimits::Closed(_binding_0),
2877 }
2878 }
2879 #[cfg(feature = "full")]
2880 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_receivernull2881 pub fn fold_receiver<F>(f: &mut F, node: Receiver) -> Receiver
2882 where
2883 F: Fold + ?Sized,
2884 {
2885 Receiver {
2886 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2887 reference: (node.reference)
2888 .map(|it| ((it).0, ((it).1).map(|it| f.fold_lifetime(it)))),
2889 mutability: node.mutability,
2890 self_token: node.self_token,
2891 colon_token: node.colon_token,
2892 ty: Box::new(f.fold_type(*node.ty)),
2893 }
2894 }
2895 #[cfg(any(feature = "derive", feature = "full"))]
2896 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_return_typenull2897 pub fn fold_return_type<F>(f: &mut F, node: ReturnType) -> ReturnType
2898 where
2899 F: Fold + ?Sized,
2900 {
2901 match node {
2902 ReturnType::Default => ReturnType::Default,
2903 ReturnType::Type(_binding_0, _binding_1) => {
2904 ReturnType::Type(_binding_0, Box::new(f.fold_type(*_binding_1)))
2905 }
2906 }
2907 }
2908 #[cfg(feature = "full")]
2909 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_signaturenull2910 pub fn fold_signature<F>(f: &mut F, node: Signature) -> Signature
2911 where
2912 F: Fold + ?Sized,
2913 {
2914 Signature {
2915 constness: node.constness,
2916 asyncness: node.asyncness,
2917 unsafety: node.unsafety,
2918 abi: (node.abi).map(|it| f.fold_abi(it)),
2919 fn_token: node.fn_token,
2920 ident: f.fold_ident(node.ident),
2921 generics: f.fold_generics(node.generics),
2922 paren_token: node.paren_token,
2923 inputs: FoldHelper::lift(node.inputs, |it| f.fold_fn_arg(it)),
2924 variadic: (node.variadic).map(|it| f.fold_variadic(it)),
2925 output: f.fold_return_type(node.output),
2926 }
2927 }
fold_spannull2928 pub fn fold_span<F>(f: &mut F, node: Span) -> Span
2929 where
2930 F: Fold + ?Sized,
2931 {
2932 node
2933 }
2934 #[cfg(feature = "full")]
2935 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_static_mutabilitynull2936 pub fn fold_static_mutability<F>(f: &mut F, node: StaticMutability) -> StaticMutability
2937 where
2938 F: Fold + ?Sized,
2939 {
2940 match node {
2941 StaticMutability::Mut(_binding_0) => StaticMutability::Mut(_binding_0),
2942 StaticMutability::None => StaticMutability::None,
2943 }
2944 }
2945 #[cfg(feature = "full")]
2946 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_stmtnull2947 pub fn fold_stmt<F>(f: &mut F, node: Stmt) -> Stmt
2948 where
2949 F: Fold + ?Sized,
2950 {
2951 match node {
2952 Stmt::Local(_binding_0) => Stmt::Local(f.fold_local(_binding_0)),
2953 Stmt::Item(_binding_0) => Stmt::Item(f.fold_item(_binding_0)),
2954 Stmt::Expr(_binding_0, _binding_1) => {
2955 Stmt::Expr(f.fold_expr(_binding_0), _binding_1)
2956 }
2957 Stmt::Macro(_binding_0) => Stmt::Macro(f.fold_stmt_macro(_binding_0)),
2958 }
2959 }
2960 #[cfg(feature = "full")]
2961 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_stmt_macronull2962 pub fn fold_stmt_macro<F>(f: &mut F, node: StmtMacro) -> StmtMacro
2963 where
2964 F: Fold + ?Sized,
2965 {
2966 StmtMacro {
2967 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
2968 mac: f.fold_macro(node.mac),
2969 semi_token: node.semi_token,
2970 }
2971 }
2972 #[cfg(any(feature = "derive", feature = "full"))]
2973 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_trait_boundnull2974 pub fn fold_trait_bound<F>(f: &mut F, node: TraitBound) -> TraitBound
2975 where
2976 F: Fold + ?Sized,
2977 {
2978 TraitBound {
2979 paren_token: node.paren_token,
2980 modifier: f.fold_trait_bound_modifier(node.modifier),
2981 lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
2982 path: f.fold_path(node.path),
2983 }
2984 }
2985 #[cfg(any(feature = "derive", feature = "full"))]
2986 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_trait_bound_modifiernull2987 pub fn fold_trait_bound_modifier<F>(
2988 f: &mut F,
2989 node: TraitBoundModifier,
2990 ) -> TraitBoundModifier
2991 where
2992 F: Fold + ?Sized,
2993 {
2994 match node {
2995 TraitBoundModifier::None => TraitBoundModifier::None,
2996 TraitBoundModifier::Maybe(_binding_0) => TraitBoundModifier::Maybe(_binding_0),
2997 }
2998 }
2999 #[cfg(feature = "full")]
3000 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_itemnull3001 pub fn fold_trait_item<F>(f: &mut F, node: TraitItem) -> TraitItem
3002 where
3003 F: Fold + ?Sized,
3004 {
3005 match node {
3006 TraitItem::Const(_binding_0) => {
3007 TraitItem::Const(f.fold_trait_item_const(_binding_0))
3008 }
3009 TraitItem::Fn(_binding_0) => TraitItem::Fn(f.fold_trait_item_fn(_binding_0)),
3010 TraitItem::Type(_binding_0) => {
3011 TraitItem::Type(f.fold_trait_item_type(_binding_0))
3012 }
3013 TraitItem::Macro(_binding_0) => {
3014 TraitItem::Macro(f.fold_trait_item_macro(_binding_0))
3015 }
3016 TraitItem::Verbatim(_binding_0) => TraitItem::Verbatim(_binding_0),
3017 }
3018 }
3019 #[cfg(feature = "full")]
3020 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_constnull3021 pub fn fold_trait_item_const<F>(f: &mut F, node: TraitItemConst) -> TraitItemConst
3022 where
3023 F: Fold + ?Sized,
3024 {
3025 TraitItemConst {
3026 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3027 const_token: node.const_token,
3028 ident: f.fold_ident(node.ident),
3029 generics: f.fold_generics(node.generics),
3030 colon_token: node.colon_token,
3031 ty: f.fold_type(node.ty),
3032 default: (node.default).map(|it| ((it).0, f.fold_expr((it).1))),
3033 semi_token: node.semi_token,
3034 }
3035 }
3036 #[cfg(feature = "full")]
3037 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_fnnull3038 pub fn fold_trait_item_fn<F>(f: &mut F, node: TraitItemFn) -> TraitItemFn
3039 where
3040 F: Fold + ?Sized,
3041 {
3042 TraitItemFn {
3043 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3044 sig: f.fold_signature(node.sig),
3045 default: (node.default).map(|it| f.fold_block(it)),
3046 semi_token: node.semi_token,
3047 }
3048 }
3049 #[cfg(feature = "full")]
3050 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_macronull3051 pub fn fold_trait_item_macro<F>(f: &mut F, node: TraitItemMacro) -> TraitItemMacro
3052 where
3053 F: Fold + ?Sized,
3054 {
3055 TraitItemMacro {
3056 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3057 mac: f.fold_macro(node.mac),
3058 semi_token: node.semi_token,
3059 }
3060 }
3061 #[cfg(feature = "full")]
3062 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_trait_item_typenull3063 pub fn fold_trait_item_type<F>(f: &mut F, node: TraitItemType) -> TraitItemType
3064 where
3065 F: Fold + ?Sized,
3066 {
3067 TraitItemType {
3068 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3069 type_token: node.type_token,
3070 ident: f.fold_ident(node.ident),
3071 generics: f.fold_generics(node.generics),
3072 colon_token: node.colon_token,
3073 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
3074 default: (node.default).map(|it| ((it).0, f.fold_type((it).1))),
3075 semi_token: node.semi_token,
3076 }
3077 }
3078 #[cfg(any(feature = "derive", feature = "full"))]
3079 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_typenull3080 pub fn fold_type<F>(f: &mut F, node: Type) -> Type
3081 where
3082 F: Fold + ?Sized,
3083 {
3084 match node {
3085 Type::Array(_binding_0) => Type::Array(f.fold_type_array(_binding_0)),
3086 Type::BareFn(_binding_0) => Type::BareFn(f.fold_type_bare_fn(_binding_0)),
3087 Type::Group(_binding_0) => Type::Group(f.fold_type_group(_binding_0)),
3088 Type::ImplTrait(_binding_0) => {
3089 Type::ImplTrait(f.fold_type_impl_trait(_binding_0))
3090 }
3091 Type::Infer(_binding_0) => Type::Infer(f.fold_type_infer(_binding_0)),
3092 Type::Macro(_binding_0) => Type::Macro(f.fold_type_macro(_binding_0)),
3093 Type::Never(_binding_0) => Type::Never(f.fold_type_never(_binding_0)),
3094 Type::Paren(_binding_0) => Type::Paren(f.fold_type_paren(_binding_0)),
3095 Type::Path(_binding_0) => Type::Path(f.fold_type_path(_binding_0)),
3096 Type::Ptr(_binding_0) => Type::Ptr(f.fold_type_ptr(_binding_0)),
3097 Type::Reference(_binding_0) => Type::Reference(f.fold_type_reference(_binding_0)),
3098 Type::Slice(_binding_0) => Type::Slice(f.fold_type_slice(_binding_0)),
3099 Type::TraitObject(_binding_0) => {
3100 Type::TraitObject(f.fold_type_trait_object(_binding_0))
3101 }
3102 Type::Tuple(_binding_0) => Type::Tuple(f.fold_type_tuple(_binding_0)),
3103 Type::Verbatim(_binding_0) => Type::Verbatim(_binding_0),
3104 }
3105 }
3106 #[cfg(any(feature = "derive", feature = "full"))]
3107 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_arraynull3108 pub fn fold_type_array<F>(f: &mut F, node: TypeArray) -> TypeArray
3109 where
3110 F: Fold + ?Sized,
3111 {
3112 TypeArray {
3113 bracket_token: node.bracket_token,
3114 elem: Box::new(f.fold_type(*node.elem)),
3115 semi_token: node.semi_token,
3116 len: f.fold_expr(node.len),
3117 }
3118 }
3119 #[cfg(any(feature = "derive", feature = "full"))]
3120 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_bare_fnnull3121 pub fn fold_type_bare_fn<F>(f: &mut F, node: TypeBareFn) -> TypeBareFn
3122 where
3123 F: Fold + ?Sized,
3124 {
3125 TypeBareFn {
3126 lifetimes: (node.lifetimes).map(|it| f.fold_bound_lifetimes(it)),
3127 unsafety: node.unsafety,
3128 abi: (node.abi).map(|it| f.fold_abi(it)),
3129 fn_token: node.fn_token,
3130 paren_token: node.paren_token,
3131 inputs: FoldHelper::lift(node.inputs, |it| f.fold_bare_fn_arg(it)),
3132 variadic: (node.variadic).map(|it| f.fold_bare_variadic(it)),
3133 output: f.fold_return_type(node.output),
3134 }
3135 }
3136 #[cfg(any(feature = "derive", feature = "full"))]
3137 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_groupnull3138 pub fn fold_type_group<F>(f: &mut F, node: TypeGroup) -> TypeGroup
3139 where
3140 F: Fold + ?Sized,
3141 {
3142 TypeGroup {
3143 group_token: node.group_token,
3144 elem: Box::new(f.fold_type(*node.elem)),
3145 }
3146 }
3147 #[cfg(any(feature = "derive", feature = "full"))]
3148 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_impl_traitnull3149 pub fn fold_type_impl_trait<F>(f: &mut F, node: TypeImplTrait) -> TypeImplTrait
3150 where
3151 F: Fold + ?Sized,
3152 {
3153 TypeImplTrait {
3154 impl_token: node.impl_token,
3155 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
3156 }
3157 }
3158 #[cfg(any(feature = "derive", feature = "full"))]
3159 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_infernull3160 pub fn fold_type_infer<F>(f: &mut F, node: TypeInfer) -> TypeInfer
3161 where
3162 F: Fold + ?Sized,
3163 {
3164 TypeInfer {
3165 underscore_token: node.underscore_token,
3166 }
3167 }
3168 #[cfg(any(feature = "derive", feature = "full"))]
3169 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_macronull3170 pub fn fold_type_macro<F>(f: &mut F, node: TypeMacro) -> TypeMacro
3171 where
3172 F: Fold + ?Sized,
3173 {
3174 TypeMacro {
3175 mac: f.fold_macro(node.mac),
3176 }
3177 }
3178 #[cfg(any(feature = "derive", feature = "full"))]
3179 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_nevernull3180 pub fn fold_type_never<F>(f: &mut F, node: TypeNever) -> TypeNever
3181 where
3182 F: Fold + ?Sized,
3183 {
3184 TypeNever {
3185 bang_token: node.bang_token,
3186 }
3187 }
3188 #[cfg(any(feature = "derive", feature = "full"))]
3189 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_paramnull3190 pub fn fold_type_param<F>(f: &mut F, node: TypeParam) -> TypeParam
3191 where
3192 F: Fold + ?Sized,
3193 {
3194 TypeParam {
3195 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3196 ident: f.fold_ident(node.ident),
3197 colon_token: node.colon_token,
3198 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
3199 eq_token: node.eq_token,
3200 default: (node.default).map(|it| f.fold_type(it)),
3201 }
3202 }
3203 #[cfg(any(feature = "derive", feature = "full"))]
3204 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_param_boundnull3205 pub fn fold_type_param_bound<F>(f: &mut F, node: TypeParamBound) -> TypeParamBound
3206 where
3207 F: Fold + ?Sized,
3208 {
3209 match node {
3210 TypeParamBound::Trait(_binding_0) => {
3211 TypeParamBound::Trait(f.fold_trait_bound(_binding_0))
3212 }
3213 TypeParamBound::Lifetime(_binding_0) => {
3214 TypeParamBound::Lifetime(f.fold_lifetime(_binding_0))
3215 }
3216 TypeParamBound::Verbatim(_binding_0) => TypeParamBound::Verbatim(_binding_0),
3217 }
3218 }
3219 #[cfg(any(feature = "derive", feature = "full"))]
3220 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_parennull3221 pub fn fold_type_paren<F>(f: &mut F, node: TypeParen) -> TypeParen
3222 where
3223 F: Fold + ?Sized,
3224 {
3225 TypeParen {
3226 paren_token: node.paren_token,
3227 elem: Box::new(f.fold_type(*node.elem)),
3228 }
3229 }
3230 #[cfg(any(feature = "derive", feature = "full"))]
3231 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_pathnull3232 pub fn fold_type_path<F>(f: &mut F, node: TypePath) -> TypePath
3233 where
3234 F: Fold + ?Sized,
3235 {
3236 TypePath {
3237 qself: (node.qself).map(|it| f.fold_qself(it)),
3238 path: f.fold_path(node.path),
3239 }
3240 }
3241 #[cfg(any(feature = "derive", feature = "full"))]
3242 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_ptrnull3243 pub fn fold_type_ptr<F>(f: &mut F, node: TypePtr) -> TypePtr
3244 where
3245 F: Fold + ?Sized,
3246 {
3247 TypePtr {
3248 star_token: node.star_token,
3249 const_token: node.const_token,
3250 mutability: node.mutability,
3251 elem: Box::new(f.fold_type(*node.elem)),
3252 }
3253 }
3254 #[cfg(any(feature = "derive", feature = "full"))]
3255 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_referencenull3256 pub fn fold_type_reference<F>(f: &mut F, node: TypeReference) -> TypeReference
3257 where
3258 F: Fold + ?Sized,
3259 {
3260 TypeReference {
3261 and_token: node.and_token,
3262 lifetime: (node.lifetime).map(|it| f.fold_lifetime(it)),
3263 mutability: node.mutability,
3264 elem: Box::new(f.fold_type(*node.elem)),
3265 }
3266 }
3267 #[cfg(any(feature = "derive", feature = "full"))]
3268 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_slicenull3269 pub fn fold_type_slice<F>(f: &mut F, node: TypeSlice) -> TypeSlice
3270 where
3271 F: Fold + ?Sized,
3272 {
3273 TypeSlice {
3274 bracket_token: node.bracket_token,
3275 elem: Box::new(f.fold_type(*node.elem)),
3276 }
3277 }
3278 #[cfg(any(feature = "derive", feature = "full"))]
3279 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_trait_objectnull3280 pub fn fold_type_trait_object<F>(f: &mut F, node: TypeTraitObject) -> TypeTraitObject
3281 where
3282 F: Fold + ?Sized,
3283 {
3284 TypeTraitObject {
3285 dyn_token: node.dyn_token,
3286 bounds: FoldHelper::lift(node.bounds, |it| f.fold_type_param_bound(it)),
3287 }
3288 }
3289 #[cfg(any(feature = "derive", feature = "full"))]
3290 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_type_tuplenull3291 pub fn fold_type_tuple<F>(f: &mut F, node: TypeTuple) -> TypeTuple
3292 where
3293 F: Fold + ?Sized,
3294 {
3295 TypeTuple {
3296 paren_token: node.paren_token,
3297 elems: FoldHelper::lift(node.elems, |it| f.fold_type(it)),
3298 }
3299 }
3300 #[cfg(any(feature = "derive", feature = "full"))]
3301 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_un_opnull3302 pub fn fold_un_op<F>(f: &mut F, node: UnOp) -> UnOp
3303 where
3304 F: Fold + ?Sized,
3305 {
3306 match node {
3307 UnOp::Deref(_binding_0) => UnOp::Deref(_binding_0),
3308 UnOp::Not(_binding_0) => UnOp::Not(_binding_0),
3309 UnOp::Neg(_binding_0) => UnOp::Neg(_binding_0),
3310 }
3311 }
3312 #[cfg(feature = "full")]
3313 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_globnull3314 pub fn fold_use_glob<F>(f: &mut F, node: UseGlob) -> UseGlob
3315 where
3316 F: Fold + ?Sized,
3317 {
3318 UseGlob {
3319 star_token: node.star_token,
3320 }
3321 }
3322 #[cfg(feature = "full")]
3323 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_groupnull3324 pub fn fold_use_group<F>(f: &mut F, node: UseGroup) -> UseGroup
3325 where
3326 F: Fold + ?Sized,
3327 {
3328 UseGroup {
3329 brace_token: node.brace_token,
3330 items: FoldHelper::lift(node.items, |it| f.fold_use_tree(it)),
3331 }
3332 }
3333 #[cfg(feature = "full")]
3334 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_namenull3335 pub fn fold_use_name<F>(f: &mut F, node: UseName) -> UseName
3336 where
3337 F: Fold + ?Sized,
3338 {
3339 UseName {
3340 ident: f.fold_ident(node.ident),
3341 }
3342 }
3343 #[cfg(feature = "full")]
3344 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_pathnull3345 pub fn fold_use_path<F>(f: &mut F, node: UsePath) -> UsePath
3346 where
3347 F: Fold + ?Sized,
3348 {
3349 UsePath {
3350 ident: f.fold_ident(node.ident),
3351 colon2_token: node.colon2_token,
3352 tree: Box::new(f.fold_use_tree(*node.tree)),
3353 }
3354 }
3355 #[cfg(feature = "full")]
3356 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_renamenull3357 pub fn fold_use_rename<F>(f: &mut F, node: UseRename) -> UseRename
3358 where
3359 F: Fold + ?Sized,
3360 {
3361 UseRename {
3362 ident: f.fold_ident(node.ident),
3363 as_token: node.as_token,
3364 rename: f.fold_ident(node.rename),
3365 }
3366 }
3367 #[cfg(feature = "full")]
3368 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_use_treenull3369 pub fn fold_use_tree<F>(f: &mut F, node: UseTree) -> UseTree
3370 where
3371 F: Fold + ?Sized,
3372 {
3373 match node {
3374 UseTree::Path(_binding_0) => UseTree::Path(f.fold_use_path(_binding_0)),
3375 UseTree::Name(_binding_0) => UseTree::Name(f.fold_use_name(_binding_0)),
3376 UseTree::Rename(_binding_0) => UseTree::Rename(f.fold_use_rename(_binding_0)),
3377 UseTree::Glob(_binding_0) => UseTree::Glob(f.fold_use_glob(_binding_0)),
3378 UseTree::Group(_binding_0) => UseTree::Group(f.fold_use_group(_binding_0)),
3379 }
3380 }
3381 #[cfg(feature = "full")]
3382 #[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
fold_variadicnull3383 pub fn fold_variadic<F>(f: &mut F, node: Variadic) -> Variadic
3384 where
3385 F: Fold + ?Sized,
3386 {
3387 Variadic {
3388 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3389 pat: (node.pat).map(|it| (Box::new(f.fold_pat(*(it).0)), (it).1)),
3390 dots: node.dots,
3391 comma: node.comma,
3392 }
3393 }
3394 #[cfg(any(feature = "derive", feature = "full"))]
3395 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_variantnull3396 pub fn fold_variant<F>(f: &mut F, node: Variant) -> Variant
3397 where
3398 F: Fold + ?Sized,
3399 {
3400 Variant {
3401 attrs: FoldHelper::lift(node.attrs, |it| f.fold_attribute(it)),
3402 ident: f.fold_ident(node.ident),
3403 fields: f.fold_fields(node.fields),
3404 discriminant: (node.discriminant).map(|it| ((it).0, f.fold_expr((it).1))),
3405 }
3406 }
3407 #[cfg(any(feature = "derive", feature = "full"))]
3408 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_vis_restrictednull3409 pub fn fold_vis_restricted<F>(f: &mut F, node: VisRestricted) -> VisRestricted
3410 where
3411 F: Fold + ?Sized,
3412 {
3413 VisRestricted {
3414 pub_token: node.pub_token,
3415 paren_token: node.paren_token,
3416 in_token: node.in_token,
3417 path: Box::new(f.fold_path(*node.path)),
3418 }
3419 }
3420 #[cfg(any(feature = "derive", feature = "full"))]
3421 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_visibilitynull3422 pub fn fold_visibility<F>(f: &mut F, node: Visibility) -> Visibility
3423 where
3424 F: Fold + ?Sized,
3425 {
3426 match node {
3427 Visibility::Public(_binding_0) => Visibility::Public(_binding_0),
3428 Visibility::Restricted(_binding_0) => {
3429 Visibility::Restricted(f.fold_vis_restricted(_binding_0))
3430 }
3431 Visibility::Inherited => Visibility::Inherited,
3432 }
3433 }
3434 #[cfg(any(feature = "derive", feature = "full"))]
3435 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_where_clausenull3436 pub fn fold_where_clause<F>(f: &mut F, node: WhereClause) -> WhereClause
3437 where
3438 F: Fold + ?Sized,
3439 {
3440 WhereClause {
3441 where_token: node.where_token,
3442 predicates: FoldHelper::lift(node.predicates, |it| f.fold_where_predicate(it)),
3443 }
3444 }
3445 #[cfg(any(feature = "derive", feature = "full"))]
3446 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))]
fold_where_predicatenull3447 pub fn fold_where_predicate<F>(f: &mut F, node: WherePredicate) -> WherePredicate
3448 where
3449 F: Fold + ?Sized,
3450 {
3451 match node {
3452 WherePredicate::Lifetime(_binding_0) => {
3453 WherePredicate::Lifetime(f.fold_predicate_lifetime(_binding_0))
3454 }
3455 WherePredicate::Type(_binding_0) => {
3456 WherePredicate::Type(f.fold_predicate_type(_binding_0))
3457 }
3458 }
3459 }
3460