Skip to content

Commit 5875d7b

Browse files
committed
"Reset" the hashing context before stable hashing the types
1 parent 8b0440a commit 5875d7b

File tree

1 file changed

+6
-2
lines changed
  • compiler/rustc_middle/src/ty

1 file changed

+6
-2
lines changed

compiler/rustc_middle/src/ty/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ use rustc_ast as ast;
3131
use rustc_attr as attr;
3232
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
3333
use rustc_data_structures::intern::Interned;
34-
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
34+
use rustc_data_structures::stable_hasher::{HashStable, NodeIdHashingMode, StableHasher};
3535
use rustc_data_structures::tagged_ptr::CopyTaggedPtr;
3636
use rustc_hir as hir;
3737
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
@@ -471,7 +471,11 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Ty<'tcx> {
471471

472472
let stable_hash: Fingerprint = {
473473
let mut hasher = StableHasher::new();
474-
kind.hash_stable(hcx, &mut hasher);
474+
hcx.while_hashing_spans(false, |hcx| {
475+
hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
476+
kind.hash_stable(hcx, &mut hasher)
477+
})
478+
});
475479
hasher.finish()
476480
};
477481
stable_hash.hash_stable(hcx, hasher);

0 commit comments

Comments
 (0)