@@ -436,24 +436,32 @@ pub fn check_crate<'tcx, T: LateLintPass<'tcx> + 'tcx>(
436
436
tcx : TyCtxt < ' tcx > ,
437
437
builtin_lints : impl FnOnce ( ) -> T + Send + DynSend ,
438
438
) {
439
- join (
440
- || {
441
- tcx. sess . time ( "crate_lints" , || {
442
- // Run whole crate non-incremental lints
443
- late_lint_crate ( tcx, builtin_lints ( ) ) ;
444
- } ) ;
445
- } ,
446
- || {
447
- tcx. sess . time ( "module_lints" , || {
448
- let has_cache = tcx. query_system . on_disk_cache . as_ref ( ) . map ( |cache| cache. has_cache ( ) ) . unwrap_or ( false ) ;
449
-
450
- // Run per-module lints
451
- if has_cache {
452
- tcx. hir ( ) . for_each_module ( |module| tcx. ensure ( ) . lint_mod ( module) ) ;
453
- } else {
439
+ let has_cache =
440
+ tcx. query_system . on_disk_cache . as_ref ( ) . map ( |cache| cache. has_cache ( ) ) . unwrap_or ( false ) ;
441
+
442
+ if has_cache {
443
+ tcx. sess . time ( "crate_lints" , || {
444
+ // Run whole crate non-incremental lints
445
+ late_lint_crate ( tcx, builtin_lints ( ) ) ;
446
+ } ) ;
447
+
448
+ tcx. sess . time ( "module_lints" , || {
449
+ // Run per-module lints
450
+ tcx. hir ( ) . for_each_module ( |module| tcx. ensure ( ) . lint_mod ( module) ) ;
451
+ } ) ;
452
+ } else {
453
+ join (
454
+ || {
455
+ tcx. sess . time ( "crate_lints" , || {
456
+ // Run whole crate non-incremental lints
457
+ late_lint_crate ( tcx, builtin_lints ( ) ) ;
458
+ } ) ;
459
+ } ,
460
+ || {
461
+ tcx. sess . time ( "module_lints" , || {
454
462
tcx. hir ( ) . par_for_each_module ( |module| tcx. ensure ( ) . lint_mod ( module) ) ;
455
- }
456
- } ) ;
457
- } ,
458
- ) ;
463
+ } ) ;
464
+ } ,
465
+ ) ;
466
+ }
459
467
}
0 commit comments