eagerly check for bound vars of predicates
This commit is contained in:
parent
39a990d2f1
commit
864d2f3528
2 changed files with 8 additions and 0 deletions
|
@ -448,6 +448,10 @@ impl<'a, 'tcx> TypeFolder<'tcx> for BoundVarReplacer<'a, 'tcx> {
|
||||||
_ => ct.super_fold_with(self),
|
_ => ct.super_fold_with(self),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
|
||||||
|
if p.has_vars_bound_at_or_above(self.current_index) { p.super_fold_with(self) } else { p }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'tcx> TyCtxt<'tcx> {
|
impl<'tcx> TyCtxt<'tcx> {
|
||||||
|
|
|
@ -756,6 +756,10 @@ impl<'tcx> TypeFolder<'tcx> for BoundVarReplacer<'_, 'tcx> {
|
||||||
_ => ct.super_fold_with(self),
|
_ => ct.super_fold_with(self),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn fold_predicate(&mut self, p: ty::Predicate<'tcx>) -> ty::Predicate<'tcx> {
|
||||||
|
if p.has_vars_bound_at_or_above(self.current_index) { p.super_fold_with(self) } else { p }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// The inverse of `BoundVarReplacer`: replaces placeholders with the bound vars from which they came.
|
// The inverse of `BoundVarReplacer`: replaces placeholders with the bound vars from which they came.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue