@@ -37,7 +37,7 @@ pub use self::chalk::{ChalkEnvironmentAndGoal, RustInterner as ChalkRustInterner
37
37
38
38
/// Depending on the stage of compilation, we want projection to be
39
39
/// more or less conservative.
40
- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , HashStable ) ]
40
+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , HashStable , Encodable , Decodable ) ]
41
41
pub enum Reveal {
42
42
/// At type-checking time, we refuse to project any associated
43
43
/// type that is marked `default`. Non-`default` ("final") types
@@ -90,7 +90,8 @@ pub enum Reveal {
90
90
///
91
91
/// We do not want to intern this as there are a lot of obligation causes which
92
92
/// only live for a short period of time.
93
- #[ derive( Clone , Debug , PartialEq , Eq , Lift ) ]
93
+ #[ derive( Clone , Debug , PartialEq , Eq , Lift , HashStable , TyEncodable , TyDecodable ) ]
94
+ #[ derive( TypeVisitable , TypeFoldable ) ]
94
95
pub struct ObligationCause < ' tcx > {
95
96
pub span : Span ,
96
97
@@ -197,14 +198,16 @@ impl<'tcx> ObligationCause<'tcx> {
197
198
}
198
199
}
199
200
200
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
201
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
202
+ #[ derive( TypeVisitable , TypeFoldable ) ]
201
203
pub struct UnifyReceiverContext < ' tcx > {
202
204
pub assoc_item : ty:: AssocItem ,
203
205
pub param_env : ty:: ParamEnv < ' tcx > ,
204
206
pub substs : SubstsRef < ' tcx > ,
205
207
}
206
208
207
- #[ derive( Clone , PartialEq , Eq , Hash , Lift , Default ) ]
209
+ #[ derive( Clone , PartialEq , Eq , Hash , Lift , Default , HashStable ) ]
210
+ #[ derive( TypeVisitable , TypeFoldable , TyEncodable , TyDecodable ) ]
208
211
pub struct InternedObligationCauseCode < ' tcx > {
209
212
/// `None` for `ObligationCauseCode::MiscObligation` (a common case, occurs ~60% of
210
213
/// the time). `Some` otherwise.
@@ -239,7 +242,8 @@ impl<'tcx> std::ops::Deref for InternedObligationCauseCode<'tcx> {
239
242
}
240
243
}
241
244
242
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
245
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
246
+ #[ derive( TypeVisitable , TypeFoldable ) ]
243
247
pub enum ObligationCauseCode < ' tcx > {
244
248
/// Not well classified or should be obvious from the span.
245
249
MiscObligation ,
@@ -447,7 +451,8 @@ pub enum ObligationCauseCode<'tcx> {
447
451
/// This information is used to obtain an `hir::Ty`, which
448
452
/// we can walk in order to obtain precise spans for any
449
453
/// 'nested' types (e.g. `Foo` in `Option<Foo>`).
450
- #[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , HashStable ) ]
454
+ #[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash , HashStable , Encodable , Decodable ) ]
455
+ #[ derive( TypeVisitable , TypeFoldable ) ]
451
456
pub enum WellFormedLoc {
452
457
/// Use the type of the provided definition.
453
458
Ty ( LocalDefId ) ,
@@ -464,7 +469,8 @@ pub enum WellFormedLoc {
464
469
} ,
465
470
}
466
471
467
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
472
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
473
+ #[ derive( TypeVisitable , TypeFoldable ) ]
468
474
pub struct ImplDerivedObligationCause < ' tcx > {
469
475
pub derived : DerivedObligationCause < ' tcx > ,
470
476
pub impl_def_id : DefId ,
@@ -518,7 +524,8 @@ impl<'tcx> ty::Lift<'tcx> for StatementAsExpression {
518
524
}
519
525
}
520
526
521
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
527
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
528
+ #[ derive( TypeVisitable , TypeFoldable ) ]
522
529
pub struct MatchExpressionArmCause < ' tcx > {
523
530
pub arm_block_id : Option < hir:: HirId > ,
524
531
pub arm_ty : Ty < ' tcx > ,
@@ -534,7 +541,7 @@ pub struct MatchExpressionArmCause<'tcx> {
534
541
}
535
542
536
543
#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash ) ]
537
- #[ derive( Lift , TypeFoldable , TypeVisitable ) ]
544
+ #[ derive( Lift , TypeFoldable , TypeVisitable , HashStable , TyEncodable , TyDecodable ) ]
538
545
pub struct IfExpressionCause < ' tcx > {
539
546
pub then_id : hir:: HirId ,
540
547
pub else_id : hir:: HirId ,
@@ -544,7 +551,8 @@ pub struct IfExpressionCause<'tcx> {
544
551
pub opt_suggest_box_span : Option < Span > ,
545
552
}
546
553
547
- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
554
+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
555
+ #[ derive( TypeVisitable , TypeFoldable ) ]
548
556
pub struct DerivedObligationCause < ' tcx > {
549
557
/// The trait predicate of the parent obligation that led to the
550
558
/// current obligation. Note that only trait obligations lead to
0 commit comments