@@ -11,11 +11,7 @@ use crate::data_structures::HashMap;
11
11
use crate :: inherent:: * ;
12
12
use crate :: { self as ty, Interner , TypingMode , UniverseIndex } ;
13
13
14
- #[ derive_where( Clone ; I : Interner , V : Clone ) ]
15
- #[ derive_where( Hash ; I : Interner , V : Hash ) ]
16
- #[ derive_where( PartialEq ; I : Interner , V : PartialEq ) ]
17
- #[ derive_where( Eq ; I : Interner , V : Eq ) ]
18
- #[ derive_where( Debug ; I : Interner , V : fmt:: Debug ) ]
14
+ #[ derive_where( Clone , Hash , PartialEq , Debug ; I : Interner , V ) ]
19
15
#[ derive_where( Copy ; I : Interner , V : Copy ) ]
20
16
#[ cfg_attr(
21
17
feature = "nightly" ,
@@ -26,14 +22,12 @@ pub struct CanonicalQueryInput<I: Interner, V> {
26
22
pub typing_mode : TypingMode < I > ,
27
23
}
28
24
25
+ impl < I : Interner , V : Eq > Eq for CanonicalQueryInput < I , V > { }
26
+
29
27
/// A "canonicalized" type `V` is one where all free inference
30
28
/// variables have been rewritten to "canonical vars". These are
31
29
/// numbered starting from 0 in order of first appearance.
32
- #[ derive_where( Clone ; I : Interner , V : Clone ) ]
33
- #[ derive_where( Hash ; I : Interner , V : Hash ) ]
34
- #[ derive_where( PartialEq ; I : Interner , V : PartialEq ) ]
35
- #[ derive_where( Eq ; I : Interner , V : Eq ) ]
36
- #[ derive_where( Debug ; I : Interner , V : fmt:: Debug ) ]
30
+ #[ derive_where( Clone , Hash , PartialEq , Debug ; I : Interner , V ) ]
37
31
#[ derive_where( Copy ; I : Interner , V : Copy ) ]
38
32
#[ cfg_attr(
39
33
feature = "nightly" ,
@@ -45,6 +39,8 @@ pub struct Canonical<I: Interner, V> {
45
39
pub variables : I :: CanonicalVarKinds ,
46
40
}
47
41
42
+ impl < I : Interner , V : Eq > Eq for Canonical < I , V > { }
43
+
48
44
impl < I : Interner , V > Canonical < I , V > {
49
45
/// Allows you to map the `value` of a canonical while keeping the
50
46
/// same set of bound variables.
@@ -89,7 +85,7 @@ impl<I: Interner, V: fmt::Display> fmt::Display for Canonical<I, V> {
89
85
/// canonical value. This is sufficient information for code to create
90
86
/// a copy of the canonical value in some other inference context,
91
87
/// with fresh inference variables replacing the canonical values.
92
- #[ derive_where( Clone , Copy , Hash , PartialEq , Eq , Debug ; I : Interner ) ]
88
+ #[ derive_where( Clone , Copy , Hash , PartialEq , Debug ; I : Interner ) ]
93
89
#[ cfg_attr(
94
90
feature = "nightly" ,
95
91
derive( Decodable_NoContext , Encodable_NoContext , HashStable_NoContext )
@@ -116,6 +112,8 @@ pub enum CanonicalVarKind<I: Interner> {
116
112
PlaceholderConst ( I :: PlaceholderConst ) ,
117
113
}
118
114
115
+ impl < I : Interner > Eq for CanonicalVarKind < I > { }
116
+
119
117
impl < I : Interner > CanonicalVarKind < I > {
120
118
pub fn universe ( self ) -> UniverseIndex {
121
119
match self {
@@ -223,7 +221,7 @@ pub enum CanonicalTyVarKind {
223
221
/// vectors with the original values that were replaced by canonical
224
222
/// variables. You will need to supply it later to instantiate the
225
223
/// canonicalized query response.
226
- #[ derive_where( Clone , Copy , Hash , PartialEq , Eq , Debug ; I : Interner ) ]
224
+ #[ derive_where( Clone , Copy , Hash , PartialEq , Debug ; I : Interner ) ]
227
225
#[ cfg_attr(
228
226
feature = "nightly" ,
229
227
derive( Encodable_NoContext , Decodable_NoContext , HashStable_NoContext )
@@ -233,6 +231,8 @@ pub struct CanonicalVarValues<I: Interner> {
233
231
pub var_values : I :: GenericArgs ,
234
232
}
235
233
234
+ impl < I : Interner > Eq for CanonicalVarValues < I > { }
235
+
236
236
impl < I : Interner > CanonicalVarValues < I > {
237
237
pub fn is_identity ( & self ) -> bool {
238
238
self . var_values . iter ( ) . enumerate ( ) . all ( |( bv, arg) | match arg. kind ( ) {
0 commit comments