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