File tree 1 file changed +4
-2
lines changed
compiler/rustc_middle/src/ty/query
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ impl<'sess> OnDiskCache<'sess> {
475
475
}
476
476
477
477
/// If the given `dep_node`'s hash still exists in the current compilation,
478
- /// calls `store_foreign_def_id` with its current `DefId` .
478
+ /// and its current `DefId` is foreign, calls `store_foreign_def_id` with it .
479
479
///
480
480
/// Normally, `store_foreign_def_id_hash` can be called directly by
481
481
/// the dependency graph when we construct a `DepNode`. However,
@@ -497,7 +497,9 @@ impl<'sess> OnDiskCache<'sess> {
497
497
// changed in the current compilation session (e.g. we've added/removed crates,
498
498
// or added/removed definitions before/after the target definition).
499
499
if let Some ( def_id) = self . def_path_hash_to_def_id ( tcx, hash) {
500
- self . store_foreign_def_id_hash ( def_id, hash) ;
500
+ if !def_id. is_local ( ) {
501
+ self . store_foreign_def_id_hash ( def_id, hash) ;
502
+ }
501
503
}
502
504
}
503
505
}
You can’t perform that action at this time.
0 commit comments