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"))]
5use crate::tt::TokenStreamHelper;
6use crate::*;
7use std::hash::{Hash, Hasher};
8#[cfg(any(feature = "derive", feature = "full"))]
9#[cfg_attr(doc_cfg, doc(cfg(feature = "extra-traits")))]
10impl Hash for Abi {
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")))]
20impl Hash for AngleBracketedGenericArguments {
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")))]
31impl Hash for Arm {
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")))]
45impl Hash for AttrStyle {
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")))]
62impl Hash for Attribute {
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")))]
74impl Hash for BareFnArg {
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")))]
86impl Hash for BinOp {
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")))]
181impl Hash for Binding {
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")))]
192impl Hash for Block {
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")))]
202impl Hash for BoundLifetimes {
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")))]
212impl Hash for ConstParam {
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")))]
226impl Hash for Constraint {
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")))]
237impl Hash for Data {
238 fn hash<H>(&self, state: &mut H)
239 where
240 H: Hasher,
241 {
242 match self {
243 Data::Struct(v0: &DataStruct) => {
244 state.write_u8(0u8);
245 v0.hash(state);
246 }
247 Data::Enum(v0: &DataEnum) => {
248 state.write_u8(1u8);
249 v0.hash(state);
250 }
251 Data::Union(v0: &DataUnion) => {
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")))]
260impl Hash for DataEnum {
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")))]
270impl Hash for DataStruct {
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")))]
281impl Hash for DataUnion {
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")))]
291impl Hash for DeriveInput {
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")))]
305impl Hash for Expr {
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")))]
508impl Hash for ExprArray {
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")))]
519impl Hash for ExprAssign {
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")))]
531impl Hash for ExprAssignOp {
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")))]
544impl Hash for ExprAsync {
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")))]
556impl Hash for ExprAwait {
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")))]
567impl Hash for ExprBinary {
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")))]
580impl Hash for ExprBlock {
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")))]
592impl Hash for ExprBox {
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")))]
603impl Hash for ExprBreak {
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")))]
615impl Hash for ExprCall {
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")))]
627impl Hash for ExprCast {
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")))]
639impl Hash for ExprClosure {
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")))]
655impl Hash for ExprContinue {
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")))]
666impl Hash for ExprField {
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")))]
678impl Hash for ExprForLoop {
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")))]
692impl Hash for ExprGroup {
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")))]
703impl Hash for ExprIf {
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")))]
716impl Hash for ExprIndex {
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")))]
728impl Hash for ExprLet {
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")))]
740impl Hash for ExprLit {
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")))]
751impl Hash for ExprLoop {
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")))]
763impl Hash for ExprMacro {
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")))]
774impl Hash for ExprMatch {
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")))]
786impl Hash for ExprMethodCall {
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")))]
800impl Hash for ExprParen {
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")))]
811impl Hash for ExprPath {
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")))]
823impl Hash for ExprRange {
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")))]
836impl Hash for ExprReference {
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")))]
848impl Hash for ExprRepeat {
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")))]
860impl Hash for ExprReturn {
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")))]
871impl Hash for ExprStruct {
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")))]
885impl Hash for ExprTry {
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")))]
896impl Hash for ExprTryBlock {
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")))]
907impl Hash for ExprTuple {
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")))]
918impl Hash for ExprType {
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")))]
930impl Hash for ExprUnary {
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")))]
942impl Hash for ExprUnsafe {
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")))]
953impl Hash for ExprWhile {
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")))]
966impl Hash for ExprYield {
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")))]
977impl Hash for Field {
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")))]
991impl Hash for FieldPat {
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")))]
1004impl Hash for FieldValue {
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")))]
1017impl Hash for Fields {
1018 fn hash<H>(&self, state: &mut H)
1019 where
1020 H: Hasher,
1021 {
1022 match self {
1023 Fields::Named(v0: &FieldsNamed) => {
1024 state.write_u8(0u8);
1025 v0.hash(state);
1026 }
1027 Fields::Unnamed(v0: &FieldsUnnamed) => {
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")))]
1039impl Hash for FieldsNamed {
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")))]
1049impl Hash for FieldsUnnamed {
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")))]
1059impl Hash for File {
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")))]
1071impl Hash for FnArg {
1072 fn hash<H>(&self, state: &mut H)
1073 where
1074 H: Hasher,
1075 {
1076 match self {
1077 FnArg::Receiver(v0: &Receiver) => {
1078 state.write_u8(0u8);
1079 v0.hash(state);
1080 }
1081 FnArg::Typed(v0: &PatType) => {
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")))]
1090impl Hash for ForeignItem {
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")))]
1123impl Hash for ForeignItemFn {
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")))]
1135impl Hash for ForeignItemMacro {
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")))]
1147impl Hash for ForeignItemStatic {
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")))]
1161impl Hash for ForeignItemType {
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")))]
1173impl Hash for GenericArgument {
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")))]
1204impl Hash for GenericMethodArgument {
1205 fn hash<H>(&self, state: &mut H)
1206 where
1207 H: Hasher,
1208 {
1209 match self {
1210 GenericMethodArgument::Type(v0: &Type) => {
1211 state.write_u8(0u8);
1212 v0.hash(state);
1213 }
1214 GenericMethodArgument::Const(v0: &Expr) => {
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")))]
1223impl Hash for GenericParam {
1224 fn hash<H>(&self, state: &mut H)
1225 where
1226 H: Hasher,
1227 {
1228 match self {
1229 GenericParam::Type(v0: &TypeParam) => {
1230 state.write_u8(0u8);
1231 v0.hash(state);
1232 }
1233 GenericParam::Lifetime(v0: &LifetimeDef) => {
1234 state.write_u8(1u8);
1235 v0.hash(state);
1236 }
1237 GenericParam::Const(v0: &ConstParam) => {
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")))]
1246impl Hash for Generics {
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")))]
1259impl Hash for ImplItem {
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")))]
1292impl Hash for ImplItemConst {
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")))]
1307impl Hash for ImplItemMacro {
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")))]
1319impl Hash for ImplItemMethod {
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")))]
1333impl Hash for ImplItemType {
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")))]
1348impl Hash for Item {
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")))]
1429impl Hash for ItemConst {
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")))]
1443impl Hash for ItemEnum {
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")))]
1457impl Hash for ItemExternCrate {
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")))]
1470impl Hash for ItemFn {
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")))]
1483impl Hash for ItemForeignMod {
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")))]
1495impl Hash for ItemImpl {
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")))]
1511impl Hash for ItemMacro {
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")))]
1524impl Hash for ItemMacro2 {
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")))]
1537impl Hash for ItemMod {
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")))]
1551impl Hash for ItemStatic {
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")))]
1566impl Hash for ItemStruct {
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")))]
1581impl Hash for ItemTrait {
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")))]
1599impl Hash for ItemTraitAlias {
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")))]
1613impl Hash for ItemType {
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")))]
1627impl Hash for ItemUnion {
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")))]
1641impl Hash for ItemUse {
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")))]
1654impl Hash for Label {
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")))]
1664impl Hash for LifetimeDef {
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")))]
1676impl Hash for Lit {
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")))]
1718impl Hash for LitBool {
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")))]
1728impl Hash for Local {
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")))]
1740impl Hash for Macro {
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")))]
1752impl Hash for MacroDelimiter {
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")))]
1772impl Hash for Meta {
1773 fn hash<H>(&self, state: &mut H)
1774 where
1775 H: Hasher,
1776 {
1777 match self {
1778 Meta::Path(v0: &Path) => {
1779 state.write_u8(0u8);
1780 v0.hash(state);
1781 }
1782 Meta::List(v0: &MetaList) => {
1783 state.write_u8(1u8);
1784 v0.hash(state);
1785 }
1786 Meta::NameValue(v0: &MetaNameValue) => {
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")))]
1795impl Hash for MetaList {
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")))]
1806impl Hash for MetaNameValue {
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")))]
1817impl Hash for MethodTurbofish {
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")))]
1827impl Hash for NestedMeta {
1828 fn hash<H>(&self, state: &mut H)
1829 where
1830 H: Hasher,
1831 {
1832 match self {
1833 NestedMeta::Meta(v0: &Meta) => {
1834 state.write_u8(0u8);
1835 v0.hash(state);
1836 }
1837 NestedMeta::Lit(v0: &Lit) => {
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")))]
1846impl Hash for ParenthesizedGenericArguments {
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")))]
1857impl Hash for Pat {
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")))]
1934impl Hash for PatBox {
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")))]
1945impl Hash for PatIdent {
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")))]
1959impl Hash for PatLit {
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")))]
1970impl Hash for PatMacro {
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")))]
1981impl Hash for PatOr {
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")))]
1993impl Hash for PatPath {
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")))]
2005impl Hash for PatRange {
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")))]
2018impl Hash for PatReference {
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")))]
2030impl Hash for PatRest {
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")))]
2040impl Hash for PatSlice {
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")))]
2051impl Hash for PatStruct {
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")))]
2064impl Hash for PatTuple {
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")))]
2075impl Hash for PatTupleStruct {
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")))]
2087impl Hash for PatType {
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")))]
2099impl Hash for PatWild {
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")))]
2109impl Hash for Path {
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")))]
2120impl Hash for PathArguments {
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: &AngleBracketedGenericArguments) => {
2130 state.write_u8(1u8);
2131 v0.hash(state);
2132 }
2133 PathArguments::Parenthesized(v0: &ParenthesizedGenericArguments) => {
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")))]
2142impl Hash for PathSegment {
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")))]
2153impl Hash for PredicateEq {
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")))]
2164impl Hash for PredicateLifetime {
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")))]
2175impl Hash for PredicateType {
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")))]
2187impl Hash for QSelf {
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")))]
2199impl Hash for RangeLimits {
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")))]
2216impl Hash for Receiver {
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")))]
2228impl Hash for ReturnType {
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: &Box) => {
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")))]
2246impl Hash for Signature {
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")))]
2264impl Hash for Stmt {
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")))]
2291impl Hash for TraitBound {
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")))]
2304impl Hash for TraitBoundModifier {
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")))]
2321impl Hash for TraitItem {
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")))]
2354impl Hash for TraitItemConst {
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")))]
2367impl Hash for TraitItemMacro {
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")))]
2379impl Hash for TraitItemMethod {
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")))]
2392impl Hash for TraitItemType {
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")))]
2407impl Hash for Type {
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")))]
2480impl Hash for TypeArray {
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")))]
2491impl Hash for TypeBareFn {
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")))]
2506impl Hash for TypeGroup {
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")))]
2516impl Hash for TypeImplTrait {
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")))]
2526impl Hash for TypeInfer {
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")))]
2534impl Hash for TypeMacro {
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")))]
2544impl Hash for TypeNever {
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")))]
2552impl Hash for TypeParam {
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")))]
2567impl Hash for TypeParamBound {
2568 fn hash<H>(&self, state: &mut H)
2569 where
2570 H: Hasher,
2571 {
2572 match self {
2573 TypeParamBound::Trait(v0: &TraitBound) => {
2574 state.write_u8(0u8);
2575 v0.hash(state);
2576 }
2577 TypeParamBound::Lifetime(v0: &Lifetime) => {
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")))]
2586impl Hash for TypeParen {
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")))]
2596impl Hash for TypePath {
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")))]
2607impl Hash for TypePtr {
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")))]
2619impl Hash for TypeReference {
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")))]
2631impl Hash for TypeSlice {
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")))]
2641impl Hash for TypeTraitObject {
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")))]
2652impl Hash for TypeTuple {
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")))]
2662impl Hash for UnOp {
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")))]
2682impl Hash for UseGlob {
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")))]
2690impl Hash for UseGroup {
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")))]
2700impl Hash for UseName {
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")))]
2710impl Hash for UsePath {
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")))]
2721impl Hash for UseRename {
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")))]
2732impl Hash for UseTree {
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")))]
2763impl Hash for Variadic {
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")))]
2773impl Hash for Variant {
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")))]
2786impl Hash for VisCrate {
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")))]
2794impl Hash for VisPublic {
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")))]
2802impl Hash for VisRestricted {
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")))]
2813impl Hash for Visibility {
2814 fn hash<H>(&self, state: &mut H)
2815 where
2816 H: Hasher,
2817 {
2818 match self {
2819 Visibility::Public(v0: &VisPublic) => {
2820 state.write_u8(0u8);
2821 v0.hash(state);
2822 }
2823 Visibility::Crate(v0: &VisCrate) => {
2824 state.write_u8(1u8);
2825 v0.hash(state);
2826 }
2827 Visibility::Restricted(v0: &VisRestricted) => {
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")))]
2839impl Hash for WhereClause {
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")))]
2849impl Hash for WherePredicate {
2850 fn hash<H>(&self, state: &mut H)
2851 where
2852 H: Hasher,
2853 {
2854 match self {
2855 WherePredicate::Type(v0: &PredicateType) => {
2856 state.write_u8(0u8);
2857 v0.hash(state);
2858 }
2859 WherePredicate::Lifetime(v0: &PredicateLifetime) => {
2860 state.write_u8(1u8);
2861 v0.hash(state);
2862 }
2863 WherePredicate::Eq(v0: &PredicateEq) => {
2864 state.write_u8(2u8);
2865 v0.hash(state);
2866 }
2867 }
2868 }
2869}
2870