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

@@ -737,9 +737,10 @@ impl<'a, 'tcx> SpanDecoder for CacheDecoder<'a, 'tcx> {
// If we get to this point, then all of the query inputs were green,
// which means that the definition with this hash is guaranteed to
// still exist in the current compilation session.
self.tcx.def_path_hash_to_def_id(def_path_hash, &mut || {
panic!("Failed to convert DefPathHash {def_path_hash:?}")
})
self.tcx.def_path_hash_to_def_id(
def_path_hash,
&("Failed to convert DefPathHash", def_path_hash),
)
}
fn decode_attr_id(&mut self) -> rustc_span::AttrId {