Skip to content

Commit 9d888ea

Browse files
committed
Rename await into cycle_error for the single threaded case and add some comments
1 parent 8e53ecf commit 9d888ea

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/librustc/ty/query/job.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ impl<'tcx> QueryJob<'tcx> {
9191
#[cfg(not(parallel_queries))]
9292
#[inline(never)]
9393
#[cold]
94-
pub(super) fn await<'lcx, 'a, D: QueryDescription<'tcx>>(
94+
pub(super) fn cycle_error<'lcx, 'a, D: QueryDescription<'tcx>>(
9595
&self,
9696
tcx: TyCtxt<'_, 'tcx, 'lcx>,
9797
span: Span,

src/librustc/ty/query/plumbing.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,13 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> {
153153
};
154154
mem::drop(lock);
155155

156+
// If we are single-threaded we know that we have cycle error,
157+
// so we just turn the errror
156158
#[cfg(not(parallel_queries))]
157-
return job.await(tcx, span);
159+
return job.cycle_error(tcx, span);
158160

161+
// With parallel queries we might just have to wait on some other
162+
// thread
159163
#[cfg(parallel_queries)]
160164
{
161165
if let Err(cycle) = job.await(tcx, span) {

0 commit comments

Comments
 (0)