@@ -11,9 +11,9 @@ use rustc_hir::definitions::DefPath;
1111use rustc_hir:: { GenericParam , GenericParamKind , Generics , HirId , LifetimeParamKind , QPath , Ty } ;
1212use rustc_infer:: infer:: TyCtxtInferExt ;
1313use rustc_middle:: ty:: {
14- AdtDef , BoundVarReplacerDelegate , Clause , ClauseKind , ConstKind , GenericArg , GenericArgKind ,
15- GenericParamDefKind , TermKind , TyCtxt , TyKind , TypeFoldable , TypeFolder , TypeSuperFoldable ,
16- TypeVisitableExt , TypingMode , ValTreeKind , Value , Visibility ,
14+ AdtDef , BoundVarIndexKind , BoundVarReplacerDelegate , Clause , ClauseKind , ConstKind , GenericArg ,
15+ GenericArgKind , GenericParamDefKind , TermKind , TyCtxt , TyKind , TypeFoldable , TypeFolder ,
16+ TypeSuperFoldable , TypeVisitableExt , TypingMode , ValTreeKind , Value , Visibility ,
1717} ;
1818use rustc_middle:: ty:: { TraitPredicate , TypingEnv } ;
1919use rustc_span:: Span ;
@@ -322,7 +322,9 @@ where
322322
323323 fn fold_ty ( & mut self , t : rustc_middle:: ty:: Ty < ' tcx > ) -> rustc_middle:: ty:: Ty < ' tcx > {
324324 match * t. kind ( ) {
325- rustc_middle:: ty:: Bound ( debruijn, bound_ty) if debruijn == self . current_index => {
325+ rustc_middle:: ty:: Bound ( BoundVarIndexKind :: Bound ( debruijn) , bound_ty)
326+ if debruijn == self . current_index =>
327+ {
326328 let ty = self . delegate . replace_ty ( bound_ty) ;
327329 debug_assert ! ( !ty. has_vars_bound_above( rustc_middle:: ty:: INNERMOST ) ) ;
328330 rustc_middle:: ty:: shift_vars ( self . tcx , ty, self . current_index . as_u32 ( ) )
@@ -335,9 +337,13 @@ where
335337 fn fold_region ( & mut self , r : rustc_middle:: ty:: Region < ' tcx > ) -> rustc_middle:: ty:: Region < ' tcx > {
336338 match r. kind ( ) {
337339 // NOTE(verus): This is the one change, we replace == with >=
338- rustc_middle:: ty:: ReBound ( debruijn, br) if debruijn >= self . current_index => {
340+ rustc_middle:: ty:: ReBound ( BoundVarIndexKind :: Bound ( debruijn) , br)
341+ if debruijn >= self . current_index =>
342+ {
339343 let region = self . delegate . replace_region ( br) ;
340- if let rustc_middle:: ty:: ReBound ( debruijn1, br) = region. kind ( ) {
344+ if let rustc_middle:: ty:: ReBound ( BoundVarIndexKind :: Bound ( debruijn1) , br) =
345+ region. kind ( )
346+ {
341347 assert_eq ! ( debruijn1, rustc_middle:: ty:: INNERMOST ) ;
342348 rustc_middle:: ty:: Region :: new_bound ( self . tcx , debruijn, br)
343349 } else {
@@ -350,7 +356,9 @@ where
350356
351357 fn fold_const ( & mut self , ct : rustc_middle:: ty:: Const < ' tcx > ) -> rustc_middle:: ty:: Const < ' tcx > {
352358 match ct. kind ( ) {
353- ConstKind :: Bound ( debruijn, bound_const) if debruijn == self . current_index => {
359+ ConstKind :: Bound ( BoundVarIndexKind :: Bound ( debruijn) , bound_const)
360+ if debruijn == self . current_index =>
361+ {
354362 let ct = self . delegate . replace_const ( bound_const) ;
355363 debug_assert ! ( !ct. has_vars_bound_above( rustc_middle:: ty:: INNERMOST ) ) ;
356364 rustc_middle:: ty:: shift_vars ( self . tcx , ct, self . current_index . as_u32 ( ) )
@@ -1195,7 +1203,7 @@ pub(crate) fn mid_ty_to_vir_ghost<'tcx>(
11951203 let typx = TypX :: FnDef ( fun, Arc :: new ( typ_args) , resolved) ;
11961204 ( Arc :: new ( typx) , false )
11971205 }
1198- TyKind :: Dynamic ( preds, _, rustc_middle :: ty :: DynKind :: Dyn ) => {
1206+ TyKind :: Dynamic ( preds, _) => {
11991207 use rustc_middle:: ty:: ExistentialPredicate ;
12001208 if preds. len ( ) != 1 {
12011209 unsupported_err ! ( span, "dyn with more that one trait" ) ;
0 commit comments