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