Overhaul PredicateInner and Predicate.

Specifically, change `Ty` from this:
```
pub struct Predicate<'tcx> { inner: &'tcx PredicateInner<'tcx> }
```
to this:
```
pub struct Predicate<'tcx>(&'tcx Interned<PredicateS<'tcx>>)
```
where `PredicateInner` is renamed as `PredicateS`.

 This (plus a few other minor changes) makes the parallels with `Ty` and
`TyS` much clearer, and makes the uniqueness more explicit.
This commit is contained in:
Nicholas Nethercote 2022-01-27 17:00:16 +11:00
parent e9a0c429c5
commit 925ec0d3c7
8 changed files with 68 additions and 69 deletions

View file

@ -198,7 +198,7 @@ fn extend_cause_with_original_assoc_item_obligation<'tcx>(
trait_ref: &ty::TraitRef<'tcx>,
item: Option<&hir::Item<'tcx>>,
cause: &mut traits::ObligationCause<'tcx>,
pred: &ty::Predicate<'tcx>,
pred: ty::Predicate<'tcx>,
) {
debug!(
"extended_cause_with_original_assoc_item_obligation {:?} {:?} {:?} {:?}",
@ -319,7 +319,7 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
trait_ref,
item,
&mut cause,
&obligation.predicate,
obligation.predicate,
);
traits::Obligation::with_depth(cause, depth, param_env, obligation.predicate)
};