@@ -728,6 +728,26 @@ impl<I: Interner> TyKind<I> {
728728 dyn_flags |= alias_eq. alias . compute_flags ( interner) ;
729729 dyn_flags |= alias_eq. ty . data ( interner) . flags ;
730730 }
731+ WhereClause :: ConstEq ( ct_eq) => {
732+ // TODO it's not a type projection but is that fine?
733+ // TODO do I need to add other flags here?
734+ dyn_flags |= TypeFlags :: HAS_TY_PROJECTION ;
735+ let const_data = ct_eq. ct . data ( interner) ;
736+ dyn_flags |= const_data. ty . data ( interner) . flags
737+ | match const_data. value {
738+ ConstValue :: BoundVar ( _) | ConstValue :: Concrete ( _) => {
739+ TypeFlags :: empty ( )
740+ }
741+ ConstValue :: InferenceVar ( _) => {
742+ TypeFlags :: HAS_CT_INFER
743+ | TypeFlags :: STILL_FURTHER_SPECIALIZABLE
744+ }
745+ ConstValue :: Placeholder ( _) => {
746+ TypeFlags :: HAS_CT_PLACEHOLDER
747+ | TypeFlags :: STILL_FURTHER_SPECIALIZABLE
748+ }
749+ }
750+ }
731751 WhereClause :: LifetimeOutlives ( lifetime_outlives) => {
732752 dyn_flags |= lifetime_outlives. a . compute_flags ( interner)
733753 | lifetime_outlives. b . compute_flags ( interner) ;
@@ -1743,13 +1763,16 @@ pub enum WhereClause<I: Interner> {
17431763 LifetimeOutlives ( LifetimeOutlives < I > ) ,
17441764 /// Type outlives a lifetime.
17451765 TypeOutlives ( TypeOutlives < I > ) ,
1766+ /// Const is equal to another const
1767+ ConstEq ( ConstEq < I > ) ,
17461768}
17471769
17481770impl < I : Interner > Copy for WhereClause < I >
17491771where
17501772 I :: InternedSubstitution : Copy ,
17511773 I :: InternedLifetime : Copy ,
17521774 I :: InternedType : Copy ,
1775+ I :: InternedConst : Copy ,
17531776{
17541777}
17551778
@@ -1908,6 +1931,7 @@ where
19081931 I :: InternedSubstitution : Copy ,
19091932 I :: InternedLifetime : Copy ,
19101933 I :: InternedType : Copy ,
1934+ I :: InternedConst : Copy ,
19111935{
19121936}
19131937
@@ -1939,6 +1963,7 @@ impl<I: Interner> WhereClause<I> {
19391963 match self {
19401964 WhereClause :: Implemented ( trait_ref) => Some ( trait_ref. trait_id ) ,
19411965 WhereClause :: AliasEq ( _) => None ,
1966+ WhereClause :: ConstEq ( _) => None ,
19421967 WhereClause :: LifetimeOutlives ( _) => None ,
19431968 WhereClause :: TypeOutlives ( _) => None ,
19441969 }
@@ -2046,6 +2071,26 @@ impl<I: Interner> HasInterner for AliasEq<I> {
20462071 type Interner = I ;
20472072}
20482073
2074+ /// Proves **equality** between an alias and a type.
2075+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , Zip ) ]
2076+ #[ allow( missing_docs) ]
2077+ pub struct ConstEq < I : Interner > {
2078+ /// The id for the associated type member.
2079+ pub term : AssocItemId < I > ,
2080+
2081+ pub ct : Const < I > ,
2082+ }
2083+ impl < I : Interner > Copy for ConstEq < I >
2084+ where
2085+ I :: InternedSubstitution : Copy ,
2086+ I :: InternedConst : Copy ,
2087+ {
2088+ }
2089+
2090+ impl < I : Interner > HasInterner for ConstEq < I > {
2091+ type Interner = I ;
2092+ }
2093+
20492094/// Indicates that the `value` is universally quantified over `N`
20502095/// parameters of the given kinds, where `N == self.binders.len()`. A
20512096/// variable with depth `i < N` refers to the value at
@@ -2610,6 +2655,7 @@ pub enum GoalData<I: Interner> {
26102655impl < I : Interner > Copy for GoalData < I >
26112656where
26122657 I :: InternedType : Copy ,
2658+ I :: InternedConst : Copy ,
26132659 I :: InternedLifetime : Copy ,
26142660 I :: InternedGenericArg : Copy ,
26152661 I :: InternedSubstitution : Copy ,
0 commit comments