@@ -460,8 +460,8 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for BoundVarReplacer<'a, 'gcx, 'tcx>
460460
461461 fn fold_ty ( & mut self , t : Ty < ' tcx > ) -> Ty < ' tcx > {
462462 match t. sty {
463- ty:: Bound ( bound_ty) => {
464- if bound_ty . index == self . current_index {
463+ ty:: Bound ( debruijn , bound_ty) => {
464+ if debruijn == self . current_index {
465465 let fld_t = & mut self . fld_t ;
466466 let ty = fld_t ( bound_ty) ;
467467 ty:: fold:: shift_vars (
@@ -526,7 +526,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
526526 T : TypeFoldable < ' tcx >
527527 {
528528 // identity for bound types
529- let fld_t = |bound_ty| self . mk_ty ( ty:: Bound ( bound_ty) ) ;
529+ let fld_t = |bound_ty| self . mk_ty ( ty:: Bound ( ty :: INNERMOST , bound_ty) ) ;
530530 self . replace_escaping_bound_vars ( value. skip_binder ( ) , fld_r, fld_t)
531531 }
532532
@@ -722,16 +722,13 @@ impl<'a, 'gcx, 'tcx> TypeFolder<'gcx, 'tcx> for Shifter<'a, 'gcx, 'tcx> {
722722
723723 fn fold_ty ( & mut self , ty : ty:: Ty < ' tcx > ) -> ty:: Ty < ' tcx > {
724724 match ty. sty {
725- ty:: Bound ( bound_ty) => {
726- if self . amount == 0 || bound_ty . index < self . current_index {
725+ ty:: Bound ( debruijn , bound_ty) => {
726+ if self . amount == 0 || debruijn < self . current_index {
727727 ty
728728 } else {
729- let shifted = ty:: BoundTy {
730- index : bound_ty. index . shifted_in ( self . amount ) ,
731- var : bound_ty. var ,
732- kind : bound_ty. kind ,
733- } ;
734- self . tcx . mk_ty ( ty:: Bound ( shifted) )
729+ self . tcx . mk_ty (
730+ ty:: Bound ( debruijn. shifted_in ( self . amount ) , bound_ty)
731+ )
735732 }
736733 }
737734
0 commit comments