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