Skip to content

Commit 2e1da95

Browse files
committed
Make coherence checking parallel
1 parent ad6af11 commit 2e1da95

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_errors::struct_span_err;
1213
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
1314
use rustc_hir::HirId;
@@ -140,9 +141,9 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) {
140141
}
141142

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

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

0 commit comments

Comments
 (0)