Opacify query invocation.

This commit is contained in:
Camille GILLOT 2021-01-17 14:58:34 +01:00
parent 2db2776589
commit 3f868b1791

View File

@ -450,8 +450,7 @@ pub fn $name(self, key: query_helper_param_ty!($($K)*)) {
Err(lookup) => lookup,
};
let qcx = QueryCtxt(self.tcx);
get_query::<queries::$name<'_>, _>(qcx, DUMMY_SP, key, lookup, QueryMode::Ensure);
self.tcx.queries.$name(self.tcx, DUMMY_SP, key, lookup, QueryMode::Ensure);
})*
}
@ -542,8 +541,7 @@ pub fn $name(self, key: query_helper_param_ty!($($K)*)) -> query_stored::$name<$
Err(lookup) => lookup,
};
let qcx = QueryCtxt(self.tcx);
get_query::<queries::$name<'_>, _>(qcx, self.span, key, lookup, QueryMode::Get).unwrap()
self.tcx.queries.$name(self.tcx, self.span, key, lookup, QueryMode::Get).unwrap()
})*
}
@ -598,6 +596,20 @@ pub(crate) fn try_collect_active_jobs(
Some(jobs)
}
$($(#[$attr])*
#[inline(always)]
fn $name(
&self,
tcx: TyCtxt<$tcx>,
span: Span,
key: query_keys::$name<$tcx>,
lookup: QueryLookup,
mode: QueryMode,
) -> Option<query_stored::$name<$tcx>> {
let qcx = QueryCtxt(tcx);
get_query::<queries::$name<$tcx>, _>(qcx, span, key, lookup, mode)
})*
}
};
}