@@ -9,7 +9,7 @@ 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
11
use rustc_hir:: {
12
- intravisit:: { NestedVisitorMap , Visitor } ,
12
+ intravisit:: { self , NestedVisitorMap , Visitor } ,
13
13
Path ,
14
14
} ;
15
15
use rustc_interface:: interface;
@@ -622,7 +622,7 @@ impl<'hir> Visitor<'hir> for EmitIgnoredResolutionErrors<'_, 'hir> {
622
622
NestedVisitorMap :: OnlyBodies ( self . hir_map )
623
623
}
624
624
625
- fn visit_path ( & mut self , path : & ' v Path < ' v > , _id : HirId ) {
625
+ fn visit_path ( & mut self , path : & ' hir Path < ' _ > , _id : HirId ) {
626
626
debug ! ( "visiting path {:?}" , path) ;
627
627
if path. res == Res :: Err {
628
628
// We have less context here than in rustc_resolve,
@@ -648,7 +648,10 @@ impl<'hir> Visitor<'hir> for EmitIgnoredResolutionErrors<'_, 'hir> {
648
648
err. note ( "try running again with `rustc` and you may get a more detailed error" ) ;
649
649
err. emit ( ) ;
650
650
}
651
- // NOTE: this does _not_ visit the path segments
651
+ // We could have an outer resolution that succeeded,
652
+ // but with generic parameters that failed.
653
+ // Recurse into the segments so we catch those too.
654
+ intravisit:: walk_path ( self , path) ;
652
655
}
653
656
}
654
657
0 commit comments