Skip to content

Commit 01d15b4

Browse files
Allow to disable auto and blanket trait impls retrieval in rustdoc if it is in parallel_compiler mode
1 parent 56ee852 commit 01d15b4

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/librustdoc/clean/utils.rs

+17-11
Original file line numberDiff line numberDiff line change
@@ -475,17 +475,23 @@ pub(crate) fn get_auto_trait_and_blanket_impls(
475475
cx: &mut DocContext<'_>,
476476
item_def_id: DefId,
477477
) -> impl Iterator<Item = Item> {
478-
let auto_impls = cx
479-
.sess()
480-
.prof
481-
.generic_activity("get_auto_trait_impls")
482-
.run(|| AutoTraitFinder::new(cx).get_auto_trait_impls(item_def_id));
483-
let blanket_impls = cx
484-
.sess()
485-
.prof
486-
.generic_activity("get_blanket_impls")
487-
.run(|| BlanketImplFinder { cx }.get_blanket_impls(item_def_id));
488-
auto_impls.into_iter().chain(blanket_impls)
478+
// FIXME: To be removed once `parallel_compiler` bugs are fixed!
479+
// More information in <https://github.com/rust-lang/rust/pull/106745>.
480+
if !cfg!(parallel_compiler) {
481+
let auto_impls = cx
482+
.sess()
483+
.prof
484+
.generic_activity("get_auto_trait_impls")
485+
.run(|| AutoTraitFinder::new(cx).get_auto_trait_impls(item_def_id));
486+
let blanket_impls = cx
487+
.sess()
488+
.prof
489+
.generic_activity("get_blanket_impls")
490+
.run(|| BlanketImplFinder { cx }.get_blanket_impls(item_def_id));
491+
auto_impls.into_iter().chain(blanket_impls)
492+
} else {
493+
vec![].into_iter().chain(vec![].into_iter())
494+
}
489495
}
490496

491497
/// If `res` has a documentation page associated, store it in the cache.

0 commit comments

Comments
 (0)