@@ -11,14 +11,16 @@ use crate::ty::{
11
11
TypeVisitor ,
12
12
} ;
13
13
14
+ pub mod inspect;
15
+
14
16
pub type EvaluationCache < ' tcx > = Cache < CanonicalInput < ' tcx > , QueryResult < ' tcx > > ;
15
17
16
18
/// A goal is a statement, i.e. `predicate`, we want to prove
17
19
/// given some assumptions, i.e. `param_env`.
18
20
///
19
21
/// Most of the time the `param_env` contains the `where`-bounds of the function
20
22
/// 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 ) ]
22
24
pub struct Goal < ' tcx , P > {
23
25
pub predicate : P ,
24
26
pub param_env : ty:: ParamEnv < ' tcx > ,
@@ -39,15 +41,15 @@ impl<'tcx, P> Goal<'tcx, P> {
39
41
}
40
42
}
41
43
42
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
44
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
43
45
pub struct Response < ' tcx > {
44
46
pub certainty : Certainty ,
45
47
pub var_values : CanonicalVarValues < ' tcx > ,
46
48
/// Additional constraints returned by this query.
47
49
pub external_constraints : ExternalConstraints < ' tcx > ,
48
50
}
49
51
50
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
52
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
51
53
pub enum Certainty {
52
54
Yes ,
53
55
Maybe ( MaybeCause ) ,
@@ -86,7 +88,7 @@ impl Certainty {
86
88
}
87
89
88
90
/// 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 ) ]
90
92
pub enum MaybeCause {
91
93
/// We failed due to ambiguity. This ambiguity can either
92
94
/// be a true ambiguity, i.e. there are multiple different answers,
@@ -96,20 +98,20 @@ pub enum MaybeCause {
96
98
Overflow ,
97
99
}
98
100
99
- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , TypeFoldable , TypeVisitable ) ]
101
+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Hash , HashStable , TypeFoldable , TypeVisitable ) ]
100
102
pub struct QueryInput < ' tcx , T > {
101
103
pub goal : Goal < ' tcx , T > ,
102
104
pub anchor : DefiningAnchor ,
103
105
pub predefined_opaques_in_body : PredefinedOpaques < ' tcx > ,
104
106
}
105
107
106
108
/// Additional constraints returned on success.
107
- #[ derive( Debug , PartialEq , Eq , Clone , Hash , Default ) ]
109
+ #[ derive( Debug , PartialEq , Eq , Clone , Hash , HashStable , Default ) ]
108
110
pub struct PredefinedOpaquesData < ' tcx > {
109
111
pub opaque_types : Vec < ( ty:: OpaqueTypeKey < ' tcx > , Ty < ' tcx > ) > ,
110
112
}
111
113
112
- #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash ) ]
114
+ #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash , HashStable ) ]
113
115
pub struct PredefinedOpaques < ' tcx > ( pub ( crate ) Interned < ' tcx , PredefinedOpaquesData < ' tcx > > ) ;
114
116
115
117
impl < ' tcx > std:: ops:: Deref for PredefinedOpaques < ' tcx > {
@@ -132,7 +134,7 @@ pub type CanonicalResponse<'tcx> = Canonical<'tcx, Response<'tcx>>;
132
134
/// solver, merge the two responses again.
133
135
pub type QueryResult < ' tcx > = Result < CanonicalResponse < ' tcx > , NoSolution > ;
134
136
135
- #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash ) ]
137
+ #[ derive( Debug , PartialEq , Eq , Copy , Clone , Hash , HashStable ) ]
136
138
pub struct ExternalConstraints < ' tcx > ( pub ( crate ) Interned < ' tcx , ExternalConstraintsData < ' tcx > > ) ;
137
139
138
140
impl < ' tcx > std:: ops:: Deref for ExternalConstraints < ' tcx > {
@@ -144,7 +146,7 @@ impl<'tcx> std::ops::Deref for ExternalConstraints<'tcx> {
144
146
}
145
147
146
148
/// Additional constraints returned on success.
147
- #[ derive( Debug , PartialEq , Eq , Clone , Hash , Default ) ]
149
+ #[ derive( Debug , PartialEq , Eq , Clone , Hash , HashStable , Default ) ]
148
150
pub struct ExternalConstraintsData < ' tcx > {
149
151
// FIXME: implement this.
150
152
pub region_constraints : QueryRegionConstraints < ' tcx > ,
0 commit comments