@@ -358,19 +358,16 @@ fn late_lint_mod_pass<'tcx, T: LateLintPass<'tcx>>(
358358 }
359359}
360360
361- pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > > (
361+ pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > + ' tcx > (
362362 tcx : TyCtxt < ' tcx > ,
363363 module_def_id : LocalDefId ,
364364 builtin_lints : T ,
365365) {
366- late_lint_mod_pass ( tcx, module_def_id, builtin_lints) ;
367-
368366 let mut passes: Vec < _ > =
369367 unerased_lint_store ( tcx) . late_module_passes . iter ( ) . map ( |pass| ( pass) ( tcx) ) . collect ( ) ;
368+ passes. push ( Box :: new ( builtin_lints) ) ;
370369
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[ ..] } ) ;
374371}
375372
376373fn 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)
401398 } )
402399}
403400
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 ) {
405402 let mut passes =
406403 unerased_lint_store ( tcx) . late_passes . iter ( ) . map ( |p| ( p) ( tcx) ) . collect :: < Vec < _ > > ( ) ;
404+ passes. push ( Box :: new ( builtin_lints) ) ;
407405
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[ ..] } ) ;
413407}
414408
415409/// 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 > (
417411 tcx : TyCtxt < ' tcx > ,
418412 builtin_lints : impl FnOnce ( ) -> T + Send ,
419413) {
0 commit comments