diff options
| author | Li-yao Xia <lysxia@gmail.com> | 2025-09-26 18:14:31 +0200 |
|---|---|---|
| committer | Li-yao Xia <lysxia@gmail.com> | 2025-09-26 18:36:15 +0200 |
| commit | c0e0d4b68d38a92c19f42d3003074b5b6e7b65c8 (patch) | |
| tree | aa2083005cf1430f404ee6cd3fb3bb473cd5ef56 /compiler/rustc_middle/src/ty | |
| parent | a8858111044a9391ac7558f969d3bf62ef43222d (diff) | |
Make `def_path_hash_to_def_id` not panic when passed an invalid hash
Diffstat (limited to 'compiler/rustc_middle/src/ty')
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 7d3e2c9965d..a961e04cf79 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -2012,7 +2012,7 @@ impl<'tcx> TyCtxt<'tcx> { if stable_crate_id == self.stable_crate_id(LOCAL_CRATE) { Some(self.untracked.definitions.read().local_def_path_hash_to_def_id(hash)?.to_def_id()) } else { - Some(self.def_path_hash_to_def_id_extern(hash, stable_crate_id)) + self.def_path_hash_to_def_id_extern(hash, stable_crate_id) } } |
