Skip to content

Commit 6283565

Browse files
committed
Make coherence checking parallel
1 parent 6b67617 commit 6283565

File tree

1 file changed

+3
-2
lines changed
  • src/librustc_typeck/coherence

1 file changed

+3
-2
lines changed

src/librustc_typeck/coherence/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use rustc::traits;
99
use rustc::ty::query::Providers;
1010
use rustc::ty::{self, TyCtxt, TypeFoldable};
11+
use rustc_data_structures::sync::par_for_each;
1112
use rustc_error_codes::*;
1213
use rustc_errors::struct_span_err;
1314
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
@@ -141,9 +142,9 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) {
141142
}
142143

143144
pub fn check_coherence(tcx: TyCtxt<'_>) {
144-
for &trait_def_id in tcx.hir().krate().trait_impls.keys() {
145+
par_for_each(&tcx.hir().krate().trait_impls, |(&trait_def_id, _)| {
145146
tcx.ensure().coherent_trait(trait_def_id);
146-
}
147+
});
147148

148149
tcx.sess.time("unsafety_checking", || unsafety::check(tcx));
149150
tcx.sess.time("orphan_checking", || orphan::check(tcx));

0 commit comments

Comments
 (0)