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