Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/next_solver/predicate.rs')
-rw-r--r--crates/hir-ty/src/next_solver/predicate.rs33
1 files changed, 4 insertions, 29 deletions
diff --git a/crates/hir-ty/src/next_solver/predicate.rs b/crates/hir-ty/src/next_solver/predicate.rs
index 8658d03a9e..30738dea5c 100644
--- a/crates/hir-ty/src/next_solver/predicate.rs
+++ b/crates/hir-ty/src/next_solver/predicate.rs
@@ -31,6 +31,7 @@ pub type ExistentialPredicate<'db> = ty::ExistentialPredicate<DbInterner<'db>>;
pub type ExistentialTraitRef<'db> = ty::ExistentialTraitRef<DbInterner<'db>>;
pub type ExistentialProjection<'db> = ty::ExistentialProjection<DbInterner<'db>>;
pub type TraitPredicate<'db> = ty::TraitPredicate<DbInterner<'db>>;
+pub type HostEffectPredicate<'db> = ty::HostEffectPredicate<DbInterner<'db>>;
pub type ClauseKind<'db> = ty::ClauseKind<DbInterner<'db>>;
pub type PredicateKind<'db> = ty::PredicateKind<DbInterner<'db>>;
pub type NormalizesTo<'db> = ty::NormalizesTo<DbInterner<'db>>;
@@ -705,34 +706,6 @@ impl<'db> rustc_type_ir::inherent::Predicate<DbInterner<'db>> for Predicate<'db>
_ => None,
}
}
-
- /// Whether this projection can be soundly normalized.
- ///
- /// Wf predicates must not be normalized, as normalization
- /// can remove required bounds which would cause us to
- /// unsoundly accept some programs. See #91068.
- fn allow_normalization(self) -> bool {
- // TODO: this should probably live in rustc_type_ir
- match self.inner().as_ref().skip_binder() {
- PredicateKind::Clause(ClauseKind::WellFormed(_)) | PredicateKind::AliasRelate(..) => {
- false
- }
- PredicateKind::Clause(ClauseKind::Trait(_))
- | PredicateKind::Clause(ClauseKind::RegionOutlives(_))
- | PredicateKind::Clause(ClauseKind::TypeOutlives(_))
- | PredicateKind::Clause(ClauseKind::Projection(_))
- | PredicateKind::Clause(ClauseKind::ConstArgHasType(..))
- | PredicateKind::Clause(ClauseKind::HostEffect(..))
- | PredicateKind::Clause(ClauseKind::UnstableFeature(_))
- | PredicateKind::DynCompatible(_)
- | PredicateKind::Subtype(_)
- | PredicateKind::Coerce(_)
- | PredicateKind::Clause(ClauseKind::ConstEvaluatable(_))
- | PredicateKind::ConstEquate(_, _)
- | PredicateKind::NormalizesTo(..)
- | PredicateKind::Ambiguous => true,
- }
- }
}
impl<'db> Predicate<'db> {
@@ -912,7 +885,9 @@ impl<'db> rustc_type_ir::inherent::Clause<DbInterner<'db>> for Clause<'db> {
let shifted_pred =
cx.shift_bound_var_indices(trait_bound_vars.len(), bound_pred.skip_binder());
// 2) Self: Bar1<'a, '^0.1> -> T: Bar1<'^0.0, '^0.1>
- let new = EarlyBinder::bind(shifted_pred).instantiate(cx, trait_ref.skip_binder().args);
+ let new = EarlyBinder::bind(shifted_pred)
+ .instantiate(cx, trait_ref.skip_binder().args)
+ .skip_norm_wip();
// 3) ['x] + ['b] -> ['x, 'b]
let bound_vars =
BoundVarKinds::new_from_iter(cx, trait_bound_vars.iter().chain(pred_bound_vars.iter()));