about summary refs log tree commit diff
path: root/compiler/rustc_query_impl
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-04-22 07:02:27 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2025-04-29 07:20:13 +0200
commitcff9efde748b6027fe9f135ddd5aaf8a3276601d (patch)
tree8d6877af6e5f512fd0b7615ddb25632516dad48f /compiler/rustc_query_impl
parent25cdf1f67463c9365d8d83778c933ec7480e940b (diff)
downloadrust-cff9efde748b6027fe9f135ddd5aaf8a3276601d.tar.gz
rust-cff9efde748b6027fe9f135ddd5aaf8a3276601d.zip
Add a jobserver proxy to ensure at least one token is always held
Diffstat (limited to 'compiler/rustc_query_impl')
-rw-r--r--compiler/rustc_query_impl/src/plumbing.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs
index 19ccc5587d6..ea37dc5489b 100644
--- a/compiler/rustc_query_impl/src/plumbing.rs
+++ b/compiler/rustc_query_impl/src/plumbing.rs
@@ -4,6 +4,7 @@
 
 use std::num::NonZero;
 
+use rustc_data_structures::jobserver::Proxy;
 use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
 use rustc_data_structures::sync::{DynSend, DynSync};
 use rustc_data_structures::unord::UnordMap;
@@ -70,6 +71,11 @@ impl<'tcx> QueryContext for QueryCtxt<'tcx> {
     type QueryInfo = QueryStackDeferred<'tcx>;
 
     #[inline]
+    fn jobserver_proxy(&self) -> &Proxy {
+        &*self.jobserver_proxy
+    }
+
+    #[inline]
     fn next_job_id(self) -> QueryJobId {
         QueryJobId(
             NonZero::new(self.query_system.jobs.fetch_add(1, std::sync::atomic::Ordering::Relaxed))