Skip to content

Commit ab976a4

Browse files
committed
Only inherit local hash for paths.
1 parent 90d0d70 commit ab976a4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/rustc_hir/src/definitions.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ impl DefKey {
124124
pub(crate) fn compute_stable_hash(&self, parent: DefPathHash) -> DefPathHash {
125125
let mut hasher = StableHasher::new();
126126

127-
parent.hash(&mut hasher);
127+
// The new path is in the same crate as `parent`, and will contain the stable_crate_id.
128+
// Therefore, we only need to include information of the parent's local hash.
129+
parent.local_hash().hash(&mut hasher);
128130

129131
let DisambiguatedDefPathData { ref data, disambiguator } = self.disambiguated_data;
130132

0 commit comments

Comments
 (0)