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