@@ -407,7 +407,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
407
407
let hir = tcx. hir ( ) ;
408
408
let body = hir. body ( hir. body_owned_by ( hir. local_def_id_to_hir_id ( def_id) ) ) ;
409
409
debug ! ( "visiting body for {:?}" , def_id) ;
410
+ tcx. sess . time ( "emit ignored resolution errors" , || {
410
411
EmitIgnoredResolutionErrors :: new ( tcx) . visit_body ( body) ;
412
+ } ) ;
411
413
( rustc_interface:: DEFAULT_QUERY_PROVIDERS . typeck ) ( tcx, def_id)
412
414
} ;
413
415
} ) ,
@@ -430,6 +432,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
430
432
// intra-doc-links
431
433
resolver. borrow_mut ( ) . access ( |resolver| {
432
434
for extern_name in & extern_names {
435
+ sess. time ( "load extern crate" , || {
433
436
resolver
434
437
. resolve_str_path_error (
435
438
DUMMY_SP ,
@@ -440,6 +443,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
440
443
. unwrap_or_else ( |( ) | {
441
444
panic ! ( "Unable to resolve external crate {}" , extern_name)
442
445
} ) ;
446
+ } ) ;
443
447
}
444
448
} ) ;
445
449
@@ -480,7 +484,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
480
484
tcx. ensure ( ) . check_mod_attrs ( local_def_id) ;
481
485
}
482
486
483
- let access_levels = tcx. privacy_access_levels ( LOCAL_CRATE ) ;
487
+ let access_levels = tcx
488
+ . sess
489
+ . time ( "privacy_access_levels" , || tcx. privacy_access_levels ( LOCAL_CRATE ) ) ;
484
490
// Convert from a HirId set to a DefId set since we don't always have easy access
485
491
// to the map from defid -> hirid
486
492
let access_levels = AccessLevels {
@@ -519,7 +525,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
519
525
} ;
520
526
debug ! ( "crate: {:?}" , tcx. hir( ) . krate( ) ) ;
521
527
522
- let mut krate = clean:: krate ( & mut ctxt) ;
528
+ let mut krate = tcx . sess . time ( " clean crate" , || clean :: krate ( & mut ctxt) ) ;
523
529
524
530
if let Some ( ref m) = krate. module {
525
531
if let None | Some ( "" ) = m. doc_value ( ) {
@@ -618,7 +624,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
618
624
} ;
619
625
if run {
620
626
debug ! ( "running pass {}" , p. pass. name) ;
621
- krate = ( p. pass . run ) ( krate, & ctxt) ;
627
+ krate = ctxt . tcx . sess . time ( p. pass . name , || ( p . pass . run ) ( krate, & ctxt) ) ;
622
628
}
623
629
}
624
630
0 commit comments