Try explicitly outlining the panic machinery
This commit is contained in:
parent
2d4b7f287d
commit
0dca136841
1 changed files with 6 additions and 1 deletions
|
@ -383,11 +383,16 @@ impl Definitions {
|
||||||
err_msg: &dyn std::fmt::Debug,
|
err_msg: &dyn std::fmt::Debug,
|
||||||
) -> LocalDefId {
|
) -> LocalDefId {
|
||||||
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
|
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
|
||||||
|
#[cold]
|
||||||
|
#[inline(never)]
|
||||||
|
fn err(err_msg: &dyn std::fmt::Debug) -> ! {
|
||||||
|
panic!("{err_msg:?}")
|
||||||
|
}
|
||||||
self.table
|
self.table
|
||||||
.def_path_hash_to_index
|
.def_path_hash_to_index
|
||||||
.get(&hash.local_hash())
|
.get(&hash.local_hash())
|
||||||
.map(|local_def_index| LocalDefId { local_def_index })
|
.map(|local_def_index| LocalDefId { local_def_index })
|
||||||
.unwrap_or_else(|| panic!("{err_msg:?}"))
|
.unwrap_or_else(|| err(err_msg))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap {
|
pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue