@@ -113,7 +113,7 @@ pub enum Pattern {
113
113
}
114
114
115
115
/// Represents a constant in the type system
116
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
116
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
117
117
pub struct TyConst {
118
118
pub ( crate ) kind : TyConstKind ,
119
119
pub id : TyConstId ,
@@ -140,7 +140,7 @@ impl TyConst {
140
140
}
141
141
}
142
142
143
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
143
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
144
144
pub enum TyConstKind {
145
145
Param ( ParamConst ) ,
146
146
Bound ( DebruijnIndex , BoundVar ) ,
@@ -151,11 +151,11 @@ pub enum TyConstKind {
151
151
ZSTValue ( Ty ) ,
152
152
}
153
153
154
- #[ derive( Copy , Clone , Debug , Eq , PartialEq , Serialize ) ]
154
+ #[ derive( Copy , Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
155
155
pub struct TyConstId ( usize ) ;
156
156
157
157
/// Represents a constant in MIR
158
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
158
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
159
159
pub struct MirConst {
160
160
/// The constant kind.
161
161
pub ( crate ) kind : ConstantKind ,
@@ -212,17 +212,17 @@ impl MirConst {
212
212
}
213
213
}
214
214
215
- #[ derive( Clone , Copy , Debug , PartialEq , Eq , Serialize ) ]
215
+ #[ derive( Clone , Copy , Debug , PartialEq , Eq , Hash , Serialize ) ]
216
216
pub struct MirConstId ( usize ) ;
217
217
218
218
type Ident = Opaque ;
219
219
220
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
220
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
221
221
pub struct Region {
222
222
pub kind : RegionKind ,
223
223
}
224
224
225
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
225
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
226
226
pub enum RegionKind {
227
227
ReEarlyParam ( EarlyParamRegion ) ,
228
228
ReBound ( DebruijnIndex , BoundRegion ) ,
@@ -233,29 +233,29 @@ pub enum RegionKind {
233
233
234
234
pub ( crate ) type DebruijnIndex = u32 ;
235
235
236
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
236
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
237
237
pub struct EarlyParamRegion {
238
238
pub index : u32 ,
239
239
pub name : Symbol ,
240
240
}
241
241
242
242
pub ( crate ) type BoundVar = u32 ;
243
243
244
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
244
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
245
245
pub struct BoundRegion {
246
246
pub var : BoundVar ,
247
247
pub kind : BoundRegionKind ,
248
248
}
249
249
250
250
pub ( crate ) type UniverseIndex = u32 ;
251
251
252
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
252
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
253
253
pub struct Placeholder < T > {
254
254
pub universe : UniverseIndex ,
255
255
pub bound : T ,
256
256
}
257
257
258
- #[ derive( Clone , Copy , PartialEq , Eq , Serialize ) ]
258
+ #[ derive( Clone , Copy , PartialEq , Eq , Hash , Serialize ) ]
259
259
pub struct Span ( usize ) ;
260
260
261
261
impl Debug for Span {
@@ -997,7 +997,7 @@ crate_def! {
997
997
}
998
998
999
999
/// A list of generic arguments.
1000
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1000
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1001
1001
pub struct GenericArgs ( pub Vec < GenericArgKind > ) ;
1002
1002
1003
1003
impl std:: ops:: Index < ParamTy > for GenericArgs {
@@ -1016,7 +1016,7 @@ impl std::ops::Index<ParamConst> for GenericArgs {
1016
1016
}
1017
1017
}
1018
1018
1019
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1019
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1020
1020
pub enum GenericArgKind {
1021
1021
Lifetime ( Region ) ,
1022
1022
Type ( Ty ) ,
@@ -1199,7 +1199,7 @@ pub enum BoundTyKind {
1199
1199
Param ( ParamDef , String ) ,
1200
1200
}
1201
1201
1202
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1202
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1203
1203
pub enum BoundRegionKind {
1204
1204
BrAnon ,
1205
1205
BrNamed ( BrNamedDef , String ) ,
@@ -1354,7 +1354,7 @@ impl Allocation {
1354
1354
}
1355
1355
}
1356
1356
1357
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1357
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1358
1358
pub enum ConstantKind {
1359
1359
Ty ( TyConst ) ,
1360
1360
Allocated ( Allocation ) ,
@@ -1365,13 +1365,13 @@ pub enum ConstantKind {
1365
1365
ZeroSized ,
1366
1366
}
1367
1367
1368
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1368
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1369
1369
pub struct ParamConst {
1370
1370
pub index : u32 ,
1371
1371
pub name : String ,
1372
1372
}
1373
1373
1374
- #[ derive( Clone , Debug , Eq , PartialEq , Serialize ) ]
1374
+ #[ derive( Clone , Debug , Eq , PartialEq , Hash , Serialize ) ]
1375
1375
pub struct UnevaluatedConst {
1376
1376
pub def : ConstDef ,
1377
1377
pub args : GenericArgs ,
0 commit comments