@@ -8,7 +8,7 @@ use rustc::{
88 infer:: InferCtxt ,
99 ty:: {
1010 fold:: { BottomUpFolder , TypeFoldable , TypeFolder } ,
11- subst:: { InternalSubsts , Kind , SubstsRef } ,
11+ subst:: { GenericArg , InternalSubsts , SubstsRef } ,
1212 GenericParamDefKind , ParamEnv , Predicate , Region , TraitRef , Ty , TyCtxt ,
1313 } ,
1414} ;
@@ -103,7 +103,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
103103 orig_def_id : DefId ,
104104 orig_substs : SubstsRef < ' tcx > ,
105105 ) -> Option < ( DefId , SubstsRef < ' tcx > ) > {
106- use rustc:: ty:: subst:: UnpackedKind ;
106+ use rustc:: ty:: subst:: GenericArgKind ;
107107 use rustc:: ty:: ReEarlyBound ;
108108 use std:: cell:: Cell ;
109109
@@ -119,10 +119,10 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
119119
120120 let target_substs =
121121 InternalSubsts :: for_item ( self . tcx , target_def_id, |def, _| match def. kind {
122- GenericParamDefKind :: Lifetime => Kind :: from ( if !success. get ( ) {
122+ GenericParamDefKind :: Lifetime => GenericArg :: from ( if !success. get ( ) {
123123 self . tcx
124124 . mk_region ( ReEarlyBound ( def. to_early_bound_region_data ( ) ) )
125- } else if let Some ( UnpackedKind :: Lifetime ( region) ) =
125+ } else if let Some ( GenericArgKind :: Lifetime ( region) ) =
126126 orig_substs. get ( def. index as usize ) . map ( |k| k. unpack ( ) )
127127 {
128128 self . translate_region ( region)
@@ -134,15 +134,15 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
134134 GenericParamDefKind :: Type { .. } => {
135135 if !success. get ( ) {
136136 self . tcx . mk_param_from_def ( def)
137- } else if let Some ( UnpackedKind :: Type ( type_) ) =
137+ } else if let Some ( GenericArgKind :: Type ( type_) ) =
138138 orig_substs. get ( def. index as usize ) . map ( |k| k. unpack ( ) )
139139 {
140- self . translate ( index_map, & Kind :: from ( type_) )
140+ self . translate ( index_map, & GenericArg :: from ( type_) )
141141 } else if self
142142 . id_mapping
143143 . is_non_mapped_defaulted_type_param ( def. def_id )
144144 {
145- Kind :: from ( self . tcx . type_of ( def. def_id ) )
145+ GenericArg :: from ( self . tcx . type_of ( def. def_id ) )
146146 } else if self . tcx . generics_of ( target_def_id) . has_self && def. index == 0 {
147147 self . tcx . mk_param_from_def ( def)
148148 } else {
@@ -171,7 +171,7 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
171171 orig. fold_with ( & mut BottomUpFolder {
172172 tcx : self . tcx ,
173173 ty_op : |ty| {
174- match ty. sty {
174+ match ty. kind {
175175 TyKind :: Adt ( & AdtDef { ref did, .. } , substs)
176176 if self . needs_translation ( * did) =>
177177 {
@@ -293,14 +293,14 @@ impl<'a, 'tcx> TranslationContext<'a, 'tcx> {
293293 // `Self` is special
294294 let orig_def_id = index_map[ & param. index ] ;
295295 if self . needs_translation ( orig_def_id) {
296- use rustc:: ty:: subst:: UnpackedKind ;
296+ use rustc:: ty:: subst:: GenericArgKind ;
297297
298298 let target_def_id = self . translate_orig ( orig_def_id) ;
299299 debug ! ( "translating type param: {:?}" , param) ;
300300 let type_param = self . id_mapping . get_type_param ( & target_def_id) ;
301301 debug ! ( "translated type param: {:?}" , type_param) ;
302302 match self . tcx . mk_param_from_def ( & type_param) . unpack ( ) {
303- UnpackedKind :: Type ( param_t) => param_t,
303+ GenericArgKind :: Type ( param_t) => param_t,
304304 _ => unreachable ! ( ) ,
305305 }
306306 } else {
@@ -542,7 +542,7 @@ impl<'a, 'tcx> TypeFolder<'tcx> for InferenceCleanupFolder<'a, 'tcx> {
542542 use rustc:: ty:: TypeAndMut ;
543543
544544 let t1 = ty. super_fold_with ( self ) ;
545- match t1. sty {
545+ match t1. kind {
546546 TyKind :: Ref ( region, ty, mutbl) if region. needs_infer ( ) => {
547547 let ty_and_mut = TypeAndMut { ty, mutbl } ;
548548 self . infcx
0 commit comments