Skip to content

Commit 8e39ab6

Browse files
committed
Move job.complete out of force_query_with_job.
1 parent bb3b209 commit 8e39ab6

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

+13-14
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,8 @@ where
411411
return v;
412412
}
413413
};
414-
return force_query_with_job(tcx, key, job, *dep_node, query).0;
414+
let (result, dep_node_index) = force_query_with_job(tcx, key, job.id, *dep_node, query);
415+
return job.complete(result, dep_node_index);
415416
};
416417

417418
let job = match job {
@@ -428,7 +429,8 @@ where
428429
// expensive for some `DepKind`s.
429430
if !tcx.dep_graph().is_fully_enabled() {
430431
let null_dep_node = DepNode::new_no_params(DepKind::NULL);
431-
return force_query_with_job(tcx, key, job, null_dep_node, query).0;
432+
let (result, dep_node_index) = force_query_with_job(tcx, key, job.id, null_dep_node, query);
433+
return job.complete(result, dep_node_index);
432434
}
433435

434436
if query.anon {
@@ -478,7 +480,8 @@ where
478480
}
479481
}
480482

481-
let (result, dep_node_index) = force_query_with_job(tcx, key, job, dep_node, query);
483+
let (result, dep_node_index) = force_query_with_job(tcx, key, job.id, dep_node, query);
484+
let result = job.complete(result, dep_node_index);
482485
tcx.dep_graph().read_index(dep_node_index);
483486
result
484487
}
@@ -572,17 +575,15 @@ fn incremental_verify_ich<CTX, K, V>(
572575
}
573576

574577
#[inline(always)]
575-
fn force_query_with_job<C, CTX>(
578+
fn force_query_with_job<CTX, K, V>(
576579
tcx: CTX,
577-
key: C::Key,
578-
job: JobOwner<'_, CTX, C>,
580+
key: K,
581+
job_id: QueryJobId<CTX::DepKind>,
579582
dep_node: DepNode<CTX::DepKind>,
580-
query: &QueryVtable<CTX, C::Key, C::Value>,
581-
) -> (C::Stored, DepNodeIndex)
583+
query: &QueryVtable<CTX, K, V>,
584+
) -> (V, DepNodeIndex)
582585
where
583-
C: QueryCache,
584-
C::Key: Eq + Clone + Debug,
585-
C::Stored: Clone,
586+
K: Eq + Clone + Debug,
586587
CTX: QueryContext,
587588
{
588589
// If the following assertion triggers, it can have two reasons:
@@ -602,7 +603,7 @@ where
602603
let prof_timer = tcx.profiler().query_provider();
603604

604605
let ((result, dep_node_index), diagnostics) = with_diagnostics(|diagnostics| {
605-
tcx.start_query(job.id, diagnostics, |tcx| {
606+
tcx.start_query(job_id, diagnostics, |tcx| {
606607
if query.eval_always {
607608
tcx.dep_graph().with_eval_always_task(
608609
dep_node,
@@ -625,8 +626,6 @@ where
625626
}
626627
}
627628

628-
let result = job.complete(result, dep_node_index);
629-
630629
(result, dep_node_index)
631630
}
632631

0 commit comments

Comments
 (0)