@@ -326,25 +326,28 @@ macro_rules! late_lint_pass_impl {
326
326
327
327
crate :: late_lint_methods!( late_lint_pass_impl, [ ] , [ ' tcx] ) ;
328
328
329
- fn late_lint_mod_pass < ' tcx , T : LateLintPass < ' tcx > > (
329
+ pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > + ' tcx > (
330
330
tcx : TyCtxt < ' tcx > ,
331
331
module_def_id : LocalDefId ,
332
- pass : T ,
332
+ builtin_lints : T ,
333
333
) {
334
- let effective_visibilities = & tcx. effective_visibilities ( ( ) ) ;
335
-
336
334
let context = LateContext {
337
335
tcx,
338
336
enclosing_body : None ,
339
337
cached_typeck_results : Cell :: new ( None ) ,
340
338
param_env : ty:: ParamEnv :: empty ( ) ,
341
- effective_visibilities,
339
+ effective_visibilities : & tcx . effective_visibilities ( ( ) ) ,
342
340
lint_store : unerased_lint_store ( tcx) ,
343
341
last_node_with_lint_attrs : tcx. hir ( ) . local_def_id_to_hir_id ( module_def_id) ,
344
342
generics : None ,
345
343
only_module : true ,
346
344
} ;
347
345
346
+ let mut passes: Vec < _ > =
347
+ unerased_lint_store ( tcx) . late_module_passes . iter ( ) . map ( |pass| ( pass) ( tcx) ) . collect ( ) ;
348
+ passes. push ( Box :: new ( builtin_lints) ) ;
349
+ let pass = LateLintPassObjects { lints : & mut passes[ ..] } ;
350
+
348
351
let mut cx = LateContextAndPass { context, pass } ;
349
352
350
353
let ( module, _span, hir_id) = tcx. hir ( ) . get_module ( module_def_id) ;
@@ -358,18 +361,6 @@ fn late_lint_mod_pass<'tcx, T: LateLintPass<'tcx>>(
358
361
}
359
362
}
360
363
361
- pub fn late_lint_mod < ' tcx , T : LateLintPass < ' tcx > + ' tcx > (
362
- tcx : TyCtxt < ' tcx > ,
363
- module_def_id : LocalDefId ,
364
- builtin_lints : T ,
365
- ) {
366
- let mut passes: Vec < _ > =
367
- unerased_lint_store ( tcx) . late_module_passes . iter ( ) . map ( |pass| ( pass) ( tcx) ) . collect ( ) ;
368
- passes. push ( Box :: new ( builtin_lints) ) ;
369
-
370
- late_lint_mod_pass ( tcx, module_def_id, LateLintPassObjects { lints : & mut passes[ ..] } ) ;
371
- }
372
-
373
364
fn late_lint_pass_crate < ' tcx , T : LateLintPass < ' tcx > > ( tcx : TyCtxt < ' tcx > , pass : T ) {
374
365
let effective_visibilities = & tcx. effective_visibilities ( ( ) ) ;
375
366
0 commit comments