- fn force_query<Q: QueryDescription<Self>>(
- self,
- key: Q::Key,
- span: Span,
- dep_node: DepNode<Self::DepKind>,
- ) {
- // We may be concurrently trying both execute and force a query.
- // Ensure that only one of them runs the query.
-
- try_get_cached(
- self,
- Q::query_state(self),
- key,
- |_, _| {
- // Cache hit, do nothing
- },
- |key, lookup| {
- let job = match JobOwner::try_start::<Q>(self, span, &key, lookup) {
- TryGetJob::NotYetStarted(job) => job,
- TryGetJob::Cycle(_) => return,
- #[cfg(parallel_compiler)]
- TryGetJob::JobCompleted(_) => return,
- };
- force_query_with_job::<Q, _>(self, key, job, dep_node);
- },
- );
- }
+pub fn force_query<Q, CTX>(tcx: CTX, key: Q::Key, span: Span, dep_node: DepNode<CTX::DepKind>)
+where
+ Q: QueryDescription<CTX>,
+ CTX: QueryContext,
+{
+ // We may be concurrently trying both execute and force a query.
+ // Ensure that only one of them runs the query.
+
+ try_get_cached(
+ tcx,
+ Q::query_state(tcx),
+ key,
+ |_, _| {
+ // Cache hit, do nothing
+ },
+ |key, lookup| {
+ let job = match JobOwner::try_start::<Q>(tcx, span, &key, lookup) {
+ TryGetJob::NotYetStarted(job) => job,
+ TryGetJob::Cycle(_) => return,
+ #[cfg(parallel_compiler)]
+ TryGetJob::JobCompleted(_) => return,
+ };
+ force_query_with_job::<Q, _>(tcx, key, job, dep_node);
+ },
+ );