Don't rely on Debug impl for Erased

This commit is contained in:
John Kåre Alsaker 2023-03-26 11:00:26 +02:00
parent 785459d630
commit 36b4199a8e
7 changed files with 33 additions and 23 deletions

View file

@ -486,6 +486,11 @@ macro_rules! define_queries {
stringify!($name)
}
#[inline]
fn format_value(self) -> fn(&Self::Value) -> String {
|value| format!("{:?}", restore::<query_values::$name<'tcx>>(*value))
}
#[inline]
fn cache_on_disk(self, tcx: TyCtxt<'tcx>, key: &Self::Key) -> bool {
::rustc_middle::query::cached::$name(tcx, key)
@ -819,7 +824,7 @@ macro_rules! define_queries_struct {
$($(#[$attr])*
#[inline(always)]
#[tracing::instrument(level = "trace", skip(self, tcx), ret)]
#[tracing::instrument(level = "trace", skip(self, tcx))]
fn $name(
&'tcx self,
tcx: TyCtxt<'tcx>,