diff --git a/src/librustc/ty/query/job.rs b/src/librustc/ty/query/job.rs index 994a80fe4cd..6e513d68f60 100644 --- a/src/librustc/ty/query/job.rs +++ b/src/librustc/ty/query/job.rs @@ -91,7 +91,7 @@ pub fn new(info: QueryInfo<'tcx>, parent: Option>>) -> 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, diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 157e0fba9de..0929628ac81 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -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) {