@@ -32,7 +32,7 @@ use std::rc::Rc;
32
32
33
33
use crate :: clean;
34
34
use crate :: clean:: { AttributesExt , MAX_DEF_ID } ;
35
- use crate :: config:: RenderInfo ;
35
+ use crate :: config:: { RenderInfo , OutputFormat } ;
36
36
use crate :: config:: { Options as RustdocOptions , RenderOptions } ;
37
37
use crate :: passes:: { self , Condition :: * , ConditionalPass } ;
38
38
@@ -299,8 +299,8 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
299
299
lint_opts,
300
300
describe_lints,
301
301
lint_cap,
302
- mut default_passes,
303
- mut manual_passes,
302
+ default_passes,
303
+ manual_passes,
304
304
display_warnings,
305
305
render_options,
306
306
output_format,
@@ -457,7 +457,14 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
457
457
458
458
let mut global_ctxt = abort_on_err ( queries. global_ctxt ( ) , sess) . take ( ) ;
459
459
460
- global_ctxt. enter ( |tcx| {
460
+ global_ctxt. enter ( |tcx| run_global_ctxt ( tcx, resolver, default_passes, manual_passes, render_options, output_format) )
461
+ } )
462
+ } )
463
+ }
464
+
465
+ fn run_global_ctxt ( tcx : TyCtxt < ' _ > , resolver : Rc < RefCell < interface:: BoxedResolver > > ,
466
+ mut default_passes : passes:: DefaultPassOption , mut manual_passes : Vec < String > ,
467
+ render_options : RenderOptions , output_format : Option < OutputFormat > ) -> ( clean:: Crate , RenderInfo , RenderOptions ) {
461
468
// Certain queries assume that some checks were run elsewhere
462
469
// (see https://github.com/rust-lang/rust/pull/73566#issuecomment-656954425),
463
470
// so type-check everything other than function bodies in this crate before running lints.
@@ -476,13 +483,15 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
476
483
}
477
484
} ) ;
478
485
tcx. sess . abort_if_errors ( ) ;
479
- sess. time ( "missing_docs" , || {
486
+ tcx . sess . time ( "missing_docs" , || {
480
487
rustc_lint:: check_crate ( tcx, rustc_lint:: builtin:: MissingDoc :: new) ;
481
488
} ) ;
489
+ tcx. sess . time ( "check_mod_attrs" , || {
482
490
for & module in tcx. hir ( ) . krate ( ) . modules . keys ( ) {
483
491
let local_def_id = tcx. hir ( ) . local_def_id ( module) ;
484
492
tcx. ensure ( ) . check_mod_attrs ( local_def_id) ;
485
493
}
494
+ } ) ;
486
495
487
496
let access_levels = tcx. privacy_access_levels ( LOCAL_CRATE ) ;
488
497
// Convert from a HirId set to a DefId set since we don't always have easy access
@@ -629,9 +638,6 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
629
638
ctxt. sess ( ) . abort_if_errors ( ) ;
630
639
631
640
( krate, ctxt. renderinfo . into_inner ( ) , ctxt. render_options )
632
- } )
633
- } )
634
- } )
635
641
}
636
642
637
643
/// Due to https://github.com/rust-lang/rust/pull/73566,
0 commit comments