TL;DR
Refactor ty::Predicate to better align with how chalk handles things and to enable what we need for GATs. Highlights:
Goals:
- Introduce forall and implication predicates so we can model
forall<T> { if (T: Debug) { Vec<T>: Debug } }.
- Remove the "poly" from all the other kinds of predicates (e.g.,
Predicate::Trait would be an ordinary TraitRef)
- Change
Predicate<'tcx> to an interned reference (&'tcx PredicateKind<'tcx>) to enable recursion
Steps
- Enable recursive predicates (this work has started on a branch of mine and is basically done)
- Rename
Predicate to PredicateKind, introduce type Predicate = PredicateKind
- Introduce interned pool for
Predicate and alter type Predicate<'tcx> to &'tcx PredicateKind<'tcx>
- Introduce forall:
- Introduce
forall predicate goals and integrate into the fulfillment context
- hmm -- this may require finishing up the universe integration work, which is semi-blocked
- Remove the mandatory binder on trait predicates and other predicates and use forall goals instead where needed
- Introduce implication predicates, which extend the
ParamEnv with new predicates
Mentors or Reviewers
nikomatsakis will mentor
TL;DR
Refactor
ty::Predicateto better align with how chalk handles things and to enable what we need for GATs. Highlights:Goals:
forall<T> { if (T: Debug) { Vec<T>: Debug } }.Predicate::Traitwould be an ordinaryTraitRef)Predicate<'tcx>to an interned reference (&'tcx PredicateKind<'tcx>) to enable recursionSteps
PredicatetoPredicateKind, introducetype Predicate = PredicateKindPredicateand altertype Predicate<'tcx>to&'tcx PredicateKind<'tcx>forallpredicate goals and integrate into the fulfillment contextParamEnvwith new predicatesMentors or Reviewers
nikomatsakis will mentor