1
Fork 0

add comment

This commit is contained in:
lcnr 2024-02-22 12:35:59 +01:00
parent db950efbc3
commit 16350d76d8

View file

@ -75,7 +75,14 @@ impl<'tcx> UnifyValue for RegionVariableValue<'tcx> {
(
RegionVariableValue::Unknown { universe: a },
RegionVariableValue::Unknown { universe: b },
) => Ok(RegionVariableValue::Unknown { universe: a.min(b) }),
) => {
// If we unify two unconstrained regions then whatever
// value they wind up taking (which must be the same value) must
// be nameable by both universes. Therefore, the resulting
// universe is the minimum of the two universes, because that is
// the one which contains the fewest names in scope.
Ok(RegionVariableValue::Unknown { universe: a.min(b) })
}
}
}
}