Skip to content

Commit 5fa60a5

Browse files
committed
Reduce calls to current_query_job
1 parent f0bc76a commit 5fa60a5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/rustc_query_system/src/query/plumbing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,12 @@ where
188188
#[cfg(not(parallel_compiler))]
189189
let mut state_lock = state.active.lock();
190190
let lock = &mut *state_lock;
191+
let current_job_id = qcx.current_query_job();
191192

192193
match lock.entry(key) {
193194
Entry::Vacant(entry) => {
194195
let id = qcx.next_job_id();
195-
let job = qcx.current_query_job();
196-
let job = QueryJob::new(id, span, job);
196+
let job = QueryJob::new(id, span, current_job_id);
197197

198198
let key = *entry.key();
199199
entry.insert(QueryResult::Started(job));
@@ -212,7 +212,7 @@ where
212212
// so we just return the error.
213213
return TryGetJob::Cycle(id.find_cycle_in_stack(
214214
qcx.try_collect_active_jobs().unwrap(),
215-
&qcx.current_query_job(),
215+
&current_job_id,
216216
span,
217217
));
218218
}
@@ -230,7 +230,7 @@ where
230230

231231
// With parallel queries we might just have to wait on some other
232232
// thread.
233-
let result = latch.wait_on(qcx.current_query_job(), span);
233+
let result = latch.wait_on(current_job_id, span);
234234

235235
match result {
236236
Ok(()) => TryGetJob::JobCompleted(query_blocked_prof_timer),

0 commit comments

Comments
 (0)