debug!("eval_verify_bound(lower_bound={:?}, verify_bound={:?})", lower_bound, verify_bound);
match verify_bound {
- VerifyBound::IfEq(test_ty, verify_bound1) => {
- self.eval_if_eq(tcx, body, generic_ty, lower_bound, *test_ty, verify_bound1)
- }
+ VerifyBound::IfEq(test_ty, verify_bound1) => self.eval_if_eq(
+ tcx,
+ body,
+ generic_ty,
+ lower_bound,
+ *test_ty,
+ &VerifyBound::OutlivedBy(*verify_bound1),
+ ),
VerifyBound::IsEmpty => {
let lower_bound_scc = self.constraint_sccs.scc(lower_bound);
min: ty::Region<'tcx>,
) -> bool {
match bound {
- VerifyBound::IfEq(k, b) => {
+ VerifyBound::IfEq(k, r) => {
(var_values.normalize(self.region_rels.tcx, *k) == generic_ty)
- && self.bound_is_met(b, var_values, generic_ty, min)
+ && self.bound_is_met(&VerifyBound::OutlivedBy(*r), var_values, generic_ty, min)
}
VerifyBound::OutlivedBy(r) => {
.projection_approx_declared_bounds_from_env(projection_ty)
.into_iter()
.map(|ty::OutlivesPredicate(ty, r)| {
- let vb = VerifyBound::OutlivedBy(r);
if ty == projection_ty_as_ty {
// Micro-optimize if this is an exact match (this
// occurs often when there are no region variables
// involved).
- vb
+ VerifyBound::OutlivedBy(r)
} else {
- VerifyBound::IfEq(ty, Box::new(vb))
+ VerifyBound::IfEq(ty, r)
}
});
///
/// meaning, if the subject G is equal to `<T as Trait<'a>>::Item`
/// (after inference), and `'a: min`, then `G: min`.
- IfEq(Ty<'tcx>, Box<VerifyBound<'tcx>>),
+ IfEq(Ty<'tcx>, Region<'tcx>),
/// Given a region `R`, expands to the function:
///
pub fn cannot_hold(&self) -> bool {
match self {
- VerifyBound::IfEq(_, b) => b.cannot_hold(),
+ VerifyBound::IfEq(_, _) => false,
VerifyBound::IsEmpty => false,
VerifyBound::OutlivedBy(_) => false,
VerifyBound::AnyBound(bs) => bs.iter().all(|b| b.cannot_hold()),