@@ -9,8 +9,8 @@ extern crate self as chalk_ir;
9
9
use crate :: cast:: { Cast , CastTo , Caster } ;
10
10
use crate :: fold:: shift:: Shift ;
11
11
use 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 } ;
14
14
use std:: marker:: PhantomData ;
15
15
use std:: ops:: ControlFlow ;
16
16
@@ -147,7 +147,7 @@ impl Variance {
147
147
}
148
148
}
149
149
150
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
150
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
151
151
/// The set of assumptions we've made so far, and the current number of
152
152
/// universal (forall) quantifiers we're within.
153
153
pub struct Environment < I : Interner > {
@@ -197,7 +197,7 @@ impl<I: Interner> Environment<I> {
197
197
}
198
198
199
199
/// 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 ) ]
201
201
#[ allow( missing_docs) ]
202
202
pub struct InEnvironment < G : HasInterner > {
203
203
pub environment : Environment < G :: Interner > ,
@@ -1021,7 +1021,7 @@ impl DebruijnIndex {
1021
1021
/// known. It is referenced within the type using `^1.0`, indicating
1022
1022
/// a bound type with debruijn index 1 (i.e., skipping through one
1023
1023
/// level of binder).
1024
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1024
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
1025
1025
pub struct DynTy < I : Interner > {
1026
1026
/// The unknown self type.
1027
1027
pub bounds : Binders < QuantifiedWhereClauses < I > > ,
@@ -1084,7 +1084,7 @@ pub struct FnSig<I: Interner> {
1084
1084
pub variadic : bool ,
1085
1085
}
1086
1086
/// 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 ) ]
1088
1088
pub struct FnSubst < I : Interner > ( pub Substitution < I > ) ;
1089
1089
1090
1090
impl < I : Interner > Copy for FnSubst < I > where I :: InternedSubstitution : Copy { }
@@ -1516,7 +1516,7 @@ impl<I: Interner> GenericArg<I> {
1516
1516
}
1517
1517
1518
1518
/// Generic arguments data.
1519
- #[ derive( Clone , PartialEq , Eq , Hash , Visit , TypeFoldable , Zip ) ]
1519
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeVisitable , TypeFoldable , Zip ) ]
1520
1520
pub enum GenericArgData < I : Interner > {
1521
1521
/// Type argument
1522
1522
Ty ( Ty < I > ) ,
@@ -1601,7 +1601,7 @@ impl<I: Interner, T> WithKind<I, T> {
1601
1601
pub type CanonicalVarKind < I : Interner > = WithKind < I , UniverseIndex > ;
1602
1602
1603
1603
/// 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 ) ]
1605
1605
pub enum AliasTy < I : Interner > {
1606
1606
/// An associated type projection.
1607
1607
Projection ( ProjectionTy < I > ) ,
@@ -1631,7 +1631,7 @@ impl<I: Interner> AliasTy<I> {
1631
1631
}
1632
1632
1633
1633
/// 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 ) ]
1635
1635
pub struct ProjectionTy < I : Interner > {
1636
1636
/// The id for the associated type member.
1637
1637
pub associated_ty_id : AssocTypeId < I > ,
@@ -1653,7 +1653,7 @@ impl<I: Interner> ProjectionTy<I> {
1653
1653
}
1654
1654
1655
1655
/// 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 ) ]
1657
1657
pub struct OpaqueTy < I : Interner > {
1658
1658
/// The id for the opaque type.
1659
1659
pub opaque_ty_id : OpaqueTyId < I > ,
@@ -1669,7 +1669,7 @@ impl<I: Interner> Copy for OpaqueTy<I> where I::InternedSubstitution: Copy {}
1669
1669
/// implements the trait.
1670
1670
/// - `<P0 as Trait<P1..Pn>>` (e.g. `i32 as Copy`), which casts the type to
1671
1671
/// that specific trait.
1672
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
1672
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
1673
1673
pub struct TraitRef < I : Interner > {
1674
1674
/// The trait id.
1675
1675
pub trait_id : TraitId < I > ,
@@ -1706,7 +1706,7 @@ impl<I: Interner> TraitRef<I> {
1706
1706
1707
1707
/// Lifetime outlives, which for `'a: 'b`` checks that the lifetime `'a`
1708
1708
/// 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 ) ]
1710
1710
#[ allow( missing_docs) ]
1711
1711
pub struct LifetimeOutlives < I : Interner > {
1712
1712
pub a : Lifetime < I > ,
@@ -1717,7 +1717,7 @@ impl<I: Interner> Copy for LifetimeOutlives<I> where I::InternedLifetime: Copy {
1717
1717
1718
1718
/// Type outlives, which for `T: 'a` checks that the type `T`
1719
1719
/// 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 ) ]
1721
1721
pub struct TypeOutlives < I : Interner > {
1722
1722
/// The type which must outlive the given lifetime.
1723
1723
pub ty : Ty < I > ,
@@ -1754,7 +1754,7 @@ where
1754
1754
}
1755
1755
1756
1756
/// 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 ) ]
1758
1758
pub enum WellFormed < I : Interner > {
1759
1759
/// A predicate which is true when some trait ref is well-formed.
1760
1760
/// For example, given the following trait definitions:
@@ -1792,7 +1792,7 @@ where
1792
1792
}
1793
1793
1794
1794
/// 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 ) ]
1796
1796
pub enum FromEnv < I : Interner > {
1797
1797
/// A predicate which enables deriving everything which should be true if we *know* that
1798
1798
/// 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> {
1990
1990
}
1991
1991
1992
1992
/// 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 ) ]
1994
1994
#[ allow( missing_docs) ]
1995
1995
pub struct EqGoal < I : Interner > {
1996
1996
pub a : GenericArg < I > ,
@@ -2000,7 +2000,7 @@ pub struct EqGoal<I: Interner> {
2000
2000
impl < I : Interner > Copy for EqGoal < I > where I :: InternedGenericArg : Copy { }
2001
2001
2002
2002
/// 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 ) ]
2004
2004
#[ allow( missing_docs) ]
2005
2005
pub struct SubtypeGoal < I : Interner > {
2006
2006
pub a : Ty < I > ,
@@ -2013,7 +2013,7 @@ impl<I: Interner> Copy for SubtypeGoal<I> where I::InternedType: Copy {}
2013
2013
/// type. A projection `T::Foo` normalizes to the type `U` if we can
2014
2014
/// **match it to an impl** and that impl has a `type Foo = V` where
2015
2015
/// `U = V`.
2016
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , Zip ) ]
2016
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , Zip ) ]
2017
2017
#[ allow( missing_docs) ]
2018
2018
pub struct Normalize < I : Interner > {
2019
2019
pub alias : AliasTy < I > ,
@@ -2028,7 +2028,7 @@ where
2028
2028
}
2029
2029
2030
2030
/// 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 ) ]
2032
2032
#[ allow( missing_docs) ]
2033
2033
pub struct AliasEq < I : Interner > {
2034
2034
pub alias : AliasTy < I > ,
@@ -2291,7 +2291,7 @@ where
2291
2291
/// Represents one clause of the form `consequence :- conditions` where
2292
2292
/// `conditions = cond_1 && cond_2 && ...` is the conjunction of the individual
2293
2293
/// conditions.
2294
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2294
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
2295
2295
pub struct ProgramClauseImplication < I : Interner > {
2296
2296
/// The consequence of the clause, which holds if the conditions holds.
2297
2297
pub consequence : DomainGoal < I > ,
@@ -2571,7 +2571,7 @@ where
2571
2571
}
2572
2572
}
2573
2573
2574
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2574
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
2575
2575
/// A general goal; this is the full range of questions you can pose to Chalk.
2576
2576
pub enum GoalData < I : Interner > {
2577
2577
/// Introduces a binding at depth 0, shifting other bindings up
@@ -2654,7 +2654,7 @@ pub enum QuantifierKind {
2654
2654
/// lifetime constraints, instead gathering them up to return with our solution
2655
2655
/// for later checking. This allows for decoupling between type and region
2656
2656
/// checking in the compiler.
2657
- #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner , Zip ) ]
2657
+ #[ derive( Clone , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner , Zip ) ]
2658
2658
pub enum Constraint < I : Interner > {
2659
2659
/// Outlives constraint `'a: 'b`, indicating that the value of `'a` must be
2660
2660
/// a superset of the value of `'b`.
@@ -3037,7 +3037,7 @@ impl<I: Interner> Variances<I> {
3037
3037
/// substitution stores the values for the query's unknown variables,
3038
3038
/// and the constraints represents any region constraints that must
3039
3039
/// additionally be solved.
3040
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , Visit , HasInterner ) ]
3040
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , TypeFoldable , TypeVisitable , HasInterner ) ]
3041
3041
pub struct ConstrainedSubst < I : Interner > {
3042
3042
/// The substitution that is being constrained.
3043
3043
///
@@ -3049,7 +3049,7 @@ pub struct ConstrainedSubst<I: Interner> {
3049
3049
}
3050
3050
3051
3051
/// 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 ) ]
3053
3053
pub struct AnswerSubst < I : Interner > {
3054
3054
/// The substitution result.
3055
3055
///
0 commit comments