@@ -7,7 +7,7 @@ use crate::cast::{Cast, CastTo};
77use crate :: fold:: shift:: Shift ;
88use crate :: fold:: { Fold , Folder , Subst , SuperFold } ;
99use crate :: visit:: { SuperVisit , Visit , VisitExt , VisitResult , Visitor } ;
10- use chalk_derive:: { Fold , HasInterner , SuperVisit , Visit } ;
10+ use chalk_derive:: { Fold , HasInterner , SuperVisit , Visit , Zip } ;
1111use chalk_engine:: fallible:: * ;
1212use std:: iter;
1313use std:: marker:: PhantomData ;
@@ -602,7 +602,7 @@ impl DebruijnIndex {
602602/// known. It is referenced within the type using `^1`, indicating
603603/// a bound type with debruijn index 1 (i.e., skipping through one
604604/// level of binder).
605- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
605+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
606606pub struct DynTy < I : Interner > {
607607 pub bounds : Binders < QuantifiedWhereClauses < I > > ,
608608}
@@ -719,7 +719,7 @@ impl PlaceholderIndex {
719719}
720720
721721// Fold derive intentionally omitted, folded through Ty
722- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
722+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
723723pub struct ApplicationTy < I : Interner > {
724724 pub name : TypeName < I > ,
725725 pub substitution : Substitution < I > ,
@@ -884,7 +884,7 @@ impl<I: Interner> ParameterData<I> {
884884 }
885885}
886886
887- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
887+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
888888pub enum AliasTy < I : Interner > {
889889 Projection ( ProjectionTy < I > ) ,
890890 Opaque ( OpaqueTy < I > ) ,
@@ -908,19 +908,19 @@ impl<I: Interner> AliasTy<I> {
908908 }
909909}
910910
911- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
911+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
912912pub struct ProjectionTy < I : Interner > {
913913 pub associated_ty_id : AssocTypeId < I > ,
914914 pub substitution : Substitution < I > ,
915915}
916916
917- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
917+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
918918pub struct OpaqueTy < I : Interner > {
919919 pub opaque_ty_id : OpaqueTyId < I > ,
920920 pub substitution : Substitution < I > ,
921921}
922922
923- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
923+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
924924pub struct TraitRef < I : Interner > {
925925 pub trait_id : TraitId < I > ,
926926 pub substitution : Substitution < I > ,
@@ -948,13 +948,13 @@ impl<I: Interner> TraitRef<I> {
948948}
949949
950950/// Where clauses that can be written by a Rust programmer.
951- #[ derive( Clone , PartialEq , Eq , Hash , Fold , SuperVisit , HasInterner ) ]
951+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , SuperVisit , HasInterner , Zip ) ]
952952pub enum WhereClause < I : Interner > {
953953 Implemented ( TraitRef < I > ) ,
954954 AliasEq ( AliasEq < I > ) ,
955955}
956956
957- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
957+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
958958pub enum WellFormed < I : Interner > {
959959 /// A predicate which is true is some trait ref is well-formed.
960960 /// For example, given the following trait definitions:
@@ -984,7 +984,7 @@ pub enum WellFormed<I: Interner> {
984984 Ty ( Ty < I > ) ,
985985}
986986
987- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
987+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
988988pub enum FromEnv < I : Interner > {
989989 /// A predicate which enables deriving everything which should be true if we *know* that
990990 /// some trait ref is well-formed. For example given the above trait definitions, we can use
@@ -1016,7 +1016,7 @@ pub enum FromEnv<I: Interner> {
10161016/// A "domain goal" is a goal that is directly about Rust, rather than a pure
10171017/// logical statement. As much as possible, the Chalk solver should avoid
10181018/// decomposing this enum, and instead treat its values opaquely.
1019- #[ derive( Clone , PartialEq , Eq , Hash , Fold , SuperVisit , HasInterner ) ]
1019+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , SuperVisit , HasInterner , Zip ) ]
10201020pub enum DomainGoal < I : Interner > {
10211021 Holds ( WhereClause < I > ) ,
10221022
@@ -1201,7 +1201,7 @@ impl<I: Interner> DomainGoal<I> {
12011201 }
12021202}
12031203
1204- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit ) ]
1204+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , Zip ) ]
12051205pub struct EqGoal < I : Interner > {
12061206 pub a : Parameter < I > ,
12071207 pub b : Parameter < I > ,
@@ -1211,14 +1211,14 @@ pub struct EqGoal<I: Interner> {
12111211/// type. A projection `T::Foo` normalizes to the type `U` if we can
12121212/// **match it to an impl** and that impl has a `type Foo = V` where
12131213/// `U = V`.
1214- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit ) ]
1214+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , Zip ) ]
12151215pub struct Normalize < I : Interner > {
12161216 pub alias : AliasTy < I > ,
12171217 pub ty : Ty < I > ,
12181218}
12191219
12201220/// Proves **equality** between an alias and a type.
1221- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit ) ]
1221+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , Zip ) ]
12221222pub struct AliasEq < I : Interner > {
12231223 pub alias : AliasTy < I > ,
12241224 pub ty : Ty < I > ,
@@ -1398,7 +1398,7 @@ where
13981398/// Represents one clause of the form `consequence :- conditions` where
13991399/// `conditions = cond_1 && cond_2 && ...` is the conjunction of the individual
14001400/// conditions.
1401- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
1401+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
14021402pub struct ProgramClauseImplication < I : Interner > {
14031403 pub consequence : DomainGoal < I > ,
14041404 pub conditions : Goals < I > ,
@@ -1421,7 +1421,7 @@ impl std::ops::BitAnd for ClausePriority {
14211421 }
14221422}
14231423
1424- #[ derive( Clone , PartialEq , Eq , Hash , Fold , HasInterner ) ]
1424+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , HasInterner , Zip ) ]
14251425pub enum ProgramClauseData < I : Interner > {
14261426 Implies ( ProgramClauseImplication < I > ) ,
14271427 ForAll ( Binders < ProgramClauseImplication < I > > ) ,
@@ -1860,7 +1860,7 @@ where
18601860 }
18611861}
18621862
1863- #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner ) ]
1863+ #[ derive( Clone , PartialEq , Eq , Hash , Fold , Visit , HasInterner , Zip ) ]
18641864/// A general goal; this is the full range of questions you can pose to Chalk.
18651865pub enum GoalData < I : Interner > {
18661866 /// Introduces a binding at depth 0, shifting other bindings up
0 commit comments