@@ -11,14 +11,16 @@ use crate::ty::{
1111 TypeVisitor ,
1212} ;
1313
14+ pub mod inspect;
15+
1416pub type EvaluationCache < ' tcx > = Cache < CanonicalInput < ' tcx > , QueryResult < ' tcx > > ;
1517
1618/// A goal is a statement, i.e. `predicate`, we want to prove
1719/// given some assumptions, i.e. `param_env`.
1820///
1921/// Most of the time the `param_env` contains the `where`-bounds of the function
2022/// we're currently typechecking while the `predicate` is some trait bound.
21- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
23+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
2224pub struct Goal < ' tcx , P > {
2325 pub predicate : P ,
2426 pub param_env : ty:: ParamEnv < ' tcx > ,
@@ -39,15 +41,15 @@ impl<'tcx, P> Goal<'tcx, P> {
3941 }
4042}
4143
42- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
44+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
4345pub struct Response < ' tcx > {
4446 pub certainty : Certainty ,
4547 pub var_values : CanonicalVarValues < ' tcx > ,
4648 /// Additional constraints returned by this query.
4749 pub external_constraints : ExternalConstraints < ' tcx > ,
4850}
4951
50- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
52+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
5153pub enum Certainty {
5254 Yes ,
5355 Maybe ( MaybeCause ) ,
@@ -86,7 +88,7 @@ impl Certainty {
8688}
8789
8890/// Why we failed to evaluate a goal.
89- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
91+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
9092pub enum MaybeCause {
9193 /// We failed due to ambiguity. This ambiguity can either
9294 /// be a true ambiguity, i.e. there are multiple different answers,
@@ -96,20 +98,20 @@ pub enum MaybeCause {
9698 Overflow ,
9799}
98100
99- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
101+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
100102pub struct QueryInput < ' tcx , T > {
101103 pub goal : Goal < ' tcx , T > ,
102104 pub anchor : DefiningAnchor ,
103105 pub predefined_opaques_in_body : PredefinedOpaques < ' tcx > ,
104106}
105107
106108/// Additional constraints returned on success.
107- #[ derive( Debug , PartialEq , Eq , Clone , Hash , Default ) ]
109+ #[ derive( Debug , PartialEq , Eq , Clone , Hash , HashStable , Default ) ]
108110pub struct PredefinedOpaquesData < ' tcx > {
109111 pub opaque_types : Vec < ( ty:: OpaqueTypeKey < ' tcx > , Ty < ' tcx > ) > ,
110112}
111113
112- #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash ) ]
114+ #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash , HashStable ) ]
113115pub struct PredefinedOpaques < ' tcx > ( pub ( crate ) Interned < ' tcx , PredefinedOpaquesData < ' tcx > > ) ;
114116
115117impl < ' tcx > std:: ops:: Deref for PredefinedOpaques < ' tcx > {
@@ -132,7 +134,7 @@ pub type CanonicalResponse<'tcx> = Canonical<'tcx, Response<'tcx>>;
132134/// solver, merge the two responses again.
133135pub type QueryResult < ' tcx > = Result < CanonicalResponse < ' tcx > , NoSolution > ;
134136
135- #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash ) ]
137+ #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash , HashStable ) ]
136138pub struct ExternalConstraints < ' tcx > ( pub ( crate ) Interned < ' tcx , ExternalConstraintsData < ' tcx > > ) ;
137139
138140impl < ' tcx > std:: ops:: Deref for ExternalConstraints < ' tcx > {
@@ -144,7 +146,7 @@ impl<'tcx> std::ops::Deref for ExternalConstraints<'tcx> {
144146}
145147
146148/// Additional constraints returned on success.
147- #[ derive( Debug , PartialEq , Eq , Clone , Hash , Default ) ]
149+ #[ derive( Debug , PartialEq , Eq , Clone , Hash , HashStable , Default ) ]
148150pub struct ExternalConstraintsData < ' tcx > {
149151 // FIXME: implement this.
150152 pub region_constraints : QueryRegionConstraints < ' tcx > ,
0 commit comments