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"))] 11use crate::gen::helper::fold::*; 12use crate::*; 13use proc_macro2::Span; 14#[cfg(feature = "full")] 15macro_rules! full { 16 ($e:expr) => { 17 $e 18 }; 19} 20#[cfg(all(feature = "derive", not(feature = "full")))] 21macro_rules! full { 22 ($e:expr) => { 23 unreachable!() 24 }; 25} 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 31pub trait Fold { 32 #[cfg(any(feature = "derive", feature = "full"))] 33 #[cfg_attr(doc_cfg, doc(cfg(any(feature = "derive", feature = "full"))))] 34 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"))))] 39 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")))] 47 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"))))] 52 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"))))] 57 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"))))] 62 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"))))] 67 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"))))] 72 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"))))] 77 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"))))] 82 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")))] 87 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"))))] 92 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"))))] 97 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"))))] 102 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")))] 107 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")))] 112 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")))] 117 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")))] 122 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")))] 127 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"))))] 132 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")))] 137 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")))] 142 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")))] 147 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")))] 152 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"))))] 157 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")))] 162 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")))] 167 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"))))] 172 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"))))] 177 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")))] 182 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")))] 187 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")))] 192 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"))))] 197 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")))] 202 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"))))] 207 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")))] 212 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"))))] 217 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")))] 222 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")))] 227 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"))))] 232 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")))] 237 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"))))] 242 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")))] 247 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"))))] 252 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"))))] 257 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"))))] 262 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")))] 267 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"))))] 272 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")))] 277 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")))] 282 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"))))] 287 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")))] 292 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")))] 297 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")))] 302 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"))))] 307 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")))] 312 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")))] 317 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")))] 322 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"))))] 327 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"))))] 332 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")))] 337 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"))))] 342 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"))))] 347 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"))))] 352 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"))))] 357 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")))] 362 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")))] 367 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")))] 372 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")))] 377 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")))] 382 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")))] 387 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")))] 392 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"))))] 397 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"))))] 402 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"))))] 407 fn fold_generics(&mut self, i: Generics) -> Generics { 408 fold_generics(self, i) 409 } 410 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")))] 415 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")))] 420 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")))] 425 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")))] 430 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")))] 435 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")))] 440 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"))))] 445 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")))] 450 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")))] 455 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")))] 460 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")))] 465 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")))] 470 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")))] 475 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")))] 480 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")))] 485 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")))] 490 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")))] 495 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")))] 500 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")))] 505 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")))] 510 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")))] 515 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")))] 520 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")))] 525 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")))] 530 fn fold_label(&mut self, i: Label) -> Label { 531 fold_label(self, i) 532 } 533 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"))))] 538 fn fold_lifetime_param(&mut self, i: LifetimeParam) -> LifetimeParam { 539 fold_lifetime_param(self, i) 540 } 541 fn fold_lit(&mut self, i: Lit) -> Lit { 542 fold_lit(self, i) 543 } 544 fn fold_lit_bool(&mut self, i: LitBool) -> LitBool { 545 fold_lit_bool(self, i) 546 } 547 fn fold_lit_byte(&mut self, i: LitByte) -> LitByte { 548 fold_lit_byte(self, i) 549 } 550 fn fold_lit_byte_str(&mut self, i: LitByteStr) -> LitByteStr { 551 fold_lit_byte_str(self, i) 552 } 553 fn fold_lit_char(&mut self, i: LitChar) -> LitChar { 554 fold_lit_char(self, i) 555 } 556 fn fold_lit_float(&mut self, i: LitFloat) -> LitFloat { 557 fold_lit_float(self, i) 558 } 559 fn fold_lit_int(&mut self, i: LitInt) -> LitInt { 560 fold_lit_int(self, i) 561 } 562 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")))] 567 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")))] 572 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"))))] 577 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"))))] 582 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"))))] 587 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"))))] 592 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"))))] 597 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"))))] 602 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"))))] 607 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")))] 615 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")))] 620 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")))] 625 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")))] 630 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")))] 635 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")))] 640 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")))] 645 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")))] 650 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")))] 655 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")))] 660 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")))] 665 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")))] 670 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"))))] 675 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"))))] 680 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"))))] 685 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"))))] 690 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"))))] 695 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"))))] 700 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")))] 705 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")))] 710 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"))))] 715 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")))] 720 fn fold_signature(&mut self, i: Signature) -> Signature { 721 fold_signature(self, i) 722 } 723 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")))] 728 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")))] 733 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")))] 738 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"))))] 743 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"))))] 748 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")))] 756 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")))] 761 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")))] 766 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")))] 771 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")))] 776 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"))))] 781 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"))))] 786 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"))))] 791 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"))))] 796 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"))))] 801 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"))))] 806 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"))))] 811 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"))))] 816 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"))))] 821 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"))))] 826 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"))))] 831 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"))))] 836 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"))))] 841 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"))))] 846 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"))))] 851 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"))))] 856 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"))))] 861 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"))))] 866 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")))] 871 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")))] 876 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")))] 881 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")))] 886 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")))] 891 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")))] 896 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")))] 901 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"))))] 906 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"))))] 911 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"))))] 916 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"))))] 921 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"))))] 926 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"))))] 932pub fn fold_abi<F>(f: &mut F, node: Abi) -> Abi 933where 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"))))] 943pub fn fold_angle_bracketed_generic_arguments<F>( 944 f: &mut F, 945 node: AngleBracketedGenericArguments, 946) -> AngleBracketedGenericArguments 947where 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")))] 959pub fn fold_arm<F>(f: &mut F, node: Arm) -> Arm 960where 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"))))] 974pub fn fold_assoc_const<F>(f: &mut F, node: AssocConst) -> AssocConst 975where 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"))))] 987pub fn fold_assoc_type<F>(f: &mut F, node: AssocType) -> AssocType 988where 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"))))] 1000pub fn fold_attr_style<F>(f: &mut F, node: AttrStyle) -> AttrStyle 1001where 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"))))] 1011pub fn fold_attribute<F>(f: &mut F, node: Attribute) -> Attribute 1012where 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"))))] 1024pub fn fold_bare_fn_arg<F>(f: &mut F, node: BareFnArg) -> BareFnArg 1025where 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"))))] 1036pub fn fold_bare_variadic<F>(f: &mut F, node: BareVariadic) -> BareVariadic 1037where 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"))))] 1049pub fn fold_bin_op<F>(f: &mut F, node: BinOp) -> BinOp 1050where 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")))] 1086pub fn fold_block<F>(f: &mut F, node: Block) -> Block 1087where 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"))))] 1097pub fn fold_bound_lifetimes<F>(f: &mut F, node: BoundLifetimes) -> BoundLifetimes 1098where 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"))))] 1110pub fn fold_const_param<F>(f: &mut F, node: ConstParam) -> ConstParam 1111where 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"))))] 1126pub fn fold_constraint<F>(f: &mut F, node: Constraint) -> Constraint 1127where 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")))] 1139pub fn fold_data<F>(f: &mut F, node: Data) -> Data 1140where 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")))] 1151pub fn fold_data_enum<F>(f: &mut F, node: DataEnum) -> DataEnum 1152where 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")))] 1163pub fn fold_data_struct<F>(f: &mut F, node: DataStruct) -> DataStruct 1164where 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")))] 1175pub fn fold_data_union<F>(f: &mut F, node: DataUnion) -> DataUnion 1176where 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")))] 1186pub fn fold_derive_input<F>(f: &mut F, node: DeriveInput) -> DeriveInput 1187where 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"))))] 1200pub fn fold_expr<F>(f: &mut F, node: Expr) -> Expr 1201where 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")))] 1258pub fn fold_expr_array<F>(f: &mut F, node: ExprArray) -> ExprArray 1259where 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")))] 1270pub fn fold_expr_assign<F>(f: &mut F, node: ExprAssign) -> ExprAssign 1271where 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")))] 1283pub fn fold_expr_async<F>(f: &mut F, node: ExprAsync) -> ExprAsync 1284where 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")))] 1296pub fn fold_expr_await<F>(f: &mut F, node: ExprAwait) -> ExprAwait 1297where 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"))))] 1309pub fn fold_expr_binary<F>(f: &mut F, node: ExprBinary) -> ExprBinary 1310where 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")))] 1322pub fn fold_expr_block<F>(f: &mut F, node: ExprBlock) -> ExprBlock 1323where 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")))] 1334pub fn fold_expr_break<F>(f: &mut F, node: ExprBreak) -> ExprBreak 1335where 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"))))] 1347pub fn fold_expr_call<F>(f: &mut F, node: ExprCall) -> ExprCall 1348where 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"))))] 1360pub fn fold_expr_cast<F>(f: &mut F, node: ExprCast) -> ExprCast 1361where 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")))] 1373pub fn fold_expr_closure<F>(f: &mut F, node: ExprClosure) -> ExprClosure 1374where 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")))] 1393pub fn fold_expr_const<F>(f: &mut F, node: ExprConst) -> ExprConst 1394where 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")))] 1405pub fn fold_expr_continue<F>(f: &mut F, node: ExprContinue) -> ExprContinue 1406where 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"))))] 1417pub fn fold_expr_field<F>(f: &mut F, node: ExprField) -> ExprField 1418where 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")))] 1430pub fn fold_expr_for_loop<F>(f: &mut F, node: ExprForLoop) -> ExprForLoop 1431where 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"))))] 1446pub fn fold_expr_group<F>(f: &mut F, node: ExprGroup) -> ExprGroup 1447where 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")))] 1458pub fn fold_expr_if<F>(f: &mut F, node: ExprIf) -> ExprIf 1459where 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"))))] 1473pub fn fold_expr_index<F>(f: &mut F, node: ExprIndex) -> ExprIndex 1474where 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")))] 1486pub fn fold_expr_infer<F>(f: &mut F, node: ExprInfer) -> ExprInfer 1487where 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")))] 1497pub fn fold_expr_let<F>(f: &mut F, node: ExprLet) -> ExprLet 1498where 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"))))] 1511pub fn fold_expr_lit<F>(f: &mut F, node: ExprLit) -> ExprLit 1512where 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")))] 1522pub fn fold_expr_loop<F>(f: &mut F, node: ExprLoop) -> ExprLoop 1523where 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"))))] 1535pub fn fold_expr_macro<F>(f: &mut F, node: ExprMacro) -> ExprMacro 1536where 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")))] 1546pub fn fold_expr_match<F>(f: &mut F, node: ExprMatch) -> ExprMatch 1547where 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"))))] 1560pub fn fold_expr_method_call<F>(f: &mut F, node: ExprMethodCall) -> ExprMethodCall 1561where 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"))))] 1577pub fn fold_expr_paren<F>(f: &mut F, node: ExprParen) -> ExprParen 1578where 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"))))] 1589pub fn fold_expr_path<F>(f: &mut F, node: ExprPath) -> ExprPath 1590where 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")))] 1601pub fn fold_expr_range<F>(f: &mut F, node: ExprRange) -> ExprRange 1602where 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"))))] 1614pub fn fold_expr_reference<F>(f: &mut F, node: ExprReference) -> ExprReference 1615where 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")))] 1627pub fn fold_expr_repeat<F>(f: &mut F, node: ExprRepeat) -> ExprRepeat 1628where 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")))] 1641pub fn fold_expr_return<F>(f: &mut F, node: ExprReturn) -> ExprReturn 1642where 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"))))] 1653pub fn fold_expr_struct<F>(f: &mut F, node: ExprStruct) -> ExprStruct 1654where 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")))] 1669pub fn fold_expr_try<F>(f: &mut F, node: ExprTry) -> ExprTry 1670where 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")))] 1681pub fn fold_expr_try_block<F>(f: &mut F, node: ExprTryBlock) -> ExprTryBlock 1682where 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")))] 1693pub fn fold_expr_tuple<F>(f: &mut F, node: ExprTuple) -> ExprTuple 1694where 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"))))] 1705pub fn fold_expr_unary<F>(f: &mut F, node: ExprUnary) -> ExprUnary 1706where 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")))] 1717pub fn fold_expr_unsafe<F>(f: &mut F, node: ExprUnsafe) -> ExprUnsafe 1718where 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")))] 1729pub fn fold_expr_while<F>(f: &mut F, node: ExprWhile) -> ExprWhile 1730where 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")))] 1743pub fn fold_expr_yield<F>(f: &mut F, node: ExprYield) -> ExprYield 1744where 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"))))] 1755pub fn fold_field<F>(f: &mut F, node: Field) -> Field 1756where 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"))))] 1770pub fn fold_field_mutability<F>(f: &mut F, node: FieldMutability) -> FieldMutability 1771where 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")))] 1780pub fn fold_field_pat<F>(f: &mut F, node: FieldPat) -> FieldPat 1781where 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"))))] 1793pub fn fold_field_value<F>(f: &mut F, node: FieldValue) -> FieldValue 1794where 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"))))] 1806pub fn fold_fields<F>(f: &mut F, node: Fields) -> Fields 1807where 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"))))] 1818pub fn fold_fields_named<F>(f: &mut F, node: FieldsNamed) -> FieldsNamed 1819where 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"))))] 1829pub fn fold_fields_unnamed<F>(f: &mut F, node: FieldsUnnamed) -> FieldsUnnamed 1830where 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")))] 1840pub fn fold_file<F>(f: &mut F, node: File) -> File 1841where 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")))] 1852pub fn fold_fn_arg<F>(f: &mut F, node: FnArg) -> FnArg 1853where 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")))] 1863pub fn fold_foreign_item<F>(f: &mut F, node: ForeignItem) -> ForeignItem 1864where 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")))] 1885pub fn fold_foreign_item_fn<F>(f: &mut F, node: ForeignItemFn) -> ForeignItemFn 1886where 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")))] 1898pub fn fold_foreign_item_macro<F>(f: &mut F, node: ForeignItemMacro) -> ForeignItemMacro 1899where 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")))] 1910pub fn fold_foreign_item_static<F>( 1911 f: &mut F, 1912 node: ForeignItemStatic, 1913) -> ForeignItemStatic 1914where 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")))] 1930pub fn fold_foreign_item_type<F>(f: &mut F, node: ForeignItemType) -> ForeignItemType 1931where 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"))))] 1945pub fn fold_generic_argument<F>(f: &mut F, node: GenericArgument) -> GenericArgument 1946where 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"))))] 1972pub fn fold_generic_param<F>(f: &mut F, node: GenericParam) -> GenericParam 1973where 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"))))] 1990pub fn fold_generics<F>(f: &mut F, node: Generics) -> Generics 1991where 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} 2001pub fn fold_ident<F>(f: &mut F, node: Ident) -> Ident 2002where 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")))] 2012pub fn fold_impl_item<F>(f: &mut F, node: ImplItem) -> ImplItem 2013where 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")))] 2030pub fn fold_impl_item_const<F>(f: &mut F, node: ImplItemConst) -> ImplItemConst 2031where 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")))] 2050pub fn fold_impl_item_fn<F>(f: &mut F, node: ImplItemFn) -> ImplItemFn 2051where 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")))] 2064pub fn fold_impl_item_macro<F>(f: &mut F, node: ImplItemMacro) -> ImplItemMacro 2065where 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")))] 2076pub fn fold_impl_item_type<F>(f: &mut F, node: ImplItemType) -> ImplItemType 2077where 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")))] 2094pub fn fold_impl_restriction<F>(f: &mut F, node: ImplRestriction) -> ImplRestriction 2095where 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"))))] 2102pub fn fold_index<F>(f: &mut F, node: Index) -> Index 2103where 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")))] 2113pub fn fold_item<F>(f: &mut F, node: Item) -> Item 2114where 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")))] 2144pub fn fold_item_const<F>(f: &mut F, node: ItemConst) -> ItemConst 2145where 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")))] 2163pub fn fold_item_enum<F>(f: &mut F, node: ItemEnum) -> ItemEnum 2164where 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")))] 2179pub fn fold_item_extern_crate<F>(f: &mut F, node: ItemExternCrate) -> ItemExternCrate 2180where 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")))] 2195pub fn fold_item_fn<F>(f: &mut F, node: ItemFn) -> ItemFn 2196where 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")))] 2208pub fn fold_item_foreign_mod<F>(f: &mut F, node: ItemForeignMod) -> ItemForeignMod 2209where 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")))] 2222pub fn fold_item_impl<F>(f: &mut F, node: ItemImpl) -> ItemImpl 2223where 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")))] 2240pub fn fold_item_macro<F>(f: &mut F, node: ItemMacro) -> ItemMacro 2241where 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")))] 2253pub fn fold_item_mod<F>(f: &mut F, node: ItemMod) -> ItemMod 2254where 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")))] 2270pub fn fold_item_static<F>(f: &mut F, node: ItemStatic) -> ItemStatic 2271where 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")))] 2289pub fn fold_item_struct<F>(f: &mut F, node: ItemStruct) -> ItemStruct 2290where 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")))] 2305pub fn fold_item_trait<F>(f: &mut F, node: ItemTrait) -> ItemTrait 2306where 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")))] 2329pub fn fold_item_trait_alias<F>(f: &mut F, node: ItemTraitAlias) -> ItemTraitAlias 2330where 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")))] 2346pub fn fold_item_type<F>(f: &mut F, node: ItemType) -> ItemType 2347where 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")))] 2363pub fn fold_item_union<F>(f: &mut F, node: ItemUnion) -> ItemUnion 2364where 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")))] 2378pub fn fold_item_use<F>(f: &mut F, node: ItemUse) -> ItemUse 2379where 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")))] 2393pub fn fold_label<F>(f: &mut F, node: Label) -> Label 2394where 2395 F: Fold + ?Sized, 2396{ 2397 Label { 2398 name: f.fold_lifetime(node.name), 2399 colon_token: node.colon_token, 2400 } 2401} 2402pub fn fold_lifetime<F>(f: &mut F, node: Lifetime) -> Lifetime 2403where 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"))))] 2413pub fn fold_lifetime_param<F>(f: &mut F, node: LifetimeParam) -> LifetimeParam 2414where 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} 2424pub fn fold_lit<F>(f: &mut F, node: Lit) -> Lit 2425where 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} 2439pub fn fold_lit_bool<F>(f: &mut F, node: LitBool) -> LitBool 2440where 2441 F: Fold + ?Sized, 2442{ 2443 LitBool { 2444 value: node.value, 2445 span: f.fold_span(node.span), 2446 } 2447} 2448pub fn fold_lit_byte<F>(f: &mut F, node: LitByte) -> LitByte 2449where 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} 2457pub fn fold_lit_byte_str<F>(f: &mut F, node: LitByteStr) -> LitByteStr 2458where 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} 2466pub fn fold_lit_char<F>(f: &mut F, node: LitChar) -> LitChar 2467where 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} 2475pub fn fold_lit_float<F>(f: &mut F, node: LitFloat) -> LitFloat 2476where 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} 2484pub fn fold_lit_int<F>(f: &mut F, node: LitInt) -> LitInt 2485where 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} 2493pub fn fold_lit_str<F>(f: &mut F, node: LitStr) -> LitStr 2494where 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")))] 2504pub fn fold_local<F>(f: &mut F, node: Local) -> Local 2505where 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")))] 2518pub fn fold_local_init<F>(f: &mut F, node: LocalInit) -> LocalInit 2519where 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"))))] 2530pub fn fold_macro<F>(f: &mut F, node: Macro) -> Macro 2531where 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"))))] 2543pub fn fold_macro_delimiter<F>(f: &mut F, node: MacroDelimiter) -> MacroDelimiter 2544where 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"))))] 2555pub fn fold_member<F>(f: &mut F, node: Member) -> Member 2556where 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"))))] 2566pub fn fold_meta<F>(f: &mut F, node: Meta) -> Meta 2567where 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"))))] 2580pub fn fold_meta_list<F>(f: &mut F, node: MetaList) -> MetaList 2581where 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"))))] 2592pub fn fold_meta_name_value<F>(f: &mut F, node: MetaNameValue) -> MetaNameValue 2593where 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"))))] 2604pub fn fold_parenthesized_generic_arguments<F>( 2605 f: &mut F, 2606 node: ParenthesizedGenericArguments, 2607) -> ParenthesizedGenericArguments 2608where 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")))] 2619pub fn fold_pat<F>(f: &mut F, node: Pat) -> Pat 2620where 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")))] 2647pub fn fold_pat_ident<F>(f: &mut F, node: PatIdent) -> PatIdent 2648where 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")))] 2661pub fn fold_pat_or<F>(f: &mut F, node: PatOr) -> PatOr 2662where 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")))] 2673pub fn fold_pat_paren<F>(f: &mut F, node: PatParen) -> PatParen 2674where 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")))] 2685pub fn fold_pat_reference<F>(f: &mut F, node: PatReference) -> PatReference 2686where 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")))] 2698pub fn fold_pat_rest<F>(f: &mut F, node: PatRest) -> PatRest 2699where 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")))] 2709pub fn fold_pat_slice<F>(f: &mut F, node: PatSlice) -> PatSlice 2710where 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")))] 2721pub fn fold_pat_struct<F>(f: &mut F, node: PatStruct) -> PatStruct 2722where 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")))] 2736pub fn fold_pat_tuple<F>(f: &mut F, node: PatTuple) -> PatTuple 2737where 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")))] 2748pub fn fold_pat_tuple_struct<F>(f: &mut F, node: PatTupleStruct) -> PatTupleStruct 2749where 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")))] 2762pub fn fold_pat_type<F>(f: &mut F, node: PatType) -> PatType 2763where 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")))] 2775pub fn fold_pat_wild<F>(f: &mut F, node: PatWild) -> PatWild 2776where 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"))))] 2786pub fn fold_path<F>(f: &mut F, node: Path) -> Path 2787where 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"))))] 2797pub fn fold_path_arguments<F>(f: &mut F, node: PathArguments) -> PathArguments 2798where 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"))))] 2817pub fn fold_path_segment<F>(f: &mut F, node: PathSegment) -> PathSegment 2818where 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"))))] 2828pub fn fold_predicate_lifetime<F>( 2829 f: &mut F, 2830 node: PredicateLifetime, 2831) -> PredicateLifetime 2832where 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"))))] 2843pub fn fold_predicate_type<F>(f: &mut F, node: PredicateType) -> PredicateType 2844where 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"))))] 2856pub fn fold_qself<F>(f: &mut F, node: QSelf) -> QSelf 2857where 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")))] 2870pub fn fold_range_limits<F>(f: &mut F, node: RangeLimits) -> RangeLimits 2871where 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")))] 2881pub fn fold_receiver<F>(f: &mut F, node: Receiver) -> Receiver 2882where 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"))))] 2897pub fn fold_return_type<F>(f: &mut F, node: ReturnType) -> ReturnType 2898where 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")))] 2910pub fn fold_signature<F>(f: &mut F, node: Signature) -> Signature 2911where 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} 2928pub fn fold_span<F>(f: &mut F, node: Span) -> Span 2929where 2930 F: Fold + ?Sized, 2931{ 2932 node 2933} 2934#[cfg(feature = "full")] 2935#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))] 2936pub fn fold_static_mutability<F>(f: &mut F, node: StaticMutability) -> StaticMutability 2937where 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")))] 2947pub fn fold_stmt<F>(f: &mut F, node: Stmt) -> Stmt 2948where 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")))] 2962pub fn fold_stmt_macro<F>(f: &mut F, node: StmtMacro) -> StmtMacro 2963where 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"))))] 2974pub fn fold_trait_bound<F>(f: &mut F, node: TraitBound) -> TraitBound 2975where 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"))))] 2987pub fn fold_trait_bound_modifier<F>( 2988 f: &mut F, 2989 node: TraitBoundModifier, 2990) -> TraitBoundModifier 2991where 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")))] 3001pub fn fold_trait_item<F>(f: &mut F, node: TraitItem) -> TraitItem 3002where 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")))] 3021pub fn fold_trait_item_const<F>(f: &mut F, node: TraitItemConst) -> TraitItemConst 3022where 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")))] 3038pub fn fold_trait_item_fn<F>(f: &mut F, node: TraitItemFn) -> TraitItemFn 3039where 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")))] 3051pub fn fold_trait_item_macro<F>(f: &mut F, node: TraitItemMacro) -> TraitItemMacro 3052where 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")))] 3063pub fn fold_trait_item_type<F>(f: &mut F, node: TraitItemType) -> TraitItemType 3064where 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"))))] 3080pub fn fold_type<F>(f: &mut F, node: Type) -> Type 3081where 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"))))] 3108pub fn fold_type_array<F>(f: &mut F, node: TypeArray) -> TypeArray 3109where 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"))))] 3121pub fn fold_type_bare_fn<F>(f: &mut F, node: TypeBareFn) -> TypeBareFn 3122where 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"))))] 3138pub fn fold_type_group<F>(f: &mut F, node: TypeGroup) -> TypeGroup 3139where 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"))))] 3149pub fn fold_type_impl_trait<F>(f: &mut F, node: TypeImplTrait) -> TypeImplTrait 3150where 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"))))] 3160pub fn fold_type_infer<F>(f: &mut F, node: TypeInfer) -> TypeInfer 3161where 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"))))] 3170pub fn fold_type_macro<F>(f: &mut F, node: TypeMacro) -> TypeMacro 3171where 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"))))] 3180pub fn fold_type_never<F>(f: &mut F, node: TypeNever) -> TypeNever 3181where 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"))))] 3190pub fn fold_type_param<F>(f: &mut F, node: TypeParam) -> TypeParam 3191where 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"))))] 3205pub fn fold_type_param_bound<F>(f: &mut F, node: TypeParamBound) -> TypeParamBound 3206where 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"))))] 3221pub fn fold_type_paren<F>(f: &mut F, node: TypeParen) -> TypeParen 3222where 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"))))] 3232pub fn fold_type_path<F>(f: &mut F, node: TypePath) -> TypePath 3233where 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"))))] 3243pub fn fold_type_ptr<F>(f: &mut F, node: TypePtr) -> TypePtr 3244where 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"))))] 3256pub fn fold_type_reference<F>(f: &mut F, node: TypeReference) -> TypeReference 3257where 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"))))] 3269pub fn fold_type_slice<F>(f: &mut F, node: TypeSlice) -> TypeSlice 3270where 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"))))] 3280pub fn fold_type_trait_object<F>(f: &mut F, node: TypeTraitObject) -> TypeTraitObject 3281where 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"))))] 3291pub fn fold_type_tuple<F>(f: &mut F, node: TypeTuple) -> TypeTuple 3292where 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"))))] 3302pub fn fold_un_op<F>(f: &mut F, node: UnOp) -> UnOp 3303where 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")))] 3314pub fn fold_use_glob<F>(f: &mut F, node: UseGlob) -> UseGlob 3315where 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")))] 3324pub fn fold_use_group<F>(f: &mut F, node: UseGroup) -> UseGroup 3325where 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")))] 3335pub fn fold_use_name<F>(f: &mut F, node: UseName) -> UseName 3336where 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")))] 3345pub fn fold_use_path<F>(f: &mut F, node: UsePath) -> UsePath 3346where 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")))] 3357pub fn fold_use_rename<F>(f: &mut F, node: UseRename) -> UseRename 3358where 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")))] 3369pub fn fold_use_tree<F>(f: &mut F, node: UseTree) -> UseTree 3370where 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")))] 3383pub fn fold_variadic<F>(f: &mut F, node: Variadic) -> Variadic 3384where 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"))))] 3396pub fn fold_variant<F>(f: &mut F, node: Variant) -> Variant 3397where 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"))))] 3409pub fn fold_vis_restricted<F>(f: &mut F, node: VisRestricted) -> VisRestricted 3410where 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"))))] 3422pub fn fold_visibility<F>(f: &mut F, node: Visibility) -> Visibility 3423where 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"))))] 3436pub fn fold_where_clause<F>(f: &mut F, node: WhereClause) -> WhereClause 3437where 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"))))] 3447pub fn fold_where_predicate<F>(f: &mut F, node: WherePredicate) -> WherePredicate 3448where 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