@@ -9,8 +9,8 @@ extern crate self as chalk_ir;
99use crate :: cast:: { Cast , CastTo , Caster } ;
1010use crate :: fold:: shift:: Shift ;
1111use crate :: fold:: { Folder , Subst , TypeFoldable , TypeSuperFoldable } ;
12- use crate :: visit:: { SuperVisit , Visit , VisitExt , Visitor } ;
13- use chalk_derive:: { HasInterner , SuperVisit , TypeFoldable , Visit , Zip } ;
12+ use crate :: visit:: { SuperVisit , TypeVisitable , VisitExt , Visitor } ;
13+ use chalk_derive:: { HasInterner , SuperVisit , TypeFoldable , TypeVisitable , Zip } ;
1414use std:: marker:: PhantomData ;
1515use std:: ops:: ControlFlow ;
1616
@@ -147,7 +147,7 @@ impl Variance {
147147 }
148148}
149149
150- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
150+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
151151/// The set of assumptions we've made so far, and the current number of
152152/// universal (forall) quantifiers we're within.
153153pub struct Environment < I : Interner > {
@@ -197,7 +197,7 @@ impl<I: Interner> Environment<I> {
197197}
198198
199199/// A goal with an environment to solve it in.
200- #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , Visit ) ]
200+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable ) ]
201201#[ allow( missing_docs) ]
202202pub struct InEnvironment < G : HasInterner > {
203203 pub environment : Environment < G :: Interner > ,
@@ -1021,7 +1021,7 @@ impl DebruijnIndex {
10211021/// known. It is referenced within the type using `^1.0`, indicating
10221022/// a bound type with debruijn index 1 (i.e., skipping through one
10231023/// level of binder).
1024- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1024+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
10251025pub struct DynTy < I : Interner > {
10261026 /// The unknown self type.
10271027 pub bounds : Binders < QuantifiedWhereClauses < I > > ,
@@ -1084,7 +1084,7 @@ pub struct FnSig<I: Interner> {
10841084 pub variadic : bool ,
10851085}
10861086/// A wrapper for the substs on a Fn.
1087- #[ derive( Clone , PartialEq , Eq , Hash , HasInterner , TypeFoldable , Visit ) ]
1087+ #[ derive( Clone , PartialEq , Eq , Hash , HasInterner , TypeFoldable , TypeVisitable ) ]
10881088pub struct FnSubst < I : Interner > ( pub Substitution < I > ) ;
10891089
10901090impl < I : Interner > Copy for FnSubst < I > where I :: InternedSubstitution : Copy { }
@@ -1516,7 +1516,7 @@ impl<I: Interner> GenericArg<I> {
15161516}
15171517
15181518/// Generic arguments data.
1519- #[ derive( Clone , PartialEq , Eq , Hash , Visit , TypeFoldable , Zip ) ]
1519+ #[ derive( Clone , PartialEq , Eq , Hash , TypeVisitable , TypeFoldable , Zip ) ]
15201520pub enum GenericArgData < I : Interner > {
15211521 /// Type argument
15221522 Ty ( Ty < I > ) ,
@@ -1601,7 +1601,7 @@ impl<I: Interner, T> WithKind<I, T> {
16011601pub type CanonicalVarKind < I : Interner > = WithKind < I , UniverseIndex > ;
16021602
16031603/// An alias, which is a trait indirection such as a projection or opaque type.
1604- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
1604+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
16051605pub enum AliasTy < I : Interner > {
16061606 /// An associated type projection.
16071607 Projection ( ProjectionTy < I > ) ,
@@ -1631,7 +1631,7 @@ impl<I: Interner> AliasTy<I> {
16311631}
16321632
16331633/// A projection `<P0 as TraitName<P1..Pn>>::AssocItem<Pn+1..Pm>`.
1634- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1634+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
16351635pub struct ProjectionTy < I : Interner > {
16361636 /// The id for the associated type member.
16371637 pub associated_ty_id : AssocTypeId < I > ,
@@ -1653,7 +1653,7 @@ impl<I: Interner> ProjectionTy<I> {
16531653}
16541654
16551655/// An opaque type `opaque type T<..>: Trait = HiddenTy`.
1656- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1656+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
16571657pub struct OpaqueTy < I : Interner > {
16581658 /// The id for the opaque type.
16591659 pub opaque_ty_id : OpaqueTyId < I > ,
@@ -1669,7 +1669,7 @@ impl<I: Interner> Copy for OpaqueTy<I> where I::InternedSubstitution: Copy {}
16691669/// implements the trait.
16701670/// - `<P0 as Trait<P1..Pn>>` (e.g. `i32 as Copy`), which casts the type to
16711671/// that specific trait.
1672- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1672+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
16731673pub struct TraitRef < I : Interner > {
16741674 /// The trait id.
16751675 pub trait_id : TraitId < I > ,
@@ -1706,7 +1706,7 @@ impl<I: Interner> TraitRef<I> {
17061706
17071707/// Lifetime outlives, which for `'a: 'b`` checks that the lifetime `'a`
17081708/// is a superset of the value of `'b`.
1709- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
1709+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
17101710#[ allow( missing_docs) ]
17111711pub struct LifetimeOutlives < I : Interner > {
17121712 pub a : Lifetime < I > ,
@@ -1717,7 +1717,7 @@ impl<I: Interner> Copy for LifetimeOutlives<I> where I::InternedLifetime: Copy {
17171717
17181718/// Type outlives, which for `T: 'a` checks that the type `T`
17191719/// lives at least as long as the lifetime `'a`
1720- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
1720+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
17211721pub struct TypeOutlives < I : Interner > {
17221722 /// The type which must outlive the given lifetime.
17231723 pub ty : Ty < I > ,
@@ -1754,7 +1754,7 @@ where
17541754}
17551755
17561756/// Checks whether a type or trait ref is well-formed.
1757- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
1757+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
17581758pub enum WellFormed < I : Interner > {
17591759 /// A predicate which is true when some trait ref is well-formed.
17601760 /// For example, given the following trait definitions:
@@ -1792,7 +1792,7 @@ where
17921792}
17931793
17941794/// Checks whether a type or trait ref can be derived from the contents of the environment.
1795- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
1795+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
17961796pub enum FromEnv < I : Interner > {
17971797 /// A predicate which enables deriving everything which should be true if we *know* that
17981798 /// some trait ref is well-formed. For example given the above trait definitions, we can use
@@ -1990,7 +1990,7 @@ impl<I: Interner> DomainGoal<I> {
19901990}
19911991
19921992/// Equality goal: tries to prove that two values are equal.
1993- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , Zip ) ]
1993+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , Zip ) ]
19941994#[ allow( missing_docs) ]
19951995pub struct EqGoal < I : Interner > {
19961996 pub a : GenericArg < I > ,
@@ -2000,7 +2000,7 @@ pub struct EqGoal<I: Interner> {
20002000impl < I : Interner > Copy for EqGoal < I > where I :: InternedGenericArg : Copy { }
20012001
20022002/// Subtype goal: tries to prove that `a` is a subtype of `b`
2003- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , Zip ) ]
2003+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , Zip ) ]
20042004#[ allow( missing_docs) ]
20052005pub struct SubtypeGoal < I : Interner > {
20062006 pub a : Ty < I > ,
@@ -2013,7 +2013,7 @@ impl<I: Interner> Copy for SubtypeGoal<I> where I::InternedType: Copy {}
20132013/// type. A projection `T::Foo` normalizes to the type `U` if we can
20142014/// **match it to an impl** and that impl has a `type Foo = V` where
20152015/// `U = V`.
2016- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , Zip ) ]
2016+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , Zip ) ]
20172017#[ allow( missing_docs) ]
20182018pub struct Normalize < I : Interner > {
20192019 pub alias : AliasTy < I > ,
@@ -2028,7 +2028,7 @@ where
20282028}
20292029
20302030/// Proves **equality** between an alias and a type.
2031- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , Zip ) ]
2031+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , Zip ) ]
20322032#[ allow( missing_docs) ]
20332033pub struct AliasEq < I : Interner > {
20342034 pub alias : AliasTy < I > ,
@@ -2291,7 +2291,7 @@ where
22912291/// Represents one clause of the form `consequence :- conditions` where
22922292/// `conditions = cond_1 && cond_2 && ...` is the conjunction of the individual
22932293/// conditions.
2294- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2294+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
22952295pub struct ProgramClauseImplication < I : Interner > {
22962296 /// The consequence of the clause, which holds if the conditions holds.
22972297 pub consequence : DomainGoal < I > ,
@@ -2571,7 +2571,7 @@ where
25712571 }
25722572}
25732573
2574- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2574+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
25752575/// A general goal; this is the full range of questions you can pose to Chalk.
25762576pub enum GoalData < I : Interner > {
25772577 /// Introduces a binding at depth 0, shifting other bindings up
@@ -2654,7 +2654,7 @@ pub enum QuantifierKind {
26542654/// lifetime constraints, instead gathering them up to return with our solution
26552655/// for later checking. This allows for decoupling between type and region
26562656/// checking in the compiler.
2657- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2657+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
26582658pub enum Constraint < I : Interner > {
26592659 /// Outlives constraint `'a: 'b`, indicating that the value of `'a` must be
26602660 /// a superset of the value of `'b`.
@@ -3037,7 +3037,7 @@ impl<I: Interner> Variances<I> {
30373037/// substitution stores the values for the query's unknown variables,
30383038/// and the constraints represents any region constraints that must
30393039/// additionally be solved.
3040- #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
3040+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
30413041pub struct ConstrainedSubst < I : Interner > {
30423042 /// The substitution that is being constrained.
30433043 ///
@@ -3049,7 +3049,7 @@ pub struct ConstrainedSubst<I: Interner> {
30493049}
30503050
30513051/// The resulting substitution after solving a goal.
3052- #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
3052+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
30533053pub struct AnswerSubst < I : Interner > {
30543054 /// The substitution result.
30553055 ///
0 commit comments