1
Fork 0

Drive-by: same_type_modulo_infer should handle ReVar == ReVar

This commit is contained in:
Michael Goulet 2022-08-26 04:42:53 +00:00
parent cfd47afa19
commit 48b3d8aa82

View file

@ -2720,7 +2720,10 @@ impl<'tcx> TypeRelation<'tcx> for SameTypeModuloInfer<'_, 'tcx> {
a: ty::Region<'tcx>,
b: ty::Region<'tcx>,
) -> RelateResult<'tcx, ty::Region<'tcx>> {
if (a.is_var() && b.is_free_or_static()) || (b.is_var() && a.is_free_or_static()) || a == b
if (a.is_var() && b.is_free_or_static())
|| (b.is_var() && a.is_free_or_static())
|| (a.is_var() && b.is_var())
|| a == b
{
Ok(a)
} else {