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