Skip to content

Commit f466828

Browse files
committed
Replace beack_query_cycles implementation with new
1 parent 1d02e90 commit f466828

File tree

3 files changed

+136
-267
lines changed

3 files changed

+136
-267
lines changed

compiler/rustc_middle/src/query/job.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub struct QueryInclusion {
8080
pub struct QueryWaiter<'tcx> {
8181
pub query: Option<QueryInclusion>,
8282
pub condvar: Condvar,
83-
pub span: Span,
8483
pub cycle: Mutex<Option<CycleError<QueryStackDeferred<'tcx>>>>,
8584
}
8685

@@ -107,10 +106,9 @@ impl<'tcx> QueryLatch<'tcx> {
107106
&self,
108107
tcx: TyCtxt<'tcx>,
109108
query: Option<QueryInclusion>,
110-
span: Span,
111109
) -> Result<(), CycleError<QueryStackDeferred<'tcx>>> {
112110
let waiter =
113-
Arc::new(QueryWaiter { query, span, cycle: Mutex::new(None), condvar: Condvar::new() });
111+
Arc::new(QueryWaiter { query, cycle: Mutex::new(None), condvar: Condvar::new() });
114112
self.wait_on_inner(tcx, &waiter);
115113
// FIXME: Get rid of this lock. We have ownership of the QueryWaiter
116114
// 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
@@ -229,7 +229,6 @@ fn cycle_error<'tcx, C: QueryCache>(
229229
fn wait_for_query<'tcx, C: QueryCache>(
230230
query: &'tcx QueryVTable<'tcx, C>,
231231
tcx: TyCtxt<'tcx>,
232-
span: Span,
233232
key: C::Key,
234233
latch: QueryLatch<'tcx>,
235234
current: Option<QueryInclusion>,
@@ -241,7 +240,7 @@ fn wait_for_query<'tcx, C: QueryCache>(
241240

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

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

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

327326
let id = job.id;

0 commit comments

Comments
 (0)