@@ -37,7 +37,7 @@ pub use self::chalk::{ChalkEnvironmentAndGoal, RustInterner as ChalkRustInterner
3737
3838/// Depending on the stage of compilation, we want projection to be
3939/// more or less conservative.
40- #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , HashStable ) ]
40+ #[ derive( Debug , Copy , Clone , PartialEq , Eq , Hash , HashStable , Encodable , Decodable ) ]
4141pub enum Reveal {
4242 /// At type-checking time, we refuse to project any associated
4343 /// type that is marked `default`. Non-`default` ("final") types
@@ -90,7 +90,8 @@ pub enum Reveal {
9090///
9191/// We do not want to intern this as there are a lot of obligation causes which
9292/// 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 ) ]
9495pub struct ObligationCause < ' tcx > {
9596 pub span : Span ,
9697
@@ -197,14 +198,16 @@ impl<'tcx> ObligationCause<'tcx> {
197198 }
198199}
199200
200- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
201+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
202+ #[ derive( TypeVisitable , TypeFoldable ) ]
201203pub struct UnifyReceiverContext < ' tcx > {
202204 pub assoc_item : ty:: AssocItem ,
203205 pub param_env : ty:: ParamEnv < ' tcx > ,
204206 pub substs : SubstsRef < ' tcx > ,
205207}
206208
207- #[ derive( Clone , PartialEq , Eq , Hash , Lift , Default ) ]
209+ #[ derive( Clone , PartialEq , Eq , Hash , Lift , Default , HashStable ) ]
210+ #[ derive( TypeVisitable , TypeFoldable , TyEncodable , TyDecodable ) ]
208211pub struct InternedObligationCauseCode < ' tcx > {
209212 /// `None` for `ObligationCauseCode::MiscObligation` (a common case, occurs ~60% of
210213 /// the time). `Some` otherwise.
@@ -239,7 +242,8 @@ impl<'tcx> std::ops::Deref for InternedObligationCauseCode<'tcx> {
239242 }
240243}
241244
242- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
245+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
246+ #[ derive( TypeVisitable , TypeFoldable ) ]
243247pub enum ObligationCauseCode < ' tcx > {
244248 /// Not well classified or should be obvious from the span.
245249 MiscObligation ,
@@ -447,7 +451,8 @@ pub enum ObligationCauseCode<'tcx> {
447451/// This information is used to obtain an `hir::Ty`, which
448452/// we can walk in order to obtain precise spans for any
449453/// '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 ) ]
451456pub enum WellFormedLoc {
452457 /// Use the type of the provided definition.
453458 Ty ( LocalDefId ) ,
@@ -464,7 +469,8 @@ pub enum WellFormedLoc {
464469 } ,
465470}
466471
467- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
472+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
473+ #[ derive( TypeVisitable , TypeFoldable ) ]
468474pub struct ImplDerivedObligationCause < ' tcx > {
469475 pub derived : DerivedObligationCause < ' tcx > ,
470476 pub impl_def_id : DefId ,
@@ -518,7 +524,8 @@ impl<'tcx> ty::Lift<'tcx> for StatementAsExpression {
518524 }
519525}
520526
521- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
527+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
528+ #[ derive( TypeVisitable , TypeFoldable ) ]
522529pub struct MatchExpressionArmCause < ' tcx > {
523530 pub arm_block_id : Option < hir:: HirId > ,
524531 pub arm_ty : Ty < ' tcx > ,
@@ -534,7 +541,7 @@ pub struct MatchExpressionArmCause<'tcx> {
534541}
535542
536543#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash ) ]
537- #[ derive( Lift , TypeFoldable , TypeVisitable ) ]
544+ #[ derive( Lift , TypeFoldable , TypeVisitable , HashStable , TyEncodable , TyDecodable ) ]
538545pub struct IfExpressionCause < ' tcx > {
539546 pub then_id : hir:: HirId ,
540547 pub else_id : hir:: HirId ,
@@ -544,7 +551,8 @@ pub struct IfExpressionCause<'tcx> {
544551 pub opt_suggest_box_span : Option < Span > ,
545552}
546553
547- #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift ) ]
554+ #[ derive( Clone , Debug , PartialEq , Eq , Hash , Lift , HashStable , TyEncodable , TyDecodable ) ]
555+ #[ derive( TypeVisitable , TypeFoldable ) ]
548556pub struct DerivedObligationCause < ' tcx > {
549557 /// The trait predicate of the parent obligation that led to the
550558 /// current obligation. Note that only trait obligations lead to
0 commit comments