@@ -533,15 +533,15 @@ impl<'tcx> LowerInto<'tcx, Region<'tcx>> for &chalk_ir::Lifetime<RustInterner<'t
533
533
ty:: DebruijnIndex :: from_u32 ( var. debruijn . depth ( ) ) ,
534
534
ty:: BoundRegion {
535
535
var : ty:: BoundVar :: from_usize ( var. index ) ,
536
- kind : ty:: BrAnon ( var . index as u32 , None ) ,
536
+ kind : ty:: BrAnon ( None ) ,
537
537
} ,
538
538
) ,
539
539
chalk_ir:: LifetimeData :: InferenceVar ( _var) => unimplemented ! ( ) ,
540
540
chalk_ir:: LifetimeData :: Placeholder ( p) => tcx. mk_re_placeholder ( ty:: Placeholder {
541
541
universe : ty:: UniverseIndex :: from_usize ( p. ui . counter ) ,
542
542
bound : ty:: BoundRegion {
543
543
var : ty:: BoundVar :: from_usize ( p. idx ) ,
544
- kind : ty:: BoundRegionKind :: BrAnon ( p . idx as u32 , None ) ,
544
+ kind : ty:: BoundRegionKind :: BrAnon ( None ) ,
545
545
} ,
546
546
} ) ,
547
547
chalk_ir:: LifetimeData :: Static => tcx. lifetimes . re_static ,
@@ -976,7 +976,7 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for BoundVarsCollector<'tcx> {
976
976
}
977
977
}
978
978
979
- ty:: BoundRegionKind :: BrAnon ( var , _) => match self . parameters . entry ( var) {
979
+ ty:: BoundRegionKind :: BrAnon ( _) => match self . parameters . entry ( br . var . as_u32 ( ) ) {
980
980
Entry :: Vacant ( entry) => {
981
981
entry. insert ( chalk_ir:: VariableKind :: Lifetime ) ;
982
982
}
@@ -1036,8 +1036,8 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for NamedBoundVarSubstitutor<'a, 'tcx> {
1036
1036
match * r {
1037
1037
ty:: ReLateBound ( index, br) if index == self . binder_index => match br. kind {
1038
1038
ty:: BrNamed ( def_id, _name) => match self . named_parameters . get ( & def_id) {
1039
- Some ( idx ) => {
1040
- let new_br = ty:: BoundRegion { var : br. var , kind : ty:: BrAnon ( * idx , None ) } ;
1039
+ Some ( _ ) => {
1040
+ let new_br = ty:: BoundRegion { var : br. var , kind : ty:: BrAnon ( None ) } ;
1041
1041
return self . tcx . mk_re_late_bound ( index, new_br) ;
1042
1042
}
1043
1043
None => panic ! ( "Missing `BrNamed`." ) ,
@@ -1127,15 +1127,15 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ParamsSubstitutor<'tcx> {
1127
1127
Some ( idx) => {
1128
1128
let br = ty:: BoundRegion {
1129
1129
var : ty:: BoundVar :: from_u32 ( * idx) ,
1130
- kind : ty:: BrAnon ( * idx , None ) ,
1130
+ kind : ty:: BrAnon ( None ) ,
1131
1131
} ;
1132
1132
self . tcx . mk_re_late_bound ( self . binder_index , br)
1133
1133
}
1134
1134
None => {
1135
1135
let idx = self . named_regions . len ( ) as u32 ;
1136
1136
let br = ty:: BoundRegion {
1137
1137
var : ty:: BoundVar :: from_u32 ( idx) ,
1138
- kind : ty:: BrAnon ( idx , None ) ,
1138
+ kind : ty:: BrAnon ( None ) ,
1139
1139
} ;
1140
1140
self . named_regions . insert ( _re. def_id , idx) ;
1141
1141
self . tcx . mk_re_late_bound ( self . binder_index , br)
@@ -1213,8 +1213,9 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for PlaceholdersCollector {
1213
1213
fn visit_region ( & mut self , r : Region < ' tcx > ) -> ControlFlow < Self :: BreakTy > {
1214
1214
match * r {
1215
1215
ty:: RePlaceholder ( p) if p. universe == self . universe_index => {
1216
- if let ty:: BoundRegionKind :: BrAnon ( anon, _) = p. bound . kind {
1217
- self . next_anon_region_placeholder = self . next_anon_region_placeholder . max ( anon) ;
1216
+ if let ty:: BoundRegionKind :: BrAnon ( _) = p. bound . kind {
1217
+ self . next_anon_region_placeholder =
1218
+ self . next_anon_region_placeholder . max ( p. bound . var . as_u32 ( ) ) ;
1218
1219
}
1219
1220
// FIXME: This doesn't seem to handle BrNamed at all?
1220
1221
}
0 commit comments