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