Show a more informative panic message when DefPathHash
does not exist
This should hopefully make it easier to debug incremental compilation bugs like #93096 without affecting performance.
This commit is contained in:
parent
5e57faa78a
commit
70d36a05bc
4 changed files with 17 additions and 6 deletions
|
@ -266,7 +266,9 @@ impl DepNodeExt for DepNode {
|
|||
/// has been removed.
|
||||
fn extract_def_id<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Option<DefId> {
|
||||
if self.kind.fingerprint_style(tcx) == FingerprintStyle::DefPathHash {
|
||||
Some(tcx.def_path_hash_to_def_id(DefPathHash(self.hash.into())))
|
||||
Some(tcx.def_path_hash_to_def_id(DefPathHash(self.hash.into()), &mut || {
|
||||
panic!("Failed to extract DefId: {:?} {}", self.kind, self.hash)
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue