1
Fork 0

Rollup merge of #110835 - nnethercote:strict-region-folders-2, r=compiler-errors

Make some region folders a little stricter.

Because certain regions cannot occur in them.

r? ``@compiler-errors``
This commit is contained in:
Matthias Krüger 2023-04-26 18:51:44 +02:00 committed by GitHub
commit e47562c674
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 23 deletions

View file

@ -829,7 +829,13 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for SubstFolder<'a, 'tcx> {
None => region_param_out_of_range(data, self.substs),
}
}
_ => r,
ty::ReLateBound(..)
| ty::ReFree(_)
| ty::ReStatic
| ty::RePlaceholder(_)
| ty::ReErased
| ty::ReError(_) => r,
ty::ReVar(_) => bug!("unexpected region: {r:?}"),
}
}