@@ -3,7 +3,7 @@ use std::path::{Path, PathBuf};
33use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap } ;
44use rustc_hir:: def:: { DefKind , Res } ;
55use rustc_hir:: def_id:: { DefId , LOCAL_CRATE } ;
6- use rustc_hir:: intravisit:: { self , Visitor } ;
6+ use rustc_hir:: intravisit:: { self , Visitor , VisitorExt } ;
77use rustc_hir:: { ExprKind , HirId , Item , ItemKind , Mod , Node , QPath } ;
88use rustc_middle:: hir:: nested_filter;
99use rustc_middle:: ty:: TyCtxt ;
@@ -234,16 +234,13 @@ impl<'tcx> Visitor<'tcx> for SpanMapVisitor<'tcx> {
234234 self . infer_id ( path. hir_id , Some ( id) , path. ident . span ) ;
235235 }
236236
237- if let Some ( qself) = qself. try_as_ambig_ty ( ) {
238- rustc_ast:: visit:: try_visit!( self . visit_ty( qself) ) ;
239- }
237+ rustc_ast:: visit:: try_visit!( self . visit_ty_unambig( qself) ) ;
240238 self . visit_path_segment ( path) ;
241239 }
242240 QPath :: Resolved ( maybe_qself, path) => {
243241 self . handle_path ( path, true ) ;
244242
245- let maybe_qself = maybe_qself. and_then ( |maybe_qself| maybe_qself. try_as_ambig_ty ( ) ) ;
246- rustc_ast:: visit:: visit_opt!( self , visit_ty, maybe_qself) ;
243+ rustc_ast:: visit:: visit_opt!( self , visit_ty_unambig, maybe_qself) ;
247244 if !self . handle_macro ( path. span ) {
248245 intravisit:: walk_path ( self , path) ;
249246 }
0 commit comments