Skip to content

Commit 5fc8987

Browse files
authored
Rollup merge of #84777 - jyn514:rustdoc-parallel, r=Mark-Simulacrum
Apply `--cfg parallel_compiler` when documenting This also reverts commit 9823c2c working around the bug. Fixes #82301.
2 parents 79e50bf + 1da4445 commit 5fc8987

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ macro_rules! define_callbacks {
232232
}
233233

234234
pub trait QueryEngine<'tcx>: rustc_data_structures::sync::Sync {
235+
#[cfg(parallel_compiler)]
235236
unsafe fn deadlock(&'tcx self, tcx: TyCtxt<'tcx>, registry: &rustc_rayon_core::Registry);
236237

237238
fn encode_query_results(

compiler/rustc_query_impl/src/plumbing.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,10 @@ macro_rules! define_queries_struct {
550550
}
551551

552552
impl QueryEngine<'tcx> for Queries<'tcx> {
553-
unsafe fn deadlock(&'tcx self, _tcx: TyCtxt<'tcx>, _registry: &rustc_rayon_core::Registry) {
554-
#[cfg(parallel_compiler)]
555-
{
556-
let tcx = QueryCtxt { tcx: _tcx, queries: self };
557-
rustc_query_system::query::deadlock(tcx, _registry)
558-
}
553+
#[cfg(parallel_compiler)]
554+
unsafe fn deadlock(&'tcx self, tcx: TyCtxt<'tcx>, registry: &rustc_rayon_core::Registry) {
555+
let tcx = QueryCtxt { tcx, queries: self };
556+
rustc_query_system::query::deadlock(tcx, registry)
559557
}
560558

561559
fn encode_query_results(

src/bootstrap/compile.rs

+1
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ pub fn rustc_cargo_env(builder: &Builder<'_>, cargo: &mut Cargo, target: TargetS
648648
}
649649
if builder.config.rustc_parallel {
650650
cargo.rustflag("--cfg=parallel_compiler");
651+
cargo.rustdocflag("--cfg=parallel_compiler");
651652
}
652653
if builder.config.rust_verify_llvm_ir {
653654
cargo.env("RUSTC_VERIFY_LLVM_IR", "1");

0 commit comments

Comments
 (0)