@@ -5,13 +5,18 @@ use rustc_driver::abort_on_err;
5
5
use rustc_errors:: emitter:: { Emitter , EmitterWriter } ;
6
6
use rustc_errors:: json:: JsonEmitter ;
7
7
use rustc_feature:: UnstableFeatures ;
8
- use rustc_hir:: def:: Namespace :: TypeNS ;
8
+ use rustc_hir:: def:: { Namespace :: TypeNS , Res } ;
9
9
use rustc_hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
10
10
use rustc_hir:: HirId ;
11
+ use rustc_hir:: {
12
+ intravisit:: { NestedVisitorMap , Visitor } ,
13
+ Path ,
14
+ } ;
11
15
use rustc_interface:: interface;
16
+ use rustc_middle:: hir:: map:: Map ;
12
17
use rustc_middle:: middle:: cstore:: CrateStore ;
13
18
use rustc_middle:: middle:: privacy:: AccessLevels ;
14
- use rustc_middle:: ty:: { Ty , TyCtxt } ;
19
+ use rustc_middle:: ty:: { self , Ty , TyCtxt } ;
15
20
use rustc_resolve as resolve;
16
21
use rustc_session:: config:: { self , CrateType , ErrorOutputType } ;
17
22
use rustc_session:: lint;
@@ -587,15 +592,8 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
587
592
} )
588
593
}
589
594
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 ( ) ;
599
597
rustc_typeck:: provide( & mut providers) ;
600
598
providers. typeck_tables_of
601
599
} ) ;
@@ -625,13 +623,11 @@ impl<'hir> Visitor<'hir> for EmitIgnoredResolutionErrors<'_, 'hir> {
625
623
}
626
624
627
625
fn visit_path ( & mut self , path : & ' v Path < ' v > , _id : HirId ) {
628
- log :: debug!( "visiting path {:?}" , path) ;
626
+ debug ! ( "visiting path {:?}" , path) ;
629
627
if path. res == Res :: Err {
630
628
// We have less context here than in rustc_resolve,
631
629
// so we can only emit the name and span.
632
630
// 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
635
631
let label = format ! (
636
632
"could not resolve path `{}`" ,
637
633
path. segments
0 commit comments