@@ -407,7 +407,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
407407 let hir = tcx. hir ( ) ;
408408 let body = hir. body ( hir. body_owned_by ( hir. local_def_id_to_hir_id ( def_id) ) ) ;
409409 debug ! ( "visiting body for {:?}" , def_id) ;
410+ tcx. sess . time ( "emit ignored resolution errors" , || {
410411 EmitIgnoredResolutionErrors :: new ( tcx) . visit_body ( body) ;
412+ } ) ;
411413 ( rustc_interface:: DEFAULT_QUERY_PROVIDERS . typeck ) ( tcx, def_id)
412414 } ;
413415 } ) ,
@@ -430,6 +432,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
430432 // intra-doc-links
431433 resolver. borrow_mut ( ) . access ( |resolver| {
432434 for extern_name in & extern_names {
435+ sess. time ( "load extern crate" , || {
433436 resolver
434437 . resolve_str_path_error (
435438 DUMMY_SP ,
@@ -440,6 +443,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
440443 . unwrap_or_else ( |( ) | {
441444 panic ! ( "Unable to resolve external crate {}" , extern_name)
442445 } ) ;
446+ } ) ;
443447 }
444448 } ) ;
445449
@@ -480,7 +484,9 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
480484 tcx. ensure ( ) . check_mod_attrs ( local_def_id) ;
481485 }
482486
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 ) ) ;
484490 // Convert from a HirId set to a DefId set since we don't always have easy access
485491 // to the map from defid -> hirid
486492 let access_levels = AccessLevels {
@@ -519,7 +525,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
519525 } ;
520526 debug ! ( "crate: {:?}" , tcx. hir( ) . krate( ) ) ;
521527
522- let mut krate = clean:: krate ( & mut ctxt) ;
528+ let mut krate = tcx . sess . time ( " clean crate" , || clean :: krate ( & mut ctxt) ) ;
523529
524530 if let Some ( ref m) = krate. module {
525531 if let None | Some ( "" ) = m. doc_value ( ) {
@@ -618,7 +624,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
618624 } ;
619625 if run {
620626 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) ) ;
622628 }
623629 }
624630
0 commit comments