Workaround rustdoc not honouring cfg(parallel_compiler).

This commit is contained in:
Camille GILLOT 2021-02-19 21:48:47 +01:00
parent 4581d16bcb
commit 9823c2cc70
2 changed files with 6 additions and 5 deletions

View File

@ -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(

View File

@ -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(