@@ -17,7 +17,7 @@ use rustc_ast as ast;
17
17
use rustc_ast_pretty:: pprust;
18
18
use rustc_data_structures:: {
19
19
fx:: FxIndexMap ,
20
- sync:: { par_for_each_in, Lock , Lrc } ,
20
+ sync:: { join , par_for_each_in, Lock , Lrc } ,
21
21
} ;
22
22
use rustc_errors:: { Diag , DiagMessage , LintDiagnostic , MultiSpan } ;
23
23
use rustc_feature:: { Features , GateIssue } ;
@@ -160,12 +160,9 @@ fn lint_expectations(tcx: TyCtxt<'_>, (): ()) -> Vec<(LintExpectationId, LintExp
160
160
/// of 1. The lints that will emit (or at least, should run), and 2.
161
161
/// The lints that are allowed at the crate level and will not emit.
162
162
pub fn lints_that_can_emit ( tcx : TyCtxt < ' _ > , ( ) : ( ) ) -> Lrc < ( Vec < Symbol > , Vec < Symbol > ) > {
163
- // builder.add_command_line();
164
- // builder.add_id(hir::CRATE_HIR_ID);
165
-
166
163
let mut visitor = LintLevelMinimum :: new ( tcx) ;
167
164
visitor. process_opts ( ) ;
168
- visitor. lint_level_minimums ( tcx ) ;
165
+ visitor. lint_level_minimums ( ) ;
169
166
170
167
Lrc :: new ( ( visitor. lints_to_emit . into_inner ( ) , visitor. lints_allowed . into_inner ( ) ) )
171
168
}
@@ -503,17 +500,25 @@ impl<'tcx> LintLevelMinimum<'tcx> {
503
500
}
504
501
}
505
502
506
- fn lint_level_minimums ( & mut self , tcx : TyCtxt < ' tcx > ) {
507
- tcx. sess . psess . lints_that_can_emit . with_lock ( |vec| {
508
- par_for_each_in ( vec, |lint_symbol| {
509
- self . lints_to_emit . with_lock ( |lints_to_emit| lints_to_emit. push ( * lint_symbol) ) ;
510
- } ) ;
511
- } ) ;
512
- tcx. sess . psess . lints_allowed . with_lock ( |vec| {
513
- par_for_each_in ( vec, |lint_symbol| {
514
- self . lints_allowed . with_lock ( |lints_allowed| lints_allowed. push ( * lint_symbol) ) ;
515
- } ) ;
516
- } ) ;
503
+ fn lint_level_minimums ( & mut self ) {
504
+ join (
505
+ || {
506
+ self . tcx . sess . psess . lints_that_can_emit . with_lock ( |vec| {
507
+ par_for_each_in ( vec, |lint_symbol| {
508
+ self . lints_to_emit
509
+ . with_lock ( |lints_to_emit| lints_to_emit. push ( * lint_symbol) ) ;
510
+ } ) ;
511
+ } ) ;
512
+ } ,
513
+ || {
514
+ self . tcx . sess . psess . lints_allowed . with_lock ( |vec| {
515
+ par_for_each_in ( vec, |lint_symbol| {
516
+ self . lints_allowed
517
+ . with_lock ( |lints_allowed| lints_allowed. push ( * lint_symbol) ) ;
518
+ } ) ;
519
+ } ) ;
520
+ } ,
521
+ ) ;
517
522
}
518
523
}
519
524
0 commit comments