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 {
341 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Block {
342 fn hash_stable<W: StableHasherResult>(&self,
343 hcx: &mut StableHashingContext<'a, 'tcx>,
344 hasher: &mut StableHasher<W>) {
354 let non_item_stmts = || stmts.iter().filter(|stmt| {
356 hir::StmtDecl(ref decl, _) => {
358 // If this is a declaration of a nested item, we don't
359 // want to leave any trace of it in the hash value, not
360 // even that it exists. Otherwise changing the position
361 // of nested items would invalidate the containing item
362 // even though that does not constitute a semantic
364 hir::DeclItem(_) => false,
365 hir::DeclLocal(_) => true
369 hir::StmtSemi(..) => true
373 let count = non_item_stmts().count();
375 count.hash_stable(hcx, hasher);
377 for stmt in non_item_stmts() {
378 stmt.hash_stable(hcx, hasher);
381 expr.hash_stable(hcx, hasher);
382 id.hash_stable(hcx, hasher);
383 rules.hash_stable(hcx, hasher);
384 span.hash_stable(hcx, hasher);
385 targeted_by_break.hash_stable(hcx, hasher);
389 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Pat {
390 fn hash_stable<W: StableHasherResult>(&self,
391 hcx: &mut StableHashingContext<'a, 'tcx>,
392 hasher: &mut StableHasher<W>) {
393 let node_id_hashing_mode = match self.node {
395 hir::PatKind::Binding(..) |
396 hir::PatKind::Tuple(..) |
397 hir::PatKind::Box(..) |
398 hir::PatKind::Ref(..) |
399 hir::PatKind::Lit(..) |
400 hir::PatKind::Range(..) |
401 hir::PatKind::Slice(..) => {
402 NodeIdHashingMode::Ignore
404 hir::PatKind::Path(..) |
405 hir::PatKind::Struct(..) |
406 hir::PatKind::TupleStruct(..) => {
407 NodeIdHashingMode::HashTraitsInScope
417 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
418 id.hash_stable(hcx, hasher);
420 node.hash_stable(hcx, hasher);
421 span.hash_stable(hcx, hasher);
425 impl_stable_hash_for_spanned!(hir::FieldPat);
426 impl_stable_hash_for!(struct hir::FieldPat {
432 impl_stable_hash_for!(enum hir::BindingMode {
433 BindByRef(mutability),
434 BindByValue(mutability)
437 impl_stable_hash_for!(enum hir::RangeEnd {
442 impl_stable_hash_for!(enum hir::PatKind {
444 Binding(binding_mode, var, name, sub),
445 Struct(path, field_pats, dotdot),
446 TupleStruct(path, field_pats, dotdot),
448 Tuple(field_pats, dotdot),
450 Ref(sub, mutability),
452 Range(start, end, end_kind),
453 Slice(one, two, three)
456 impl_stable_hash_for!(enum hir::BinOp_ {
477 impl_stable_hash_for_spanned!(hir::BinOp_);
479 impl_stable_hash_for!(enum hir::UnOp {
485 impl_stable_hash_for_spanned!(hir::Stmt_);
487 impl_stable_hash_for!(struct hir::Local {
496 impl_stable_hash_for_spanned!(hir::Decl_);
497 impl_stable_hash_for!(enum hir::Decl_ {
502 impl_stable_hash_for!(struct hir::Arm {
509 impl_stable_hash_for!(struct hir::Field {
516 impl_stable_hash_for_spanned!(ast::Name);
519 impl_stable_hash_for!(enum hir::BlockCheckMode {
522 PushUnsafeBlock(src),
526 impl_stable_hash_for!(enum hir::UnsafeSource {
531 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Expr {
532 fn hash_stable<W: StableHasherResult>(&self,
533 hcx: &mut StableHashingContext<'a, 'tcx>,
534 hasher: &mut StableHasher<W>) {
535 hcx.while_hashing_hir_bodies(true, |hcx| {
543 let (spans_always_on, node_id_hashing_mode) = match *node {
554 hir::ExprClosure(..) |
556 hir::ExprAssign(..) |
557 hir::ExprTupField(..) |
558 hir::ExprAddrOf(..) |
562 hir::ExprInlineAsm(..) |
563 hir::ExprRepeat(..) |
564 hir::ExprTup(..) => {
565 // For these we only hash the span when debuginfo is on.
566 (false, NodeIdHashingMode::Ignore)
568 // For the following, spans might be significant because of
569 // panic messages indicating the source location.
570 hir::ExprBinary(op, ..) => {
571 (hcx.binop_can_panic_at_runtime(op.node), NodeIdHashingMode::Ignore)
573 hir::ExprUnary(op, _) => {
574 (hcx.unop_can_panic_at_runtime(op), NodeIdHashingMode::Ignore)
576 hir::ExprAssignOp(op, ..) => {
577 (hcx.binop_can_panic_at_runtime(op.node), NodeIdHashingMode::Ignore)
579 hir::ExprIndex(..) => {
580 (true, NodeIdHashingMode::Ignore)
582 // For these we don't care about the span, but want to hash the
584 hir::ExprMethodCall(..) |
586 hir::ExprStruct(..) |
587 hir::ExprField(..) => {
588 (false, NodeIdHashingMode::HashTraitsInScope)
592 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
593 id.hash_stable(hcx, hasher);
597 hcx.while_hashing_spans(true, |hcx| {
598 span.hash_stable(hcx, hasher);
599 node.hash_stable(hcx, hasher);
600 attrs.hash_stable(hcx, hasher);
603 span.hash_stable(hcx, hasher);
604 node.hash_stable(hcx, hasher);
605 attrs.hash_stable(hcx, hasher);
611 impl_stable_hash_for!(enum hir::Expr_ {
614 ExprCall(callee, args),
615 ExprMethodCall(name, ts, args),
617 ExprBinary(op, lhs, rhs),
618 ExprUnary(op, operand),
622 ExprIf(cond, then, els),
623 ExprWhile(cond, body, label),
624 ExprLoop(body, label, loop_src),
625 ExprMatch(matchee, arms, match_src),
626 ExprClosure(capture_clause, decl, body_id, span),
628 ExprAssign(lhs, rhs),
629 ExprAssignOp(op, lhs, rhs),
630 ExprField(owner, field_name),
631 ExprTupField(owner, idx),
634 ExprAddrOf(mutability, sub),
635 ExprBreak(destination, sub),
636 ExprAgain(destination),
638 ExprInlineAsm(asm, inputs, outputs),
639 ExprStruct(path, fields, base),
640 ExprRepeat(val, times)
643 impl_stable_hash_for!(enum hir::LoopSource {
649 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::MatchSource {
650 fn hash_stable<W: StableHasherResult>(&self,
651 hcx: &mut StableHashingContext<'a, 'tcx>,
652 hasher: &mut StableHasher<W>) {
653 use hir::MatchSource;
655 mem::discriminant(self).hash_stable(hcx, hasher);
657 MatchSource::Normal |
658 MatchSource::WhileLetDesugar |
659 MatchSource::ForLoopDesugar |
660 MatchSource::TryDesugar => {
661 // No fields to hash.
663 MatchSource::IfLetDesugar { contains_else_clause } => {
664 contains_else_clause.hash_stable(hcx, hasher);
670 impl_stable_hash_for!(enum hir::CaptureClause {
675 impl_stable_hash_for_spanned!(usize);
677 impl_stable_hash_for!(struct hir::Destination {
682 impl_stable_hash_for_spanned!(ast::Ident);
684 impl_stable_hash_for!(enum hir::LoopIdResult {
689 impl_stable_hash_for!(enum hir::LoopIdError {
691 UnlabeledCfInWhileCondition,
695 impl_stable_hash_for!(enum hir::ScopeTarget {
700 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ast::Ident {
701 fn hash_stable<W: StableHasherResult>(&self,
702 hcx: &mut StableHashingContext<'a, 'tcx>,
703 hasher: &mut StableHasher<W>) {
706 ctxt: _ // Ignore this
709 name.hash_stable(hcx, hasher);
713 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::TraitItem {
714 fn hash_stable<W: StableHasherResult>(&self,
715 hcx: &mut StableHashingContext<'a, 'tcx>,
716 hasher: &mut StableHasher<W>) {
725 hcx.hash_hir_item_like(attrs, |hcx| {
726 id.hash_stable(hcx, hasher);
727 name.hash_stable(hcx, hasher);
728 attrs.hash_stable(hcx, hasher);
729 node.hash_stable(hcx, hasher);
730 span.hash_stable(hcx, hasher);
735 impl_stable_hash_for!(enum hir::TraitMethod {
740 impl_stable_hash_for!(enum hir::TraitItemKind {
746 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::ImplItem {
747 fn hash_stable<W: StableHasherResult>(&self,
748 hcx: &mut StableHashingContext<'a, 'tcx>,
749 hasher: &mut StableHasher<W>) {
760 hcx.hash_hir_item_like(attrs, |hcx| {
761 id.hash_stable(hcx, hasher);
762 name.hash_stable(hcx, hasher);
763 vis.hash_stable(hcx, hasher);
764 defaultness.hash_stable(hcx, hasher);
765 attrs.hash_stable(hcx, hasher);
766 node.hash_stable(hcx, hasher);
767 span.hash_stable(hcx, hasher);
772 impl_stable_hash_for!(enum hir::ImplItemKind {
778 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Visibility {
779 fn hash_stable<W: StableHasherResult>(&self,
780 hcx: &mut StableHashingContext<'a, 'tcx>,
781 hasher: &mut StableHasher<W>) {
782 mem::discriminant(self).hash_stable(hcx, hasher);
784 hir::Visibility::Public |
785 hir::Visibility::Crate |
786 hir::Visibility::Inherited => {
787 // No fields to hash.
789 hir::Visibility::Restricted { ref path, id } => {
790 hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashTraitsInScope, |hcx| {
791 id.hash_stable(hcx, hasher);
793 path.hash_stable(hcx, hasher);
799 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Defaultness {
800 fn hash_stable<W: StableHasherResult>(&self,
801 hcx: &mut StableHashingContext<'a, 'tcx>,
802 hasher: &mut StableHasher<W>) {
803 mem::discriminant(self).hash_stable(hcx, hasher);
805 hir::Defaultness::Final => {
806 // No fields to hash.
808 hir::Defaultness::Default { has_value } => {
809 has_value.hash_stable(hcx, hasher);
815 impl_stable_hash_for!(enum hir::ImplPolarity {
820 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Mod {
821 fn hash_stable<W: StableHasherResult>(&self,
822 hcx: &mut StableHashingContext<'a, 'tcx>,
823 hasher: &mut StableHasher<W>) {
826 // We are not hashing the IDs of the items contained in the module.
827 // This is harmless and matches the current behavior but it's not
828 // actually correct. See issue #40876.
832 inner.hash_stable(hcx, hasher);
836 impl_stable_hash_for!(struct hir::ForeignMod {
841 impl_stable_hash_for!(struct hir::EnumDef {
845 impl_stable_hash_for!(struct hir::Variant_ {
852 impl_stable_hash_for_spanned!(hir::Variant_);
854 impl_stable_hash_for!(enum hir::UseKind {
860 impl_stable_hash_for!(struct hir::StructField {
869 impl_stable_hash_for!(enum hir::VariantData {
875 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::Item {
876 fn hash_stable<W: StableHasherResult>(&self,
877 hcx: &mut StableHashingContext<'a, 'tcx>,
878 hasher: &mut StableHasher<W>) {
879 let node_id_hashing_mode = match self.node {
880 hir::ItemExternCrate(..) |
881 hir::ItemStatic(..) |
885 hir::ItemForeignMod(..) |
886 hir::ItemGlobalAsm(..) |
889 hir::ItemStruct(..) |
892 hir::ItemDefaultImpl(..) |
893 hir::ItemImpl(..) => {
894 NodeIdHashingMode::Ignore
896 hir::ItemUse(..) => {
897 NodeIdHashingMode::HashTraitsInScope
910 hcx.hash_hir_item_like(attrs, |hcx| {
911 hcx.with_node_id_hashing_mode(node_id_hashing_mode, |hcx| {
912 id.hash_stable(hcx, hasher);
914 name.hash_stable(hcx, hasher);
915 attrs.hash_stable(hcx, hasher);
916 node.hash_stable(hcx, hasher);
917 vis.hash_stable(hcx, hasher);
918 span.hash_stable(hcx, hasher);
923 impl_stable_hash_for!(enum hir::Item_ {
924 ItemExternCrate(name),
925 ItemUse(path, use_kind),
926 ItemStatic(ty, mutability, body_id),
927 ItemConst(ty, body_id),
928 ItemFn(fn_decl, unsafety, constness, abi, generics, body_id),
930 ItemForeignMod(foreign_mod),
931 ItemGlobalAsm(global_asm),
932 ItemTy(ty, generics),
933 ItemEnum(enum_def, generics),
934 ItemStruct(variant_data, generics),
935 ItemUnion(variant_data, generics),
936 ItemTrait(unsafety, generics, bounds, item_refs),
937 ItemDefaultImpl(unsafety, trait_ref),
938 ItemImpl(unsafety, impl_polarity, impl_defaultness, generics, trait_ref, ty, impl_item_refs)
941 impl_stable_hash_for!(struct hir::TraitItemRef {
949 impl_stable_hash_for!(struct hir::ImplItemRef {
958 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::AssociatedItemKind {
959 fn hash_stable<W: StableHasherResult>(&self,
960 hcx: &mut StableHashingContext<'a, 'tcx>,
961 hasher: &mut StableHasher<W>) {
962 mem::discriminant(self).hash_stable(hcx, hasher);
964 hir::AssociatedItemKind::Const |
965 hir::AssociatedItemKind::Type => {
966 // No fields to hash.
968 hir::AssociatedItemKind::Method { has_self } => {
969 has_self.hash_stable(hcx, hasher);
975 impl_stable_hash_for!(struct hir::ForeignItem {
984 impl_stable_hash_for!(enum hir::ForeignItem_ {
985 ForeignItemFn(fn_decl, arg_names, generics),
986 ForeignItemStatic(ty, is_mutbl)
989 impl_stable_hash_for!(enum hir::Stmt_ {
995 impl_stable_hash_for!(struct hir::Arg {
1000 impl_stable_hash_for!(struct hir::Body {
1005 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::BodyId {
1006 fn hash_stable<W: StableHasherResult>(&self,
1007 hcx: &mut StableHashingContext<'a, 'tcx>,
1008 hasher: &mut StableHasher<W>) {
1009 if hcx.hash_bodies() {
1010 hcx.tcx().hir.body(*self).hash_stable(hcx, hasher);
1015 impl_stable_hash_for!(struct hir::InlineAsmOutput {
1021 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::GlobalAsm {
1022 fn hash_stable<W: StableHasherResult>(&self,
1023 hcx: &mut StableHashingContext<'a, 'tcx>,
1024 hasher: &mut StableHasher<W>) {
1025 let hir::GlobalAsm {
1030 asm.hash_stable(hcx, hasher);
1034 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::InlineAsm {
1035 fn hash_stable<W: StableHasherResult>(&self,
1036 hcx: &mut StableHashingContext<'a, 'tcx>,
1037 hasher: &mut StableHasher<W>) {
1038 let hir::InlineAsm {
1047 ctxt: _, // This is used for error reporting
1050 asm.hash_stable(hcx, hasher);
1051 asm_str_style.hash_stable(hcx, hasher);
1052 outputs.hash_stable(hcx, hasher);
1053 inputs.hash_stable(hcx, hasher);
1054 clobbers.hash_stable(hcx, hasher);
1055 volatile.hash_stable(hcx, hasher);
1056 alignstack.hash_stable(hcx, hasher);
1057 dialect.hash_stable(hcx, hasher);
1061 impl_stable_hash_for!(enum hir::def::CtorKind {
1067 impl_stable_hash_for!(enum hir::def::Def {
1075 AssociatedTy(def_id),
1078 SelfTy(trait_def_id, impl_def_id),
1081 Static(def_id, is_mutbl),
1082 StructCtor(def_id, ctor_kind),
1083 VariantCtor(def_id, ctor_kind),
1085 AssociatedConst(def_id),
1087 Upvar(def_id, index, expr_id),
1089 Macro(def_id, macro_kind),
1094 impl_stable_hash_for!(enum hir::Mutability {
1100 impl_stable_hash_for!(enum hir::Unsafety {
1106 impl_stable_hash_for!(enum hir::Constness {
1111 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for hir::def_id::DefIndex {
1113 fn hash_stable<W: StableHasherResult>(&self,
1114 hcx: &mut StableHashingContext<'a, 'tcx>,
1115 hasher: &mut StableHasher<W>) {
1116 DefId::local(*self).hash_stable(hcx, hasher);
1120 impl_stable_hash_for!(struct hir::def::Export {
1126 impl<'a, 'tcx> HashStable<StableHashingContext<'a, 'tcx>> for ::middle::lang_items::LangItem {
1127 fn hash_stable<W: StableHasherResult>(&self,
1128 _: &mut StableHashingContext<'a, 'tcx>,
1129 hasher: &mut StableHasher<W>) {
1130 ::std::hash::Hash::hash(self, hasher);