@@ -189,7 +189,7 @@ fn remap_gat_vars_and_recurse_into_nested_projections<'tcx>(
189
189
}
190
190
ty:: GenericArgKind :: Const ( ct) => {
191
191
if let ty:: ConstKind :: Bound ( ty:: INNERMOST , bv) = ct. kind ( ) {
192
- mapping. insert ( bv, tcx. mk_param_from_def ( param) )
192
+ mapping. insert ( bv. var , tcx. mk_param_from_def ( param) )
193
193
} else {
194
194
return None ;
195
195
}
@@ -307,16 +307,16 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for MapAndCompressBoundVars<'tcx> {
307
307
return ct;
308
308
}
309
309
310
- if let ty:: ConstKind :: Bound ( binder, old_var ) = ct. kind ( )
310
+ if let ty:: ConstKind :: Bound ( binder, old_bound ) = ct. kind ( )
311
311
&& self . binder == binder
312
312
{
313
- let mapped = if let Some ( mapped) = self . mapping . get ( & old_var ) {
313
+ let mapped = if let Some ( mapped) = self . mapping . get ( & old_bound . var ) {
314
314
mapped. expect_const ( )
315
315
} else {
316
316
let var = ty:: BoundVar :: from_usize ( self . still_bound_vars . len ( ) ) ;
317
317
self . still_bound_vars . push ( ty:: BoundVariableKind :: Const ) ;
318
- let mapped = ty:: Const :: new_bound ( self . tcx , ty:: INNERMOST , var) ;
319
- self . mapping . insert ( old_var , mapped. into ( ) ) ;
318
+ let mapped = ty:: Const :: new_bound ( self . tcx , ty:: INNERMOST , ty :: BoundConst { var} ) ;
319
+ self . mapping . insert ( old_bound . var , mapped. into ( ) ) ;
320
320
mapped
321
321
} ;
322
322
0 commit comments