@@ -358,19 +358,16 @@ fn late_lint_mod_pass<'tcx, T: LateLintPass<'tcx>>(
358
358
}
359
359
}
360
360
361
- pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > > (
361
+ pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > + ' tcx > (
362
362
tcx : TyCtxt < ' tcx > ,
363
363
module_def_id : LocalDefId ,
364
364
builtin_lints : T ,
365
365
) {
366
- late_lint_mod_pass ( tcx, module_def_id, builtin_lints) ;
367
-
368
366
let mut passes: Vec < _ > =
369
367
unerased_lint_store ( tcx) . late_module_passes . iter ( ) . map ( |pass| ( pass) ( tcx) ) . collect ( ) ;
368
+ passes. push ( Box :: new ( builtin_lints) ) ;
370
369
371
- if !passes. is_empty ( ) {
372
- late_lint_mod_pass ( tcx, module_def_id, LateLintPassObjects { lints : & mut passes[ ..] } ) ;
373
- }
370
+ late_lint_mod_pass ( tcx, module_def_id, LateLintPassObjects { lints : & mut passes[ ..] } ) ;
374
371
}
375
372
376
373
fn late_lint_pass_crate < ' tcx , T : LateLintPass < ' tcx > > ( tcx : TyCtxt < ' tcx > , pass : T ) {
@@ -401,19 +398,16 @@ fn late_lint_pass_crate<'tcx, T: LateLintPass<'tcx>>(tcx: TyCtxt<'tcx>, pass: T)
401
398
} )
402
399
}
403
400
404
- fn late_lint_crate < ' tcx , T : LateLintPass < ' tcx > > ( tcx : TyCtxt < ' tcx > , builtin_lints : T ) {
401
+ fn late_lint_crate < ' tcx , T : LateLintPass < ' tcx > + ' tcx > ( tcx : TyCtxt < ' tcx > , builtin_lints : T ) {
405
402
let mut passes =
406
403
unerased_lint_store ( tcx) . late_passes . iter ( ) . map ( |p| ( p) ( tcx) ) . collect :: < Vec < _ > > ( ) ;
404
+ passes. push ( Box :: new ( builtin_lints) ) ;
407
405
408
- if !passes. is_empty ( ) {
409
- late_lint_pass_crate ( tcx, LateLintPassObjects { lints : & mut passes[ ..] } ) ;
410
- }
411
-
412
- late_lint_pass_crate ( tcx, builtin_lints) ;
406
+ late_lint_pass_crate ( tcx, LateLintPassObjects { lints : & mut passes[ ..] } ) ;
413
407
}
414
408
415
409
/// Performs lint checking on a crate.
416
- pub fn check_crate < ' tcx , T : LateLintPass < ' tcx > > (
410
+ pub fn check_crate < ' tcx , T : LateLintPass < ' tcx > + ' tcx > (
417
411
tcx : TyCtxt < ' tcx > ,
418
412
builtin_lints : impl FnOnce ( ) -> T + Send ,
419
413
) {
0 commit comments