Skip to content

Commit d7a2352

Browse files
committed
Replace beack_query_cycles implementation with new
1 parent 0028f34 commit d7a2352

3 files changed

Lines changed: 87 additions & 268 deletions

File tree

compiler/rustc_middle/src/query/job.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ impl<'tcx> QueryJob<'tcx> {
7373
pub struct QueryWaiter<'tcx> {
7474
pub query: Option<QueryJobId>,
7575
pub condvar: Condvar,
76-
pub span: Span,
7776
pub cycle: Mutex<Option<CycleError<QueryStackDeferred<'tcx>>>>,
7877
}
7978

@@ -100,10 +99,9 @@ impl<'tcx> QueryLatch<'tcx> {
10099
&self,
101100
tcx: TyCtxt<'tcx>,
102101
query: Option<QueryJobId>,
103-
span: Span,
104102
) -> Result<(), CycleError<QueryStackDeferred<'tcx>>> {
105103
let waiter =
106-
Arc::new(QueryWaiter { query, span, cycle: Mutex::new(None), condvar: Condvar::new() });
104+
Arc::new(QueryWaiter { query, cycle: Mutex::new(None), condvar: Condvar::new() });
107105
self.wait_on_inner(tcx, &waiter);
108106
// FIXME: Get rid of this lock. We have ownership of the QueryWaiter
109107
// although another thread may still have a Arc reference so we cannot

compiler/rustc_query_impl/src/execution.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ fn cycle_error<'tcx, C: QueryCache>(
228228
fn wait_for_query<'tcx, C: QueryCache>(
229229
query: &'tcx QueryVTable<'tcx, C>,
230230
tcx: TyCtxt<'tcx>,
231-
span: Span,
232231
key: C::Key,
233232
latch: QueryLatch<'tcx>,
234233
current: Option<QueryJobId>,
@@ -240,7 +239,7 @@ fn wait_for_query<'tcx, C: QueryCache>(
240239

241240
// With parallel queries we might just have to wait on some other
242241
// thread.
243-
let result = latch.wait_on(tcx, current, span);
242+
let result = latch.wait_on(tcx, current);
244243

245244
match result {
246245
Ok(()) => {
@@ -320,7 +319,7 @@ fn try_execute_query<'tcx, C: QueryCache, const INCR: bool>(
320319

321320
// Only call `wait_for_query` if we're using a Rayon thread pool
322321
// as it will attempt to mark the worker thread as blocked.
323-
return wait_for_query(query, tcx, span, key, latch, current_job_id);
322+
return wait_for_query(query, tcx, key, latch, current_job_id);
324323
}
325324

326325
let id = job.id;

0 commit comments

Comments
 (0)