Review comments
This commit is contained in:
parent
dd5c9bf139
commit
11d62aa284
4 changed files with 36 additions and 13 deletions
|
@ -1056,9 +1056,21 @@ impl<'tcx> Predicate<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Converts this to a `Binder<PredicateAtom<'tcx>>`. If the value was an
|
||||
/// `Atom`, then it is not allowed to contain escaping bound vars.
|
||||
pub fn bound_atom(self, _tcx: TyCtxt<'tcx>) -> Binder<PredicateAtom<'tcx>> {
|
||||
match self.kind() {
|
||||
&PredicateKind::ForAll(binder) => binder,
|
||||
&PredicateKind::Atom(atom) => {
|
||||
assert!(!atom.has_escaping_bound_vars());
|
||||
Binder::dummy(atom)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Allows using a `Binder<PredicateAtom<'tcx>>` even if the given predicate previously
|
||||
/// contained unbound variables by shifting these variables outwards.
|
||||
pub fn bound_atom(self, tcx: TyCtxt<'tcx>) -> Binder<PredicateAtom<'tcx>> {
|
||||
pub fn bound_atom_with_opt_escaping(self, tcx: TyCtxt<'tcx>) -> Binder<PredicateAtom<'tcx>> {
|
||||
match self.kind() {
|
||||
&PredicateKind::ForAll(binder) => binder,
|
||||
&PredicateKind::Atom(atom) => Binder::wrap_nonbinding(tcx, atom),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue