OnDiskCache: avoid storing local def id hashes in foreign def id collection
This commit is contained in:
parent
7795801902
commit
55ae3b3a79
1 changed files with 4 additions and 2 deletions
|
@ -475,7 +475,7 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
}
|
||||
|
||||
/// If the given `dep_node`'s hash still exists in the current compilation,
|
||||
/// calls `store_foreign_def_id` with its current `DefId`.
|
||||
/// and its current `DefId` is foreign, calls `store_foreign_def_id` with it.
|
||||
///
|
||||
/// Normally, `store_foreign_def_id_hash` can be called directly by
|
||||
/// the dependency graph when we construct a `DepNode`. However,
|
||||
|
@ -497,7 +497,9 @@ impl<'sess> OnDiskCache<'sess> {
|
|||
// changed in the current compilation session (e.g. we've added/removed crates,
|
||||
// or added/removed definitions before/after the target definition).
|
||||
if let Some(def_id) = self.def_path_hash_to_def_id(tcx, hash) {
|
||||
self.store_foreign_def_id_hash(def_id, hash);
|
||||
if !def_id.is_local() {
|
||||
self.store_foreign_def_id_hash(def_id, hash);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue