handle late-bound vars from inner binders correctly and add test
This commit is contained in:
parent
e83dcf4ecd
commit
048e637e9e
3 changed files with 25 additions and 1 deletions
|
@ -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, .. }) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue