@@ -32,8 +32,8 @@ 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 , OutputFormat } ;
36
35
use crate :: config:: { Options as RustdocOptions , RenderOptions } ;
36
+ use crate :: config:: { OutputFormat , RenderInfo } ;
37
37
use crate :: passes:: { self , Condition :: * , ConditionalPass } ;
38
38
39
39
pub use rustc_session:: config:: { CodegenOptions , DebuggingOptions , Input , Options } ;
@@ -457,14 +457,30 @@ 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
- sess. time ( "run_global_ctxt" , || global_ctxt. enter ( |tcx| run_global_ctxt ( tcx, resolver, default_passes, manual_passes, render_options, output_format) ) )
460
+ sess. time ( "run_global_ctxt" , || {
461
+ global_ctxt. enter ( |tcx| {
462
+ run_global_ctxt (
463
+ tcx,
464
+ resolver,
465
+ default_passes,
466
+ manual_passes,
467
+ render_options,
468
+ output_format,
469
+ )
470
+ } )
471
+ } )
461
472
} )
462
473
} )
463
474
}
464
475
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 ) {
476
+ fn run_global_ctxt (
477
+ tcx : TyCtxt < ' _ > ,
478
+ resolver : Rc < RefCell < interface:: BoxedResolver > > ,
479
+ mut default_passes : passes:: DefaultPassOption ,
480
+ mut manual_passes : Vec < String > ,
481
+ render_options : RenderOptions ,
482
+ output_format : Option < OutputFormat > ,
483
+ ) -> ( clean:: Crate , RenderInfo , RenderOptions ) {
468
484
// Certain queries assume that some checks were run elsewhere
469
485
// (see https://github.com/rust-lang/rust/pull/73566#issuecomment-656954425),
470
486
// so type-check everything other than function bodies in this crate before running lints.
@@ -543,9 +559,8 @@ fn run_global_ctxt(tcx: TyCtxt<'_>, resolver: Rc<RefCell<interface::BoxedResolve
543
559
rustc_lint:: builtin:: MISSING_CRATE_LEVEL_DOCS ,
544
560
ctxt. as_local_hir_id ( m. def_id ) . unwrap ( ) ,
545
561
|lint| {
546
- let mut diag = lint. build (
547
- "no documentation found for this crate's top-level module" ,
548
- ) ;
562
+ let mut diag =
563
+ lint. build ( "no documentation found for this crate's top-level module" ) ;
549
564
diag. help ( help) ;
550
565
diag. emit ( ) ;
551
566
} ,
@@ -554,10 +569,8 @@ fn run_global_ctxt(tcx: TyCtxt<'_>, resolver: Rc<RefCell<interface::BoxedResolve
554
569
}
555
570
556
571
fn report_deprecated_attr ( name : & str , diag : & rustc_errors:: Handler ) {
557
- let mut msg = diag. struct_warn ( & format ! (
558
- "the `#![doc({})]` attribute is considered deprecated" ,
559
- name
560
- ) ) ;
572
+ let mut msg = diag
573
+ . struct_warn ( & format ! ( "the `#![doc({})]` attribute is considered deprecated" , name) ) ;
561
574
msg. warn (
562
575
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
563
576
for more information",
0 commit comments