@@ -5,13 +5,18 @@ use rustc_driver::abort_on_err;
55use rustc_errors:: emitter:: { Emitter , EmitterWriter } ;
66use rustc_errors:: json:: JsonEmitter ;
77use rustc_feature:: UnstableFeatures ;
8- use rustc_hir:: def:: Namespace :: TypeNS ;
8+ use rustc_hir:: def:: { Namespace :: TypeNS , Res } ;
99use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
1010use rustc_hir:: HirId ;
11+ use rustc_hir:: {
12+ intravisit:: { NestedVisitorMap , Visitor } ,
13+ Path ,
14+ } ;
1115use rustc_interface:: interface;
16+ use rustc_middle:: hir:: map:: Map ;
1217use rustc_middle:: middle:: cstore:: CrateStore ;
1318use rustc_middle:: middle:: privacy:: AccessLevels ;
14- use rustc_middle:: ty:: { Ty , TyCtxt } ;
19+ use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
1520use rustc_resolve as resolve;
1621use rustc_session:: config:: { self , CrateType , ErrorOutputType } ;
1722use rustc_session:: lint;
@@ -587,15 +592,8 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
587592 } )
588593}
589594
590- use rustc_hir:: def:: Res ;
591- use rustc_hir:: {
592- intravisit:: { NestedVisitorMap , Visitor } ,
593- Path ,
594- } ;
595- use rustc_middle:: hir:: map:: Map ;
596-
597- thread_local ! ( static DEFAULT_TYPECK : for <' tcx> fn ( rustc_middle:: ty:: TyCtxt <' tcx>, rustc_span:: def_id:: LocalDefId ) -> & ' tcx rustc_middle:: ty:: TypeckTables <' tcx> = {
598- let mut providers = rustc_middle:: ty:: query:: Providers :: default ( ) ;
595+ thread_local ! ( static DEFAULT_TYPECK : for <' tcx> fn ( TyCtxt <' tcx>, LocalDefId ) -> & ' tcx ty:: TypeckTables <' tcx> = {
596+ let mut providers = ty:: query:: Providers :: default ( ) ;
599597 rustc_typeck:: provide( & mut providers) ;
600598 providers. typeck_tables_of
601599} ) ;
@@ -625,13 +623,11 @@ impl<'hir> Visitor<'hir> for EmitIgnoredResolutionErrors<'_, 'hir> {
625623 }
626624
627625 fn visit_path ( & mut self , path : & ' v Path < ' v > , _id : HirId ) {
628- log :: debug!( "visiting path {:?}" , path) ;
626+ debug ! ( "visiting path {:?}" , path) ;
629627 if path. res == Res :: Err {
630628 // We have less context here than in rustc_resolve,
631629 // so we can only emit the name and span.
632630 // However we can give a hint that rustc_resolve will have more info.
633- // NOTE: this is a very rare case (only 4 out of several hundred thousand crates in a crater run)
634- // NOTE: so it's ok for it to be slow
635631 let label = format ! (
636632 "could not resolve path `{}`" ,
637633 path. segments
0 commit comments