@@ -23,7 +23,6 @@ use rustc::middle::cstore::ExternCrate;
23
23
use rustc:: session:: config:: { CrateType , Input , OutputType } ;
24
24
use rustc:: ty:: { self , DefIdTree , TyCtxt } ;
25
25
use rustc:: { bug, span_bug} ;
26
- use rustc_typeck:: hir_ty_to_ty;
27
26
use rustc_codegen_utils:: link:: { filename_for_metadata, out_filename} ;
28
27
use rustc_data_structures:: sync:: Lrc ;
29
28
@@ -648,6 +647,10 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
648
647
Node :: Pat ( & hir:: Pat {
649
648
node : hir:: PatKind :: TupleStruct ( ref qpath, ..) ,
650
649
..
650
+ } ) |
651
+ Node :: Ty ( & hir:: Ty {
652
+ node : hir:: TyKind :: Path ( ref qpath) ,
653
+ ..
651
654
} ) => {
652
655
let hir_id = self . tcx . hir ( ) . node_to_hir_id ( id) ;
653
656
self . tables . qpath_def ( qpath, hir_id)
@@ -658,25 +661,6 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
658
661
..
659
662
} ) => HirDef :: Local ( self . tcx . hir ( ) . hir_to_node_id ( canonical_id) ) ,
660
663
661
- Node :: Ty ( ty) => if let hir:: Ty {
662
- node : hir:: TyKind :: Path ( ref qpath) ,
663
- ..
664
- } = * ty
665
- {
666
- match * qpath {
667
- hir:: QPath :: Resolved ( _, ref path) => path. def ,
668
- hir:: QPath :: TypeRelative ( ..) => {
669
- let ty = hir_ty_to_ty ( self . tcx , ty) ;
670
- if let ty:: Projection ( proj) = ty. sty {
671
- return HirDef :: AssociatedTy ( proj. item_def_id ) ;
672
- }
673
- HirDef :: Err
674
- }
675
- }
676
- } else {
677
- HirDef :: Err
678
- } ,
679
-
680
664
_ => HirDef :: Err ,
681
665
}
682
666
}
0 commit comments