diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-11 17:17:32 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-12-17 08:53:02 +0100 |
| commit | 9d888eadc53d42621a4e43ff3ea481f45d99c1a5 (patch) | |
| tree | ac8919209ec5afa3b29f3cf9b0a7880fb76b309e | |
| parent | 8e53ecff6ccc57e339a39a2241676f91224df062 (diff) | |
| download | rust-9d888eadc53d42621a4e43ff3ea481f45d99c1a5.tar.gz rust-9d888eadc53d42621a4e43ff3ea481f45d99c1a5.zip | |
Rename await into cycle_error for the single threaded case and add some comments
| -rw-r--r-- | src/librustc/ty/query/job.rs | 2 | ||||
| -rw-r--r-- | src/librustc/ty/query/plumbing.rs | 6 |
2 files changed, 6 insertions, 2 deletions
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 @@ impl<'tcx> QueryJob<'tcx> { #[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 @@ impl<'a, 'tcx, Q: QueryDescription<'tcx>> JobOwner<'a, 'tcx, Q> { }; 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) { |
