Skip to content

Commit

Permalink
Workaround rustdoc not honouring cfg(parallel_compiler).
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Feb 19, 2021
1 parent 4581d16 commit 9823c2c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion compiler/rustc_middle/src/ty/query/mod.rs
Expand Up @@ -230,7 +230,6 @@ macro_rules! define_callbacks {
}

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

fn encode_query_results(
Expand Down
10 changes: 6 additions & 4 deletions compiler/rustc_query_impl/src/plumbing.rs
Expand Up @@ -631,10 +631,12 @@ macro_rules! define_queries_struct {
}

impl QueryEngine<'tcx> for Queries<'tcx> {
#[cfg(parallel_compiler)]
unsafe fn deadlock(&'tcx self, tcx: TyCtxt<'tcx>, registry: &rustc_rayon_core::Registry) {
let tcx = QueryCtxt { tcx, queries: self };
rustc_query_system::query::deadlock(tcx, registry)
unsafe fn deadlock(&'tcx self, _tcx: TyCtxt<'tcx>, _registry: &rustc_rayon_core::Registry) {
#[cfg(parallel_compiler)]
{
let tcx = QueryCtxt { tcx: _tcx, queries: self };
rustc_query_system::query::deadlock(tcx, _registry)
}
}

fn encode_query_results(
Expand Down

0 comments on commit 9823c2c

Please sign in to comment.