File tree Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Expand file tree Collapse file tree 2 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -142,16 +142,27 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) {
142142}
143143
144144pub fn check_coherence ( tcx : TyCtxt < ' _ > ) {
145- par_for_each ( & tcx. hir ( ) . krate ( ) . trait_impls , |( & trait_def_id, _) | {
146- tcx. ensure ( ) . coherent_trait ( trait_def_id) ;
147- } ) ;
148-
149- tcx. sess . time ( "unsafety_checking" , || unsafety:: check ( tcx) ) ;
150- tcx. sess . time ( "orphan_checking" , || orphan:: check ( tcx) ) ;
151-
152- // these queries are executed for side-effects (error reporting):
153- tcx. ensure ( ) . crate_inherent_impls ( LOCAL_CRATE ) ;
154- tcx. ensure ( ) . crate_inherent_impls_overlap_check ( LOCAL_CRATE ) ;
145+ parallel ! (
146+ {
147+ par_for_each( & tcx. hir( ) . krate( ) . trait_impls, |( & trait_def_id, _) | {
148+ tcx. ensure( ) . coherent_trait( trait_def_id) ;
149+ } ) ;
150+ } ,
151+ {
152+ tcx. sess. time( "unsafety_checking" , || unsafety:: check( tcx) ) ;
153+ } ,
154+ {
155+ tcx. sess. time( "orphan_checking" , || orphan:: check( tcx) ) ;
156+ } ,
157+ {
158+ // This query is executed for side-effects (error reporting)
159+ tcx. ensure( ) . crate_inherent_impls( LOCAL_CRATE ) ;
160+ } ,
161+ {
162+ // This query is executed for side-effects (error reporting)
163+ tcx. ensure( ) . crate_inherent_impls_overlap_check( LOCAL_CRATE ) ;
164+ }
165+ ) ;
155166}
156167
157168/// Overlap: no two impls for the same trait are implemented for the
Original file line number Diff line number Diff line change @@ -75,6 +75,9 @@ extern crate log;
7575#[ macro_use]
7676extern crate rustc;
7777
78+ #[ macro_use]
79+ extern crate rustc_data_structures;
80+
7881// This is used by Clippy.
7982pub mod expr_use_visitor;
8083
You can’t perform that action at this time.
0 commit comments