Rename await into cycle_error for the single threaded case and add some comments

This commit is contained in:
John Kåre Alsaker 2018-12-11 17:17:32 +01:00
parent 8e53ecff6c
commit 9d888eadc5
2 changed files with 6 additions and 2 deletions

View File

@ -91,7 +91,7 @@ pub fn new(info: QueryInfo<'tcx>, parent: Option<Lrc<QueryJob<'tcx>>>) -> Self {
#[cfg(not(parallel_queries))]
#[inline(never)]
#[cold]
pub(super) fn await<'lcx, 'a, D: QueryDescription<'tcx>>(
pub(super) fn cycle_error<'lcx, 'a, D: QueryDescription<'tcx>>(
&self,
tcx: TyCtxt<'_, 'tcx, 'lcx>,
span: Span,

View File

@ -153,9 +153,13 @@ pub(super) fn try_get(
};
mem::drop(lock);
// If we are single-threaded we know that we have cycle error,
// so we just turn the errror
#[cfg(not(parallel_queries))]
return job.await(tcx, span);
return job.cycle_error(tcx, span);
// With parallel queries we might just have to wait on some other
// thread
#[cfg(parallel_queries)]
{
if let Err(cycle) = job.await(tcx, span) {