Skip to content

Commit cc29f96

Browse files
committed
Make coherence checking parallel
1 parent 14de109 commit cc29f96

File tree

1 file changed

+4
-4
lines changed
  • compiler/rustc_hir_analysis/src

1 file changed

+4
-4
lines changed

compiler/rustc_hir_analysis/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mod outlives;
9595
pub mod structured_errors;
9696
mod variance;
9797

98-
use rustc_data_structures::sync::join;
98+
use rustc_data_structures::sync::{join, par_for_each_in};
9999
use rustc_errors::ErrorGuaranteed;
100100
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
101101
use rustc_fluent_macro::fluent_messages;
@@ -215,9 +215,9 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
215215

216216
tcx.sess.track_errors(|| {
217217
tcx.sess.time("coherence_checking", || {
218-
for &trait_def_id in tcx.all_local_trait_impls(()).keys() {
219-
tcx.ensure().coherent_trait(trait_def_id);
220-
}
218+
par_for_each_in(tcx.all_local_trait_impls(()), |(trait_def_id, _)| {
219+
tcx.ensure().coherent_trait(*trait_def_id);
220+
});
221221

222222
// these queries are executed for side-effects (error reporting):
223223
tcx.ensure().crate_inherent_impls(());

0 commit comments

Comments
 (0)