1 // Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! This module contains `HashStable` implementations for various HIR data
12 //! types in no particular order.
15 use hir::def_id::DefId;
16 use ich::{StableHashingContext, NodeIdHashingMode};
21 use rustc_data_structures::stable_hasher::{HashStable, StableHasher,
24 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for DefId {
26 fn hash_stable<W: StableHasherResult>(&self,
27 hcx: &mut StableHashingContext<'a, 'tcx>,
28 hasher: &mut StableHasher<W>) {
29 hcx.def_path_hash(*self).hash_stable(hcx, hasher);
34 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::HirId {
36 fn hash_stable<W: StableHasherResult>(&self,
37 hcx: &mut StableHashingContext<'a, 'tcx>,
38 hasher: &mut StableHasher<W>) {
44 hcx.def_path_hash(DefId::local(owner)).hash_stable(hcx, hasher);
45 local_id.hash_stable(hcx, hasher);
49 impl_stable_hash_for!(tuple_struct hir::ItemLocalId { index });
51 // The following implementations of HashStable for ItemId, TraitItemId, and
52 // ImplItemId deserve special attention. Normally we do not hash NodeIds within
53 // the HIR, since they just signify a HIR nodes own path. But ItemId et al
54 // are used when another item in the HIR is *referenced* and we certainly
55 // want to pick up on a reference changing its target, so we hash the NodeIds
58 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::ItemId {
59 fn hash_stable<W: StableHasherResult>(&self,
60 hcx: &mut StableHashingContext<'a, 'tcx>,
61 hasher: &mut StableHasher<W>) {
66 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
67 id.hash_stable(hcx, hasher);
72 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::TraitItemId {
73 fn hash_stable<W: StableHasherResult>(&self,
74 hcx: &mut StableHashingContext<'a, 'tcx>,
75 hasher: &mut StableHasher<W>) {
76 let hir::TraitItemId {
80 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
81 node_id.hash_stable(hcx, hasher);
86 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::ImplItemId {
87 fn hash_stable<W: StableHasherResult>(&self,
88 hcx: &mut StableHashingContext<'a, 'tcx>,
89 hasher: &mut StableHasher<W>) {
94 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
95 node_id.hash_stable(hcx, hasher);
100 impl_stable_hash_for!(struct hir::Lifetime {
106 impl_stable_hash_for!(struct hir::LifetimeDef {
112 impl_stable_hash_for!(struct hir::Path {
118 impl_stable_hash_for!(struct hir::PathSegment {
123 impl_stable_hash_for!(enum hir::PathParameters {
124 AngleBracketedParameters(data),
125 ParenthesizedParameters(data)
128 impl_stable_hash_for!(struct hir::AngleBracketedParameterData {
135 impl_stable_hash_for!(struct hir::ParenthesizedParameterData {
141 impl_stable_hash_for!(enum hir::TyParamBound {
142 TraitTyParamBound(poly_trait_ref, trait_bound_modifier),
143 RegionTyParamBound(lifetime)
146 impl_stable_hash_for!(enum hir::TraitBoundModifier {
151 impl_stable_hash_for!(struct hir::TyParam {
160 impl_stable_hash_for!(struct hir::Generics {
167 impl_stable_hash_for!(struct hir::WhereClause {
172 impl_stable_hash_for!(enum hir::WherePredicate {
173 BoundPredicate(pred),
174 RegionPredicate(pred),
178 impl_stable_hash_for!(struct hir::WhereBoundPredicate {
185 impl_stable_hash_for!(struct hir::WhereRegionPredicate {
191 impl_stable_hash_for!(struct hir::WhereEqPredicate {
198 impl_stable_hash_for!(struct hir::MutTy {
203 impl_stable_hash_for!(struct hir::MethodSig {
211 impl_stable_hash_for!(struct hir::TypeBinding {
218 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Ty {
219 fn hash_stable<W: StableHasherResult>(&self,
220 hcx: &mut StableHashingContext<'a, 'tcx>,
221 hasher: &mut StableHasher<W>) {
222 let node_id_hashing_mode = match self.node {
230 hir::TyTraitObject(..) |
231 hir::TyImplTrait(..) |
235 NodeIdHashingMode::Ignore
238 NodeIdHashingMode::HashTraitsInScope
242 hcx.while_hashing_hir_bodies(true, |hcx| {
249 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
250 id.hash_stable(hcx, hasher);
252 node.hash_stable(hcx, hasher);
253 span.hash_stable(hcx, hasher);
258 impl_stable_hash_for!(enum hir::PrimTy {
267 impl_stable_hash_for!(struct hir::BareFnTy {
274 impl_stable_hash_for!(enum hir::Ty_ {
283 TyTraitObject(trait_refs, lifetime),
290 impl_stable_hash_for!(struct hir::FnDecl {
297 impl_stable_hash_for!(enum hir::FunctionRetTy {
302 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::TraitRef {
303 fn hash_stable<W: StableHasherResult>(&self,
304 hcx: &mut StableHashingContext<'a, 'tcx>,
305 hasher: &mut StableHasher<W>) {
311 path.hash_stable(hcx, hasher);
312 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashTraitsInScope, |hcx| {
313 ref_id.hash_stable(hcx, hasher);
319 impl_stable_hash_for!(struct hir::PolyTraitRef {
325 impl_stable_hash_for!(enum hir::QPath {
327 TypeRelative(t, path_segment)
330 impl_stable_hash_for!(struct hir::MacroDef {
340 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Block {
341 fn hash_stable<W: StableHasherResult>(&self,
342 hcx: &mut StableHashingContext<'a, 'tcx>,
343 hasher: &mut StableHasher<W>) {
353 let non_item_stmts = || stmts.iter().filter(|stmt| {
355 hir::StmtDecl(ref decl, _) => {
357 // If this is a declaration of a nested item, we don't
358 // want to leave any trace of it in the hash value, not
359 // even that it exists. Otherwise changing the position
360 // of nested items would invalidate the containing item
361 // even though that does not constitute a semantic
363 hir::DeclItem(_) => false,
364 hir::DeclLocal(_) => true
368 hir::StmtSemi(..) => true
372 let count = non_item_stmts().count();
374 count.hash_stable(hcx, hasher);
376 for stmt in non_item_stmts() {
377 stmt.hash_stable(hcx, hasher);
380 expr.hash_stable(hcx, hasher);
381 id.hash_stable(hcx, hasher);
382 rules.hash_stable(hcx, hasher);
383 span.hash_stable(hcx, hasher);
384 targeted_by_break.hash_stable(hcx, hasher);
388 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Pat {
389 fn hash_stable<W: StableHasherResult>(&self,
390 hcx: &mut StableHashingContext<'a, 'tcx>,
391 hasher: &mut StableHasher<W>) {
392 let node_id_hashing_mode = match self.node {
394 hir::PatKind::Binding(..) |
395 hir::PatKind::Tuple(..) |
396 hir::PatKind::Box(..) |
397 hir::PatKind::Ref(..) |
398 hir::PatKind::Lit(..) |
399 hir::PatKind::Range(..) |
400 hir::PatKind::Slice(..) => {
401 NodeIdHashingMode::Ignore
403 hir::PatKind::Path(..) |
404 hir::PatKind::Struct(..) |
405 hir::PatKind::TupleStruct(..) => {
406 NodeIdHashingMode::HashTraitsInScope
416 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
417 id.hash_stable(hcx, hasher);
419 node.hash_stable(hcx, hasher);
420 span.hash_stable(hcx, hasher);
424 impl_stable_hash_for_spanned!(hir::FieldPat);
425 impl_stable_hash_for!(struct hir::FieldPat {
431 impl_stable_hash_for!(enum hir::BindingMode {
432 BindByRef(mutability),
433 BindByValue(mutability)
436 impl_stable_hash_for!(enum hir::RangeEnd {
441 impl_stable_hash_for!(enum hir::PatKind {
443 Binding(binding_mode, var, name, sub),
444 Struct(path, field_pats, dotdot),
445 TupleStruct(path, field_pats, dotdot),
447 Tuple(field_pats, dotdot),
449 Ref(sub, mutability),
451 Range(start, end, end_kind),
452 Slice(one, two, three)
455 impl_stable_hash_for!(enum hir::BinOp_ {
476 impl_stable_hash_for_spanned!(hir::BinOp_);
478 impl_stable_hash_for!(enum hir::UnOp {
484 impl_stable_hash_for_spanned!(hir::Stmt_);
486 impl_stable_hash_for!(struct hir::Local {
495 impl_stable_hash_for_spanned!(hir::Decl_);
496 impl_stable_hash_for!(enum hir::Decl_ {
501 impl_stable_hash_for!(struct hir::Arm {
508 impl_stable_hash_for!(struct hir::Field {
515 impl_stable_hash_for_spanned!(ast::Name);
518 impl_stable_hash_for!(enum hir::BlockCheckMode {
521 PushUnsafeBlock(src),
525 impl_stable_hash_for!(enum hir::UnsafeSource {
530 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Expr {
531 fn hash_stable<W: StableHasherResult>(&self,
532 hcx: &mut StableHashingContext<'a, 'tcx>,
533 hasher: &mut StableHasher<W>) {
534 hcx.while_hashing_hir_bodies(true, |hcx| {
542 let (spans_always_on, node_id_hashing_mode) = match *node {
553 hir::ExprClosure(..) |
555 hir::ExprAssign(..) |
556 hir::ExprTupField(..) |
557 hir::ExprAddrOf(..) |
561 hir::ExprInlineAsm(..) |
562 hir::ExprRepeat(..) |
563 hir::ExprTup(..) => {
564 // For these we only hash the span when debuginfo is on.
565 (false, NodeIdHashingMode::Ignore)
567 // For the following, spans might be significant because of
568 // panic messages indicating the source location.
569 hir::ExprBinary(op, ..) => {
570 (hcx.binop_can_panic_at_runtime(op.node), NodeIdHashingMode::Ignore)
572 hir::ExprUnary(op, _) => {
573 (hcx.unop_can_panic_at_runtime(op), NodeIdHashingMode::Ignore)
575 hir::ExprAssignOp(op, ..) => {
576 (hcx.binop_can_panic_at_runtime(op.node), NodeIdHashingMode::Ignore)
578 hir::ExprIndex(..) => {
579 (true, NodeIdHashingMode::Ignore)
581 // For these we don't care about the span, but want to hash the
583 hir::ExprMethodCall(..) |
585 hir::ExprStruct(..) |
586 hir::ExprField(..) => {
587 (false, NodeIdHashingMode::HashTraitsInScope)
591 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
592 id.hash_stable(hcx, hasher);
596 hcx.while_hashing_spans(true, |hcx| {
597 span.hash_stable(hcx, hasher);
598 node.hash_stable(hcx, hasher);
599 attrs.hash_stable(hcx, hasher);
602 span.hash_stable(hcx, hasher);
603 node.hash_stable(hcx, hasher);
604 attrs.hash_stable(hcx, hasher);
610 impl_stable_hash_for!(enum hir::Expr_ {
613 ExprCall(callee, args),
614 ExprMethodCall(name, ts, args),
616 ExprBinary(op, lhs, rhs),
617 ExprUnary(op, operand),
621 ExprIf(cond, then, els),
622 ExprWhile(cond, body, label),
623 ExprLoop(body, label, loop_src),
624 ExprMatch(matchee, arms, match_src),
625 ExprClosure(capture_clause, decl, body_id, span),
627 ExprAssign(lhs, rhs),
628 ExprAssignOp(op, lhs, rhs),
629 ExprField(owner, field_name),
630 ExprTupField(owner, idx),
633 ExprAddrOf(mutability, sub),
634 ExprBreak(destination, sub),
635 ExprAgain(destination),
637 ExprInlineAsm(asm, inputs, outputs),
638 ExprStruct(path, fields, base),
639 ExprRepeat(val, times)
642 impl_stable_hash_for!(enum hir::LoopSource {
648 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::MatchSource {
649 fn hash_stable<W: StableHasherResult>(&self,
650 hcx: &mut StableHashingContext<'a, 'tcx>,
651 hasher: &mut StableHasher<W>) {
652 use hir::MatchSource;
654 mem::discriminant(self).hash_stable(hcx, hasher);
656 MatchSource::Normal |
657 MatchSource::WhileLetDesugar |
658 MatchSource::ForLoopDesugar |
659 MatchSource::TryDesugar => {
660 // No fields to hash.
662 MatchSource::IfLetDesugar { contains_else_clause } => {
663 contains_else_clause.hash_stable(hcx, hasher);
669 impl_stable_hash_for!(enum hir::CaptureClause {
674 impl_stable_hash_for_spanned!(usize);
676 impl_stable_hash_for!(struct hir::Destination {
681 impl_stable_hash_for_spanned!(ast::Ident);
683 impl_stable_hash_for!(enum hir::LoopIdResult {
688 impl_stable_hash_for!(enum hir::LoopIdError {
690 UnlabeledCfInWhileCondition,
694 impl_stable_hash_for!(enum hir::ScopeTarget {
699 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ast::Ident {
700 fn hash_stable<W: StableHasherResult>(&self,
701 hcx: &mut StableHashingContext<'a, 'tcx>,
702 hasher: &mut StableHasher<W>) {
705 ctxt: _ // Ignore this
708 name.hash_stable(hcx, hasher);
712 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::TraitItem {
713 fn hash_stable<W: StableHasherResult>(&self,
714 hcx: &mut StableHashingContext<'a, 'tcx>,
715 hasher: &mut StableHasher<W>) {
724 hcx.hash_hir_item_like(attrs, |hcx| {
725 id.hash_stable(hcx, hasher);
726 name.hash_stable(hcx, hasher);
727 attrs.hash_stable(hcx, hasher);
728 node.hash_stable(hcx, hasher);
729 span.hash_stable(hcx, hasher);
734 impl_stable_hash_for!(enum hir::TraitMethod {
739 impl_stable_hash_for!(enum hir::TraitItemKind {
745 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::ImplItem {
746 fn hash_stable<W: StableHasherResult>(&self,
747 hcx: &mut StableHashingContext<'a, 'tcx>,
748 hasher: &mut StableHasher<W>) {
759 hcx.hash_hir_item_like(attrs, |hcx| {
760 id.hash_stable(hcx, hasher);
761 name.hash_stable(hcx, hasher);
762 vis.hash_stable(hcx, hasher);
763 defaultness.hash_stable(hcx, hasher);
764 attrs.hash_stable(hcx, hasher);
765 node.hash_stable(hcx, hasher);
766 span.hash_stable(hcx, hasher);
771 impl_stable_hash_for!(enum hir::ImplItemKind {
777 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Visibility {
778 fn hash_stable<W: StableHasherResult>(&self,
779 hcx: &mut StableHashingContext<'a, 'tcx>,
780 hasher: &mut StableHasher<W>) {
781 mem::discriminant(self).hash_stable(hcx, hasher);
783 hir::Visibility::Public |
784 hir::Visibility::Crate |
785 hir::Visibility::Inherited => {
786 // No fields to hash.
788 hir::Visibility::Restricted { ref path, id } => {
789 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashTraitsInScope, |hcx| {
790 id.hash_stable(hcx, hasher);
792 path.hash_stable(hcx, hasher);
798 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Defaultness {
799 fn hash_stable<W: StableHasherResult>(&self,
800 hcx: &mut StableHashingContext<'a, 'tcx>,
801 hasher: &mut StableHasher<W>) {
802 mem::discriminant(self).hash_stable(hcx, hasher);
804 hir::Defaultness::Final => {
805 // No fields to hash.
807 hir::Defaultness::Default { has_value } => {
808 has_value.hash_stable(hcx, hasher);
814 impl_stable_hash_for!(enum hir::ImplPolarity {
819 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Mod {
820 fn hash_stable<W: StableHasherResult>(&self,
821 hcx: &mut StableHashingContext<'a, 'tcx>,
822 hasher: &mut StableHasher<W>) {
825 // We are not hashing the IDs of the items contained in the module.
826 // This is harmless and matches the current behavior but it's not
827 // actually correct. See issue #40876.
831 inner.hash_stable(hcx, hasher);
835 impl_stable_hash_for!(struct hir::ForeignMod {
840 impl_stable_hash_for!(struct hir::EnumDef {
844 impl_stable_hash_for!(struct hir::Variant_ {
851 impl_stable_hash_for_spanned!(hir::Variant_);
853 impl_stable_hash_for!(enum hir::UseKind {
859 impl_stable_hash_for!(struct hir::StructField {
868 impl_stable_hash_for!(enum hir::VariantData {
874 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Item {
875 fn hash_stable<W: StableHasherResult>(&self,
876 hcx: &mut StableHashingContext<'a, 'tcx>,
877 hasher: &mut StableHasher<W>) {
878 let node_id_hashing_mode = match self.node {
879 hir::ItemExternCrate(..) |
880 hir::ItemStatic(..) |
884 hir::ItemForeignMod(..) |
885 hir::ItemGlobalAsm(..) |
888 hir::ItemStruct(..) |
891 hir::ItemDefaultImpl(..) |
892 hir::ItemImpl(..) => {
893 NodeIdHashingMode::Ignore
895 hir::ItemUse(..) => {
896 NodeIdHashingMode::HashTraitsInScope
909 hcx.hash_hir_item_like(attrs, |hcx| {
910 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
911 id.hash_stable(hcx, hasher);
913 name.hash_stable(hcx, hasher);
914 attrs.hash_stable(hcx, hasher);
915 node.hash_stable(hcx, hasher);
916 vis.hash_stable(hcx, hasher);
917 span.hash_stable(hcx, hasher);
922 impl_stable_hash_for!(enum hir::Item_ {
923 ItemExternCrate(name),
924 ItemUse(path, use_kind),
925 ItemStatic(ty, mutability, body_id),
926 ItemConst(ty, body_id),
927 ItemFn(fn_decl, unsafety, constness, abi, generics, body_id),
929 ItemForeignMod(foreign_mod),
930 ItemGlobalAsm(global_asm),
931 ItemTy(ty, generics),
932 ItemEnum(enum_def, generics),
933 ItemStruct(variant_data, generics),
934 ItemUnion(variant_data, generics),
935 ItemTrait(unsafety, generics, bounds, item_refs),
936 ItemDefaultImpl(unsafety, trait_ref),
937 ItemImpl(unsafety, impl_polarity, impl_defaultness, generics, trait_ref, ty, impl_item_refs)
940 impl_stable_hash_for!(struct hir::TraitItemRef {
948 impl_stable_hash_for!(struct hir::ImplItemRef {
957 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::AssociatedItemKind {
958 fn hash_stable<W: StableHasherResult>(&self,
959 hcx: &mut StableHashingContext<'a, 'tcx>,
960 hasher: &mut StableHasher<W>) {
961 mem::discriminant(self).hash_stable(hcx, hasher);
963 hir::AssociatedItemKind::Const |
964 hir::AssociatedItemKind::Type => {
965 // No fields to hash.
967 hir::AssociatedItemKind::Method { has_self } => {
968 has_self.hash_stable(hcx, hasher);
974 impl_stable_hash_for!(struct hir::ForeignItem {
983 impl_stable_hash_for!(enum hir::ForeignItem_ {
984 ForeignItemFn(fn_decl, arg_names, generics),
985 ForeignItemStatic(ty, is_mutbl)
988 impl_stable_hash_for!(enum hir::Stmt_ {
994 impl_stable_hash_for!(struct hir::Arg {
999 impl_stable_hash_for!(struct hir::Body {
1004 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::BodyId {
1005 fn hash_stable<W: StableHasherResult>(&self,
1006 hcx: &mut StableHashingContext<'a, 'tcx>,
1007 hasher: &mut StableHasher<W>) {
1008 if hcx.hash_bodies() {
1009 hcx.tcx().hir.body(*self).hash_stable(hcx, hasher);
1014 impl_stable_hash_for!(struct hir::InlineAsmOutput {
1020 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::GlobalAsm {
1021 fn hash_stable<W: StableHasherResult>(&self,
1022 hcx: &mut StableHashingContext<'a, 'tcx>,
1023 hasher: &mut StableHasher<W>) {
1024 let hir::GlobalAsm {
1029 asm.hash_stable(hcx, hasher);
1033 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::InlineAsm {
1034 fn hash_stable<W: StableHasherResult>(&self,
1035 hcx: &mut StableHashingContext<'a, 'tcx>,
1036 hasher: &mut StableHasher<W>) {
1037 let hir::InlineAsm {
1046 ctxt: _, // This is used for error reporting
1049 asm.hash_stable(hcx, hasher);
1050 asm_str_style.hash_stable(hcx, hasher);
1051 outputs.hash_stable(hcx, hasher);
1052 inputs.hash_stable(hcx, hasher);
1053 clobbers.hash_stable(hcx, hasher);
1054 volatile.hash_stable(hcx, hasher);
1055 alignstack.hash_stable(hcx, hasher);
1056 dialect.hash_stable(hcx, hasher);
1060 impl_stable_hash_for!(enum hir::def::CtorKind {
1066 impl_stable_hash_for!(enum hir::def::Def {
1074 AssociatedTy(def_id),
1077 SelfTy(trait_def_id, impl_def_id),
1080 Static(def_id, is_mutbl),
1081 StructCtor(def_id, ctor_kind),
1082 VariantCtor(def_id, ctor_kind),
1084 AssociatedConst(def_id),
1086 Upvar(def_id, index, expr_id),
1088 Macro(def_id, macro_kind),
1093 impl_stable_hash_for!(enum hir::Mutability {
1099 impl_stable_hash_for!(enum hir::Unsafety {
1105 impl_stable_hash_for!(enum hir::Constness {
1110 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::def_id::DefIndex {
1112 fn hash_stable<W: StableHasherResult>(&self,
1113 hcx: &mut StableHashingContext<'a, 'tcx>,
1114 hasher: &mut StableHasher<W>) {
1115 DefId::local(*self).hash_stable(hcx, hasher);
1119 impl_stable_hash_for!(struct hir::def::Export {
1125 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ::middle::lang_items::LangItem {
1126 fn hash_stable<W: StableHasherResult>(&self,
1127 _: &mut StableHashingContext<'a, 'tcx>,
1128 hasher: &mut StableHasher<W>) {
1129 ::std::hash::Hash::hash(self, hasher);