@@ -73,7 +73,7 @@ pub enum IntercrateMode {
7373/// either identifying an `impl` (e.g., `impl Eq for int`) that
7474/// provides the required vtable, or else finding a bound that is in
7575/// scope. The eventual result is usually a `Selection` (defined below).
76- #[ derive( Clone , PartialEq , Eq ) ]
76+ #[ derive( Clone , PartialEq , Eq , Hash ) ]
7777pub struct Obligation < ' tcx , T > {
7878 pub cause : ObligationCause < ' tcx > ,
7979 pub param_env : ty:: ParamEnv < ' tcx > ,
@@ -85,7 +85,7 @@ pub type PredicateObligation<'tcx> = Obligation<'tcx, ty::Predicate<'tcx>>;
8585pub type TraitObligation < ' tcx > = Obligation < ' tcx , ty:: PolyTraitPredicate < ' tcx > > ;
8686
8787/// Why did we incur this obligation? Used for error reporting.
88- #[ derive( Clone , Debug , PartialEq , Eq ) ]
88+ #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
8989pub struct ObligationCause < ' tcx > {
9090 pub span : Span ,
9191
@@ -113,7 +113,7 @@ impl<'tcx> ObligationCause<'tcx> {
113113 }
114114}
115115
116- #[ derive( Clone , Debug , PartialEq , Eq ) ]
116+ #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
117117pub enum ObligationCauseCode < ' tcx > {
118118 /// Not well classified or should be obvious from span.
119119 MiscObligation ,
@@ -215,7 +215,7 @@ pub enum ObligationCauseCode<'tcx> {
215215 BlockTailExpression ( ast:: NodeId ) ,
216216}
217217
218- #[ derive( Clone , Debug , PartialEq , Eq ) ]
218+ #[ derive( Clone , Debug , PartialEq , Eq , Hash ) ]
219219pub struct DerivedObligationCause < ' tcx > {
220220 /// The trait reference of the parent obligation that led to the
221221 /// current obligation. Note that only trait obligations lead to
@@ -304,7 +304,7 @@ pub type SelectionResult<'tcx, T> = Result<Option<T>, SelectionError<'tcx>>;
304304/// ### The type parameter `N`
305305///
306306/// See explanation on `VtableImplData`.
307- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
307+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable ) ]
308308pub enum Vtable < ' tcx , N > {
309309 /// Vtable identifying a particular impl.
310310 VtableImpl ( VtableImplData < ' tcx , N > ) ,
@@ -374,13 +374,13 @@ pub struct VtableClosureData<'tcx, N> {
374374 pub nested : Vec < N >
375375}
376376
377- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
377+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable ) ]
378378pub struct VtableAutoImplData < N > {
379379 pub trait_def_id : DefId ,
380380 pub nested : Vec < N >
381381}
382382
383- #[ derive( Clone , RustcEncodable , RustcDecodable ) ]
383+ #[ derive( Clone , PartialEq , Eq , RustcEncodable , RustcDecodable ) ]
384384pub struct VtableBuiltinData < N > {
385385 pub nested : Vec < N >
386386}
0 commit comments