1
Fork 0

Use a dyn Debug trait object instead of a closure.

Simplifies the API a bit.
This commit is contained in:
Oli Scherer 2024-03-27 08:05:24 +00:00
parent b13a71a2e7
commit 2d4b7f287d
4 changed files with 24 additions and 13 deletions

View file

@ -380,14 +380,14 @@ impl Definitions {
pub fn local_def_path_hash_to_def_id(
&self,
hash: DefPathHash,
err: &mut dyn FnMut() -> !,
err_msg: &dyn std::fmt::Debug,
) -> LocalDefId {
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
self.table
.def_path_hash_to_index
.get(&hash.local_hash())
.map(|local_def_index| LocalDefId { local_def_index })
.unwrap_or_else(|| err())
.unwrap_or_else(|| panic!("{err_msg:?}"))
}
pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap {