We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d4b7f2 commit 0dca136Copy full SHA for 0dca136
compiler/rustc_hir/src/definitions.rs
@@ -383,11 +383,16 @@ impl Definitions {
383
err_msg: &dyn std::fmt::Debug,
384
) -> LocalDefId {
385
debug_assert!(hash.stable_crate_id() == self.table.stable_crate_id);
386
+ #[cold]
387
+ #[inline(never)]
388
+ fn err(err_msg: &dyn std::fmt::Debug) -> ! {
389
+ panic!("{err_msg:?}")
390
+ }
391
self.table
392
.def_path_hash_to_index
393
.get(&hash.local_hash())
394
.map(|local_def_index| LocalDefId { local_def_index })
- .unwrap_or_else(|| panic!("{err_msg:?}"))
395
+ .unwrap_or_else(|| err(err_msg))
396
}
397
398
pub fn def_path_hash_to_def_index_map(&self) -> &DefPathHashMap {
0 commit comments