1
Fork 0

handle late-bound vars from inner binders correctly and add test

This commit is contained in:
b-naber 2022-10-08 15:52:59 +02:00
parent e83dcf4ecd
commit 048e637e9e
3 changed files with 25 additions and 1 deletions

View file

@ -2093,7 +2093,7 @@ impl<'a, 'tcx> ty::TypeFolder<'tcx> for RegionFolder<'a, 'tcx> {
fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> {
let name = &mut self.name;
let region = match *r {
ty::ReLateBound(db, br) => {
ty::ReLateBound(db, br) if db >= self.current_index => {
*self.region_map.entry(br).or_insert_with(|| name(Some(db), self.current_index, br))
}
ty::RePlaceholder(ty::PlaceholderRegion { name: kind, .. }) => {