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) {
142
142
}
143
143
144
144
pub 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
+ ) ;
155
166
}
156
167
157
168
/// 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;
75
75
#[ macro_use]
76
76
extern crate rustc;
77
77
78
+ #[ macro_use]
79
+ extern crate rustc_data_structures;
80
+
78
81
// This is used by Clippy.
79
82
pub mod expr_use_visitor;
80
83
You can’t perform that action at this time.
0 commit comments