Skip to content

Commit 11f0569

Browse files
committed
Inline and remove expect_job.
It has a single call site.
1 parent bd2e224 commit 11f0569

1 file changed

Lines changed: 4 additions & 13 deletions

File tree

compiler/rustc_query_impl/src/execution.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,6 @@ fn equivalent_key<K: Eq, V>(k: &K) -> impl Fn(&(K, V)) -> bool + '_ {
2626
move |x| x.0 == *k
2727
}
2828

29-
/// Obtains the enclosed [`QueryJob`], or panics if this query evaluation
30-
/// was poisoned by a panic.
31-
fn expect_job<'tcx>(status: ActiveKeyStatus<'tcx>) -> QueryJob<'tcx> {
32-
match status {
33-
ActiveKeyStatus::Started(job) => job,
34-
ActiveKeyStatus::Poisoned => {
35-
panic!("job for query failed to start and was poisoned")
36-
}
37-
}
38-
}
39-
4029
pub(crate) fn all_inactive<'tcx, K>(state: &QueryState<'tcx, K>) -> bool {
4130
state.active.lock_shards().all(|shard| shard.is_empty())
4231
}
@@ -187,8 +176,10 @@ where
187176
}
188177
};
189178
// Also signal the completion of the job, so waiters will continue execution.
190-
let job = expect_job(status);
191-
job.signal_complete();
179+
match status {
180+
ActiveKeyStatus::Started(job) => job.signal_complete(),
181+
ActiveKeyStatus::Poisoned => panic!(),
182+
}
192183
}
193184
}
194185

0 commit comments

Comments
 (0)