@@ -1272,7 +1272,7 @@ fn associated_path_def_to_ty<'tcx>(this: &AstConv<'tcx, 'tcx>,
12721272 // Find the type of the associated item, and the trait where the associated
12731273 // item is declared.
12741274 let bound = match ( & ty. sty , ty_path_def) {
1275- ( _, Def :: SelfTy ( Some ( trait_did) , Some ( ( impl_id, _ ) ) ) ) => {
1275+ ( _, Def :: SelfTy ( Some ( trait_did) , Some ( impl_id) ) ) => {
12761276 // `Self` in an impl of a trait - we have a concrete self type and a
12771277 // trait reference.
12781278 let trait_ref = tcx. impl_trait_ref ( tcx. map . local_def_id ( impl_id) ) . unwrap ( ) ;
@@ -1479,17 +1479,14 @@ fn base_def_to_ty<'tcx>(this: &AstConv<'tcx, 'tcx>,
14791479 tcx. prohibit_type_params ( base_segments) ;
14801480 tcx. mk_param ( space, index, name)
14811481 }
1482- Def :: SelfTy ( _, Some ( ( _ , self_ty_id ) ) ) => {
1482+ Def :: SelfTy ( _, Some ( impl_id ) ) => {
14831483 // Self in impl (we know the concrete type).
14841484 tcx. prohibit_type_params ( base_segments) ;
1485- if let Some ( & ty) = tcx. ast_ty_to_ty_cache . borrow ( ) . get ( & self_ty_id) {
1486- if let Some ( free_substs) = this. get_free_substs ( ) {
1487- ty. subst ( tcx, free_substs)
1488- } else {
1489- ty
1490- }
1485+ let ty = tcx. node_id_to_type ( impl_id) ;
1486+ if let Some ( free_substs) = this. get_free_substs ( ) {
1487+ ty. subst ( tcx, free_substs)
14911488 } else {
1492- span_bug ! ( span , "self type has not been fully resolved" )
1489+ ty
14931490 }
14941491 }
14951492 Def :: SelfTy ( Some ( _) , None ) => {
@@ -1585,12 +1582,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx, 'tcx>,
15851582
15861583 let tcx = this. tcx ( ) ;
15871584
1588- if let Some ( & ty) = tcx. ast_ty_to_ty_cache . borrow ( ) . get ( & ast_ty. id ) {
1589- debug ! ( "ast_ty_to_ty: id={:?} ty={:?} (cached)" , ast_ty. id, ty) ;
1590- return ty;
1591- }
1592-
1593- let typ = match ast_ty. node {
1585+ match ast_ty. node {
15941586 hir:: TyVec ( ref ty) => {
15951587 tcx. mk_slice ( ast_ty_to_ty ( this, rscope, & ty) )
15961588 }
@@ -1714,11 +1706,7 @@ pub fn ast_ty_to_ty<'tcx>(this: &AstConv<'tcx, 'tcx>,
17141706 // handled specially and will not descend into this routine.
17151707 this. ty_infer ( None , None , None , ast_ty. span )
17161708 }
1717- } ;
1718-
1719- debug ! ( "ast_ty_to_ty: id={:?} ty={:?}" , ast_ty. id, typ) ;
1720- tcx. ast_ty_to_ty_cache . borrow_mut ( ) . insert ( ast_ty. id , typ) ;
1721- return typ;
1709+ }
17221710}
17231711
17241712pub fn ty_of_arg < ' tcx > ( this : & AstConv < ' tcx , ' tcx > ,
0 commit comments