@@ -392,7 +392,7 @@ pub fn run_core(options: RustdocOptions) -> (clean::Crate, RenderInfo, RenderOpt
392
392
let hir = tcx. hir ( ) ;
393
393
let body = hir. body ( hir. body_owned_by ( hir. as_local_hir_id ( def_id) ) ) ;
394
394
debug ! ( "visiting body for {:?}" , def_id) ;
395
- EmitIgnoredResolutionErrors :: new ( & tcx. sess , hir ) . visit_body ( body) ;
395
+ EmitIgnoredResolutionErrors :: new ( & tcx) . visit_body ( body) ;
396
396
DEFAULT_TYPECK . with ( |typeck| typeck ( tcx, def_id) )
397
397
} ;
398
398
} ) ,
@@ -602,27 +602,26 @@ thread_local!(static DEFAULT_TYPECK: for<'tcx> fn(TyCtxt<'tcx>, LocalDefId) -> &
602
602
/// the name resolution pass may find errors that are never emitted.
603
603
/// If typeck is called after this happens, then we'll get an ICE:
604
604
/// 'Res::Error found but not reported'. To avoid this, emit the errors now.
605
- struct EmitIgnoredResolutionErrors < ' a , ' hir > {
606
- session : & ' a Session ,
607
- hir_map : Map < ' hir > ,
605
+ struct EmitIgnoredResolutionErrors < ' a , ' tcx > {
606
+ tcx : & ' a TyCtxt < ' tcx > ,
608
607
}
609
608
610
- impl < ' a , ' hir > EmitIgnoredResolutionErrors < ' a , ' hir > {
611
- fn new ( session : & ' a Session , hir_map : Map < ' hir > ) -> Self {
612
- Self { session , hir_map }
609
+ impl < ' a , ' tcx > EmitIgnoredResolutionErrors < ' a , ' tcx > {
610
+ fn new ( tcx : & ' a TyCtxt < ' tcx > ) -> Self {
611
+ Self { tcx }
613
612
}
614
613
}
615
614
616
- impl < ' hir > Visitor < ' hir > for EmitIgnoredResolutionErrors < ' _ , ' hir > {
617
- type Map = Map < ' hir > ;
615
+ impl < ' tcx > Visitor < ' tcx > for EmitIgnoredResolutionErrors < ' _ , ' tcx > {
616
+ type Map = Map < ' tcx > ;
618
617
619
618
fn nested_visit_map ( & mut self ) -> NestedVisitorMap < Self :: Map > {
620
619
// We need to recurse into nested closures,
621
620
// since those will fallback to the parent for type checking.
622
- NestedVisitorMap :: OnlyBodies ( self . hir_map )
621
+ NestedVisitorMap :: OnlyBodies ( self . tcx . hir ( ) )
623
622
}
624
623
625
- fn visit_path ( & mut self , path : & ' hir Path < ' _ > , _id : HirId ) {
624
+ fn visit_path ( & mut self , path : & ' tcx Path < ' _ > , _id : HirId ) {
626
625
debug ! ( "visiting path {:?}" , path) ;
627
626
if path. res == Res :: Err {
628
627
// We have less context here than in rustc_resolve,
@@ -637,7 +636,7 @@ impl<'hir> Visitor<'hir> for EmitIgnoredResolutionErrors<'_, 'hir> {
637
636
. join( "::" )
638
637
) ;
639
638
let mut err = rustc_errors:: struct_span_err!(
640
- self . session ,
639
+ self . tcx . sess ,
641
640
path. span,
642
641
E0433 ,
643
642
"failed to resolve: {}" ,
0 commit comments