Skip to content

Commit 9823c2c

Browse files
committed
Workaround rustdoc not honouring cfg(parallel_compiler).
1 parent 4581d16 commit 9823c2c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

compiler/rustc_middle/src/ty/query/mod.rs

-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ macro_rules! define_callbacks {
230230
}
231231

232232
pub trait QueryEngine<'tcx>: rustc_data_structures::sync::Sync {
233-
#[cfg(parallel_compiler)]
234233
unsafe fn deadlock(&'tcx self, tcx: TyCtxt<'tcx>, registry: &rustc_rayon_core::Registry);
235234

236235
fn encode_query_results(

compiler/rustc_query_impl/src/plumbing.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -631,10 +631,12 @@ macro_rules! define_queries_struct {
631631
}
632632

633633
impl QueryEngine<'tcx> for Queries<'tcx> {
634-
#[cfg(parallel_compiler)]
635-
unsafe fn deadlock(&'tcx self, tcx: TyCtxt<'tcx>, registry: &rustc_rayon_core::Registry) {
636-
let tcx = QueryCtxt { tcx, queries: self };
637-
rustc_query_system::query::deadlock(tcx, registry)
634+
unsafe fn deadlock(&'tcx self, _tcx: TyCtxt<'tcx>, _registry: &rustc_rayon_core::Registry) {
635+
#[cfg(parallel_compiler)]
636+
{
637+
let tcx = QueryCtxt { tcx: _tcx, queries: self };
638+
rustc_query_system::query::deadlock(tcx, _registry)
639+
}
638640
}
639641

640642
fn encode_query_results(

0 commit comments

Comments
 (0)