Skip to content

Commit e6be98a

Browse files
committed
Make coherence checking parallel
1 parent f07365d commit e6be98a

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;
@@ -191,9 +191,9 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
191191

192192
tcx.sess.track_errors(|| {
193193
tcx.sess.time("coherence_checking", || {
194-
for &trait_def_id in tcx.all_local_trait_impls(()).keys() {
195-
tcx.ensure().coherent_trait(trait_def_id);
196-
}
194+
par_for_each_in(tcx.all_local_trait_impls(()), |(trait_def_id, _)| {
195+
tcx.ensure().coherent_trait(*trait_def_id);
196+
});
197197

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

0 commit comments

Comments
 (0)