1
Fork 0

Rename AliasEq -> AliasRelate

This commit is contained in:
Michael Goulet 2023-03-21 22:11:40 +00:00
parent 5dc3fd7c05
commit 3a36a093dd
29 changed files with 57 additions and 53 deletions

View file

@ -1335,7 +1335,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
ty::Clause::RegionOutlives(_) | ty::Clause::ConstArgHasType(..) => bug!(), ty::Clause::RegionOutlives(_) | ty::Clause::ConstArgHasType(..) => bug!(),
}, },
ty::PredicateKind::WellFormed(_) ty::PredicateKind::WellFormed(_)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ObjectSafe(_) | ty::PredicateKind::ObjectSafe(_)
| ty::PredicateKind::ClosureKind(_, _, _) | ty::PredicateKind::ClosureKind(_, _, _)
| ty::PredicateKind::Subtype(_) | ty::PredicateKind::Subtype(_)

View file

@ -528,7 +528,7 @@ fn trait_predicate_kind<'tcx>(
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(_)) | ty::PredicateKind::Clause(ty::Clause::TypeOutlives(_))
| ty::PredicateKind::Clause(ty::Clause::Projection(_)) | ty::PredicateKind::Clause(ty::Clause::Projection(_))
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::WellFormed(_) | ty::PredicateKind::WellFormed(_)
| ty::PredicateKind::Subtype(_) | ty::PredicateKind::Subtype(_)
| ty::PredicateKind::Coerce(_) | ty::PredicateKind::Coerce(_)

View file

@ -56,7 +56,7 @@ impl<'tcx> ExplicitPredicatesMap<'tcx> {
| ty::PredicateKind::Clause(ty::Clause::Projection(..)) | ty::PredicateKind::Clause(ty::Clause::Projection(..))
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::WellFormed(..) | ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)

View file

@ -666,7 +666,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..)) | ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
| ty::PredicateKind::WellFormed(..) | ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
// N.B., this predicate is created by breaking down a // N.B., this predicate is created by breaking down a

View file

@ -838,7 +838,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => None, | ty::PredicateKind::TypeWellFormedFromEnv(..) => None,
} }
}); });

View file

@ -842,7 +842,7 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
let (a, b) = if self.a_is_expected() { (a, b) } else { (b, a) }; let (a, b) = if self.a_is_expected() { (a, b) } else { (b, a) };
self.register_predicates([ty::Binder::dummy(if self.tcx().trait_solver_next() { self.register_predicates([ty::Binder::dummy(if self.tcx().trait_solver_next() {
ty::PredicateKind::AliasEq(a.into(), b.into(), ty::AliasRelationDirection::Equate) ty::PredicateKind::AliasRelate(a.into(), b.into(), ty::AliasRelationDirection::Equate)
} else { } else {
ty::PredicateKind::ConstEquate(a, b) ty::PredicateKind::ConstEquate(a, b)
})]); })]);
@ -852,14 +852,14 @@ pub trait ObligationEmittingRelation<'tcx>: TypeRelation<'tcx> {
/// ///
/// If they aren't equal then the relation doesn't hold. /// If they aren't equal then the relation doesn't hold.
fn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) { fn register_type_equate_obligation(&mut self, a: Ty<'tcx>, b: Ty<'tcx>) {
self.register_predicates([ty::Binder::dummy(ty::PredicateKind::AliasEq( self.register_predicates([ty::Binder::dummy(ty::PredicateKind::AliasRelate(
a.into(), a.into(),
b.into(), b.into(),
self.alias_relate_direction(), self.alias_relate_direction(),
))]); ))]);
} }
/// Relation direction emitted for `AliasEq` predicates /// Relation direction emitted for `AliasRelate` predicates
fn alias_relate_direction(&self) -> ty::AliasRelationDirection; fn alias_relate_direction(&self) -> ty::AliasRelationDirection;
} }

View file

@ -22,7 +22,7 @@ pub fn explicit_outlives_bounds<'tcx>(
ty::PredicateKind::Clause(ty::Clause::Projection(..)) ty::PredicateKind::Clause(ty::Clause::Projection(..))
| ty::PredicateKind::Clause(ty::Clause::Trait(..)) | ty::PredicateKind::Clause(ty::Clause::Trait(..))
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::Coerce(..) | ty::PredicateKind::Coerce(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)
| ty::PredicateKind::WellFormed(..) | ty::PredicateKind::WellFormed(..)

View file

@ -26,7 +26,7 @@ impl<'tcx> InferCtxt<'tcx> {
// completely change the normalization routine with the new solver. // completely change the normalization routine with the new solver.
// //
// The new solver correctly handles projection equality so this hack // The new solver correctly handles projection equality so this hack
// is not necessary. if re-enabled it should emit `PredicateKind::AliasEq` // is not necessary. if re-enabled it should emit `PredicateKind::AliasRelate`
// not `PredicateKind::Clause(Clause::Projection(..))` as in the new solver // not `PredicateKind::Clause(Clause::Projection(..))` as in the new solver
// `Projection` is used as `normalizes-to` which will fail for `<T as Trait>::Assoc eq ?0`. // `Projection` is used as `normalizes-to` which will fail for `<T as Trait>::Assoc eq ?0`.
return projection_ty.to_ty(self.tcx); return projection_ty.to_ty(self.tcx);

View file

@ -293,7 +293,7 @@ impl<'tcx> Elaborator<'tcx> {
// Nothing to elaborate // Nothing to elaborate
} }
ty::PredicateKind::Ambiguous => {} ty::PredicateKind::Ambiguous => {}
ty::PredicateKind::AliasEq(..) => { ty::PredicateKind::AliasRelate(..) => {
// No // No
} }
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => { ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => {

View file

@ -1601,7 +1601,7 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints {
// Ignore projections, as they can only be global // Ignore projections, as they can only be global
// if the trait bound is global // if the trait bound is global
Clause(Clause::Projection(..)) | Clause(Clause::Projection(..)) |
AliasEq(..) | AliasRelate(..) |
// Ignore bounds that a user can't type // Ignore bounds that a user can't type
WellFormed(..) | WellFormed(..) |
ObjectSafe(..) | ObjectSafe(..) |

View file

@ -288,7 +288,7 @@ impl FlagComputation {
self.add_ty(ty); self.add_ty(ty);
} }
ty::PredicateKind::Ambiguous => {} ty::PredicateKind::Ambiguous => {}
ty::PredicateKind::AliasEq(t1, t2, _) => { ty::PredicateKind::AliasRelate(t1, t2, _) => {
self.add_term(t1); self.add_term(t1);
self.add_term(t2); self.add_term(t2);
} }

View file

@ -543,7 +543,7 @@ impl<'tcx> Predicate<'tcx> {
| PredicateKind::Clause(Clause::TypeOutlives(_)) | PredicateKind::Clause(Clause::TypeOutlives(_))
| PredicateKind::Clause(Clause::Projection(_)) | PredicateKind::Clause(Clause::Projection(_))
| PredicateKind::Clause(Clause::ConstArgHasType(..)) | PredicateKind::Clause(Clause::ConstArgHasType(..))
| PredicateKind::AliasEq(..) | PredicateKind::AliasRelate(..)
| PredicateKind::ObjectSafe(_) | PredicateKind::ObjectSafe(_)
| PredicateKind::ClosureKind(_, _, _) | PredicateKind::ClosureKind(_, _, _)
| PredicateKind::Subtype(_) | PredicateKind::Subtype(_)
@ -640,7 +640,7 @@ pub enum PredicateKind<'tcx> {
/// This predicate requires two terms to be equal to eachother. /// This predicate requires two terms to be equal to eachother.
/// ///
/// Only used for new solver /// Only used for new solver
AliasEq(Term<'tcx>, Term<'tcx>, AliasRelationDirection), AliasRelate(Term<'tcx>, Term<'tcx>, AliasRelationDirection),
} }
#[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] #[derive(Clone, Copy, PartialEq, Eq, Hash, TyEncodable, TyDecodable)]
@ -1224,7 +1224,7 @@ impl<'tcx> Predicate<'tcx> {
PredicateKind::Clause(Clause::Trait(t)) => Some(predicate.rebind(t)), PredicateKind::Clause(Clause::Trait(t)) => Some(predicate.rebind(t)),
PredicateKind::Clause(Clause::Projection(..)) PredicateKind::Clause(Clause::Projection(..))
| PredicateKind::Clause(Clause::ConstArgHasType(..)) | PredicateKind::Clause(Clause::ConstArgHasType(..))
| PredicateKind::AliasEq(..) | PredicateKind::AliasRelate(..)
| PredicateKind::Subtype(..) | PredicateKind::Subtype(..)
| PredicateKind::Coerce(..) | PredicateKind::Coerce(..)
| PredicateKind::Clause(Clause::RegionOutlives(..)) | PredicateKind::Clause(Clause::RegionOutlives(..))
@ -1245,7 +1245,7 @@ impl<'tcx> Predicate<'tcx> {
PredicateKind::Clause(Clause::Projection(t)) => Some(predicate.rebind(t)), PredicateKind::Clause(Clause::Projection(t)) => Some(predicate.rebind(t)),
PredicateKind::Clause(Clause::Trait(..)) PredicateKind::Clause(Clause::Trait(..))
| PredicateKind::Clause(Clause::ConstArgHasType(..)) | PredicateKind::Clause(Clause::ConstArgHasType(..))
| PredicateKind::AliasEq(..) | PredicateKind::AliasRelate(..)
| PredicateKind::Subtype(..) | PredicateKind::Subtype(..)
| PredicateKind::Coerce(..) | PredicateKind::Coerce(..)
| PredicateKind::Clause(Clause::RegionOutlives(..)) | PredicateKind::Clause(Clause::RegionOutlives(..))
@ -1267,7 +1267,7 @@ impl<'tcx> Predicate<'tcx> {
PredicateKind::Clause(Clause::Trait(..)) PredicateKind::Clause(Clause::Trait(..))
| PredicateKind::Clause(Clause::ConstArgHasType(..)) | PredicateKind::Clause(Clause::ConstArgHasType(..))
| PredicateKind::Clause(Clause::Projection(..)) | PredicateKind::Clause(Clause::Projection(..))
| PredicateKind::AliasEq(..) | PredicateKind::AliasRelate(..)
| PredicateKind::Subtype(..) | PredicateKind::Subtype(..)
| PredicateKind::Coerce(..) | PredicateKind::Coerce(..)
| PredicateKind::Clause(Clause::RegionOutlives(..)) | PredicateKind::Clause(Clause::RegionOutlives(..))

View file

@ -2848,7 +2848,7 @@ define_print_and_forward_display! {
} }
ty::PredicateKind::Ambiguous => p!("ambiguous"), ty::PredicateKind::Ambiguous => p!("ambiguous"),
// TODO // TODO
ty::PredicateKind::AliasEq(t1, t2, _) => p!(print(t1), " == ", print(t2)), ty::PredicateKind::AliasRelate(t1, t2, _) => p!(print(t1), " == ", print(t2)),
} }
} }

View file

@ -178,7 +178,7 @@ impl<'tcx> fmt::Debug for ty::PredicateKind<'tcx> {
} }
ty::PredicateKind::Ambiguous => write!(f, "Ambiguous"), ty::PredicateKind::Ambiguous => write!(f, "Ambiguous"),
// TODO // TODO
ty::PredicateKind::AliasEq(t1, t2, _) => write!(f, "AliasEq({t1:?}, {t2:?})"), ty::PredicateKind::AliasRelate(t1, t2, _) => write!(f, "AliasRelate({t1:?}, {t2:?})"),
} }
} }
} }

View file

@ -180,7 +180,7 @@ where
| ty::PredicateKind::ConstEquate(_, _) | ty::PredicateKind::ConstEquate(_, _)
| ty::PredicateKind::TypeWellFormedFromEnv(_) | ty::PredicateKind::TypeWellFormedFromEnv(_)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
| ty::PredicateKind::AliasEq(..) => bug!("unexpected predicate: {:?}", predicate), | ty::PredicateKind::AliasRelate(..) => bug!("unexpected predicate: {:?}", predicate),
} }
} }

View file

@ -223,9 +223,11 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
ty::PredicateKind::TypeWellFormedFromEnv(..) => { ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk") bug!("TypeWellFormedFromEnv is only used for Chalk")
} }
ty::PredicateKind::AliasEq(lhs, rhs, direction) => { ty::PredicateKind::AliasRelate(lhs, rhs, direction) => self
self.compute_alias_eq_goal(Goal { param_env, predicate: (lhs, rhs, direction) }) .compute_alias_relate_goal(Goal {
} param_env,
predicate: (lhs, rhs, direction),
}),
} }
} else { } else {
let kind = self.infcx.instantiate_binder_with_placeholders(kind); let kind = self.infcx.instantiate_binder_with_placeholders(kind);

View file

@ -73,7 +73,7 @@ impl<'tcx> TraitEngine<'tcx> for FulfillmentCtxt<'tcx> {
MismatchedProjectionTypes { err: TypeError::Mismatch }, MismatchedProjectionTypes { err: TypeError::Mismatch },
) )
} }
ty::PredicateKind::AliasEq(_, _, _) => { ty::PredicateKind::AliasRelate(_, _, _) => {
FulfillmentErrorCode::CodeProjectionError( FulfillmentErrorCode::CodeProjectionError(
MismatchedProjectionTypes { err: TypeError::Mismatch }, MismatchedProjectionTypes { err: TypeError::Mismatch },
) )

View file

@ -156,7 +156,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
} }
#[instrument(level = "debug", skip(self), ret)] #[instrument(level = "debug", skip(self), ret)]
fn compute_alias_eq_goal( fn compute_alias_relate_goal(
&mut self, &mut self,
goal: Goal<'tcx, (ty::Term<'tcx>, ty::Term<'tcx>, ty::AliasRelationDirection)>, goal: Goal<'tcx, (ty::Term<'tcx>, ty::Term<'tcx>, ty::AliasRelationDirection)>,
) -> QueryResult<'tcx> { ) -> QueryResult<'tcx> {
@ -204,12 +204,12 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
if lhs.is_infer() || rhs.is_infer() { if lhs.is_infer() || rhs.is_infer() {
bug!( bug!(
"`AliasEq` goal with an infer var on lhs or rhs which should have been instantiated" "`AliasRelate` goal with an infer var on lhs or rhs which should have been instantiated"
); );
} }
match (lhs.to_projection_term(tcx), rhs.to_projection_term(tcx)) { match (lhs.to_projection_term(tcx), rhs.to_projection_term(tcx)) {
(None, None) => bug!("`AliasEq` goal without an alias on either lhs or rhs"), (None, None) => bug!("`AliasRelate` goal without an alias on either lhs or rhs"),
// RHS is not a projection, only way this is true is if LHS normalizes-to RHS // RHS is not a projection, only way this is true is if LHS normalizes-to RHS
(Some(alias_lhs), None) => evaluate_normalizes_to(self, alias_lhs, rhs, direction), (Some(alias_lhs), None) => evaluate_normalizes_to(self, alias_lhs, rhs, direction),
@ -220,7 +220,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
} }
(Some(alias_lhs), Some(alias_rhs)) => { (Some(alias_lhs), Some(alias_rhs)) => {
debug!("compute_alias_eq_goal: both sides are aliases"); debug!("compute_alias_relate_goal: both sides are aliases");
let candidates = vec![ let candidates = vec![
// LHS normalizes-to RHS // LHS normalizes-to RHS
@ -229,7 +229,9 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
evaluate_normalizes_to(self, alias_rhs, lhs, direction.invert()), evaluate_normalizes_to(self, alias_rhs, lhs, direction.invert()),
// Relate via substs // Relate via substs
self.probe(|ecx| { self.probe(|ecx| {
debug!("compute_alias_eq_goal: alias defids are equal, equating substs"); debug!(
"compute_alias_relate_goal: alias defids are equal, equating substs"
);
ecx.add_goals( ecx.add_goals(
match direction { match direction {

View file

@ -832,7 +832,7 @@ impl<'tcx> AutoTraitFinder<'tcx> {
// the `ParamEnv`. // the `ParamEnv`.
ty::PredicateKind::WellFormed(..) ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)

View file

@ -1276,9 +1276,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
"TypeWellFormedFromEnv predicate should only exist in the environment" "TypeWellFormedFromEnv predicate should only exist in the environment"
), ),
ty::PredicateKind::AliasEq(..) => span_bug!( ty::PredicateKind::AliasRelate(..) => span_bug!(
span, span,
"AliasEq predicate should never be the predicate cause of a SelectionError" "AliasRelate predicate should never be the predicate cause of a SelectionError"
), ),
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => { ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => {

View file

@ -361,8 +361,8 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
ty::PredicateKind::TypeWellFormedFromEnv(..) => { ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk") bug!("TypeWellFormedFromEnv is only used for Chalk")
} }
ty::PredicateKind::AliasEq(..) => { ty::PredicateKind::AliasRelate(..) => {
bug!("AliasEq is only used for new solver") bug!("AliasRelate is only used for new solver")
} }
}, },
Some(pred) => match pred { Some(pred) => match pred {
@ -630,8 +630,8 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
ty::PredicateKind::TypeWellFormedFromEnv(..) => { ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk") bug!("TypeWellFormedFromEnv is only used for Chalk")
} }
ty::PredicateKind::AliasEq(..) => { ty::PredicateKind::AliasRelate(..) => {
bug!("AliasEq is only used for new solver") bug!("AliasRelate is only used for new solver")
} }
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => { ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => {
match self.selcx.infcx.at(&obligation.cause, obligation.param_env).eq( match self.selcx.infcx.at(&obligation.cause, obligation.param_env).eq(

View file

@ -335,7 +335,7 @@ fn predicate_references_self<'tcx>(
has_self_ty(&ty.into()).then_some(sp) has_self_ty(&ty.into()).then_some(sp)
} }
ty::PredicateKind::AliasEq(..) => bug!("`AliasEq` not allowed as assumption"), ty::PredicateKind::AliasRelate(..) => bug!("`AliasRelate` not allowed as assumption"),
ty::PredicateKind::WellFormed(..) ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
@ -395,7 +395,7 @@ fn generics_require_sized_self(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
| ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..)) | ty::PredicateKind::Clause(ty::Clause::TypeOutlives(..))
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
| ty::PredicateKind::TypeWellFormedFromEnv(..) => false, | ty::PredicateKind::TypeWellFormedFromEnv(..) => false,
} }

View file

@ -977,8 +977,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
ty::PredicateKind::TypeWellFormedFromEnv(..) => { ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for chalk") bug!("TypeWellFormedFromEnv is only used for chalk")
} }
ty::PredicateKind::AliasEq(..) => { ty::PredicateKind::AliasRelate(..) => {
bug!("AliasEq is only used for new solver") bug!("AliasRelate is only used for new solver")
} }
ty::PredicateKind::Ambiguous => Ok(EvaluatedToAmbig), ty::PredicateKind::Ambiguous => Ok(EvaluatedToAmbig),
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => { ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(ct, ty)) => {

View file

@ -191,8 +191,8 @@ pub fn predicate_obligations<'tcx>(
ty::PredicateKind::TypeWellFormedFromEnv(..) => { ty::PredicateKind::TypeWellFormedFromEnv(..) => {
bug!("TypeWellFormedFromEnv is only used for Chalk") bug!("TypeWellFormedFromEnv is only used for Chalk")
} }
ty::PredicateKind::AliasEq(..) => { ty::PredicateKind::AliasRelate(..) => {
bug!("We should only wf check where clauses and `AliasEq` is not a `Clause`") bug!("We should only wf check where clauses and `AliasRelate` is not a `Clause`")
} }
} }
@ -936,7 +936,7 @@ pub(crate) fn required_region_bounds<'tcx>(
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => None, | ty::PredicateKind::TypeWellFormedFromEnv(..) => None,
ty::PredicateKind::Clause(ty::Clause::TypeOutlives(ty::OutlivesPredicate( ty::PredicateKind::Clause(ty::Clause::TypeOutlives(ty::OutlivesPredicate(
ref t, ref t,

View file

@ -119,7 +119,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::InEnvironment<chalk_ir::Goal<RustInterner<'
}, },
ty::PredicateKind::ObjectSafe(..) ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)
| ty::PredicateKind::Coerce(..) | ty::PredicateKind::Coerce(..)
@ -215,7 +215,7 @@ impl<'tcx> LowerInto<'tcx, chalk_ir::GoalData<RustInterner<'tcx>>> for ty::Predi
// some of these in terms of chalk operations. // some of these in terms of chalk operations.
ty::PredicateKind::ClosureKind(..) ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::Coerce(..) | ty::PredicateKind::Coerce(..)
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
@ -652,7 +652,7 @@ impl<'tcx> LowerInto<'tcx, Option<chalk_ir::QuantifiedWhereClause<RustInterner<'
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None, ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None,
ty::PredicateKind::ObjectSafe(..) ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)
| ty::PredicateKind::Coerce(..) | ty::PredicateKind::Coerce(..)
@ -787,7 +787,7 @@ impl<'tcx> LowerInto<'tcx, Option<chalk_solve::rust_ir::QuantifiedInlineBound<Ru
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None, ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None,
ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..)) ty::PredicateKind::Clause(ty::Clause::RegionOutlives(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)
| ty::PredicateKind::Subtype(..) | ty::PredicateKind::Subtype(..)

View file

@ -86,7 +86,7 @@ fn compute_implied_outlives_bounds<'tcx>(
if obligation.predicate.has_non_region_infer() { if obligation.predicate.has_non_region_infer() {
match obligation.predicate.kind().skip_binder() { match obligation.predicate.kind().skip_binder() {
ty::PredicateKind::Clause(ty::Clause::Projection(..)) ty::PredicateKind::Clause(ty::Clause::Projection(..))
| ty::PredicateKind::AliasEq(..) => { | ty::PredicateKind::AliasRelate(..) => {
ocx.register_obligation(obligation.clone()); ocx.register_obligation(obligation.clone());
} }
_ => {} _ => {}
@ -110,7 +110,7 @@ fn compute_implied_outlives_bounds<'tcx>(
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::Ambiguous | ty::PredicateKind::Ambiguous
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => {} | ty::PredicateKind::TypeWellFormedFromEnv(..) => {}
// We need to search through *all* WellFormed predicates // We need to search through *all* WellFormed predicates

View file

@ -61,7 +61,7 @@ fn not_outlives_predicate(p: ty::Predicate<'_>) -> bool {
ty::PredicateKind::Clause(ty::Clause::Trait(..)) ty::PredicateKind::Clause(ty::Clause::Trait(..))
| ty::PredicateKind::Clause(ty::Clause::Projection(..)) | ty::PredicateKind::Clause(ty::Clause::Projection(..))
| ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) | ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..))
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::WellFormed(..) | ty::PredicateKind::WellFormed(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)

View file

@ -324,7 +324,7 @@ pub(crate) fn clean_predicate<'tcx>(
ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None, ty::PredicateKind::Clause(ty::Clause::ConstArgHasType(..)) => None,
ty::PredicateKind::Subtype(..) ty::PredicateKind::Subtype(..)
| ty::PredicateKind::AliasEq(..) | ty::PredicateKind::AliasRelate(..)
| ty::PredicateKind::Coerce(..) | ty::PredicateKind::Coerce(..)
| ty::PredicateKind::ObjectSafe(..) | ty::PredicateKind::ObjectSafe(..)
| ty::PredicateKind::ClosureKind(..) | ty::PredicateKind::ClosureKind(..)

View file

@ -37,7 +37,7 @@ pub fn is_min_const_fn<'tcx>(tcx: TyCtxt<'tcx>, body: &Body<'tcx>, msrv: &Msrv)
| ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEvaluatable(..)
| ty::PredicateKind::ConstEquate(..) | ty::PredicateKind::ConstEquate(..)
| ty::PredicateKind::TypeWellFormedFromEnv(..) => continue, | ty::PredicateKind::TypeWellFormedFromEnv(..) => continue,
ty::PredicateKind::AliasEq(..) => panic!("alias eq predicate on function: {predicate:#?}"), ty::PredicateKind::AliasRelate(..) => panic!("alias relate predicate on function: {predicate:#?}"),
ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {predicate:#?}"), ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {predicate:#?}"),
ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {predicate:#?}"), ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {predicate:#?}"),
ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {predicate:#?}"), ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {predicate:#?}"),