diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2022-01-19 17:36:44 -0500 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2022-01-19 17:36:44 -0500 |
| commit | 70d36a05bc79667578a3c7b2b4926e21a9a5d013 (patch) | |
| tree | b990459b91653577c32e4b3c9ab1cfa762650eea /compiler/rustc_query_impl | |
| parent | 5e57faa78aa7661c6000204591558f6665f11abc (diff) | |
| download | rust-70d36a05bc79667578a3c7b2b4926e21a9a5d013.tar.gz rust-70d36a05bc79667578a3c7b2b4926e21a9a5d013.zip | |
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.
Diffstat (limited to 'compiler/rustc_query_impl')
| -rw-r--r-- | compiler/rustc_query_impl/src/on_disk_cache.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_query_impl/src/on_disk_cache.rs b/compiler/rustc_query_impl/src/on_disk_cache.rs index 6a88e123537..5f6d9b050b2 100644 --- a/compiler/rustc_query_impl/src/on_disk_cache.rs +++ b/compiler/rustc_query_impl/src/on_disk_cache.rs @@ -761,7 +761,9 @@ impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for DefId { // If we get to this point, then all of the query inputs were green, // which means that the definition with this hash is guaranteed to // still exist in the current compilation session. - Ok(d.tcx().def_path_hash_to_def_id(def_path_hash)) + Ok(d.tcx().def_path_hash_to_def_id(def_path_hash, &mut || { + panic!("Failed to convert DefPathHash {:?}", def_path_hash) + })) } } |
