about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/hooks/mod.rs
diff options
context:
space:
mode:
authorLi-yao Xia <lysxia@gmail.com>2025-09-26 18:14:31 +0200
committerLi-yao Xia <lysxia@gmail.com>2025-09-26 18:36:15 +0200
commitc0e0d4b68d38a92c19f42d3003074b5b6e7b65c8 (patch)
treeaa2083005cf1430f404ee6cd3fb3bb473cd5ef56 /compiler/rustc_middle/src/hooks/mod.rs
parenta8858111044a9391ac7558f969d3bf62ef43222d (diff)
downloadrust-c0e0d4b68d38a92c19f42d3003074b5b6e7b65c8.tar.gz
rust-c0e0d4b68d38a92c19f42d3003074b5b6e7b65c8.zip
Make `def_path_hash_to_def_id` not panic when passed an invalid hash
Diffstat (limited to 'compiler/rustc_middle/src/hooks/mod.rs')
-rw-r--r--compiler/rustc_middle/src/hooks/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/hooks/mod.rs b/compiler/rustc_middle/src/hooks/mod.rs
index 9d2f0a45237..dc6a3334a4c 100644
--- a/compiler/rustc_middle/src/hooks/mod.rs
+++ b/compiler/rustc_middle/src/hooks/mod.rs
@@ -77,7 +77,7 @@ declare_hooks! {
     /// session, if it still exists. This is used during incremental compilation to
     /// turn a deserialized `DefPathHash` into its current `DefId`.
     /// Will fetch a DefId from a DefPathHash for a foreign crate.
-    hook def_path_hash_to_def_id_extern(hash: DefPathHash, stable_crate_id: StableCrateId) -> DefId;
+    hook def_path_hash_to_def_id_extern(hash: DefPathHash, stable_crate_id: StableCrateId) -> Option<DefId>;
 
     /// Returns `true` if we should codegen an instance in the local crate, or returns `false` if we
     /// can just link to the upstream crate and therefore don't need a mono item.