about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/middle
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2021-07-20 14:18:37 +0200
committerMichael Woerister <michaelwoerister@posteo>2021-09-14 13:56:33 +0200
commit2b60338ee92fbae7e9414dd1bd6661ccd8a7b9da (patch)
tree216ec1bf1acf3a44da1cff6f545c0c903cedfc4b /compiler/rustc_middle/src/middle
parent5445715c20dbedbe9b14d185937ab1ebcd81118e (diff)
Make DefPathHash->DefId panic for if the mapping fails.
We only use this mapping for cases where we know that it must succeed.
Letting it panic otherwise makes it harder to use the API in unsupported
ways.
Diffstat (limited to 'compiler/rustc_middle/src/middle')
-rw-r--r--compiler/rustc_middle/src/middle/cstore.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/middle/cstore.rs b/compiler/rustc_middle/src/middle/cstore.rs
index b66260c5de3..81c44b27033 100644
--- a/compiler/rustc_middle/src/middle/cstore.rs
+++ b/compiler/rustc_middle/src/middle/cstore.rs
@@ -202,7 +202,7 @@ pub trait CrateStore: std::fmt::Debug {
     fn stable_crate_id_to_crate_num(&self, stable_crate_id: StableCrateId) -> CrateNum;
 
     /// Fetch a DefId from a DefPathHash for a foreign crate.
-    fn def_path_hash_to_def_id(&self, cnum: CrateNum, hash: DefPathHash) -> Option<DefId>;
+    fn def_path_hash_to_def_id(&self, cnum: CrateNum, hash: DefPathHash) -> DefId;
     fn expn_hash_to_expn_id(&self, cnum: CrateNum, index_guess: u32, hash: ExpnHash) -> ExpnId;
 
     // utility functions