@@ -2,6 +2,7 @@ use rustc_apfloat::ieee::{Double, Single};
22use rustc_apfloat:: Float ;
33use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
44use rustc_target:: abi:: Size ;
5+ use rustc_data_structures:: stable_hasher:: HashStableEq ;
56use std:: convert:: { TryFrom , TryInto } ;
67use std:: fmt;
78
@@ -118,7 +119,7 @@ impl std::fmt::Debug for ConstInt {
118119/// This is a packed struct in order to allow this type to be optimally embedded in enums
119120/// (like Scalar).
120121// FIXME - how are these impls correct if HashStable isnt'???
121- #[ derive( Clone , Copy , Eq , PartialEq , Ord , PartialOrd , Hash , HashStableEq ) ]
122+ #[ derive( Clone , Copy , Eq , PartialEq , Ord , PartialOrd , Hash ) ]
122123#[ repr( packed) ]
123124pub struct ScalarInt {
124125 /// The first `size` bytes of `data` are the value.
@@ -140,6 +141,13 @@ impl<CTX> crate::ty::HashStable<CTX> for ScalarInt {
140141 }
141142}
142143
144+ impl HashStableEq for ScalarInt {
145+ fn hash_stable_eq ( & self , other : & Self ) -> bool {
146+ let other_data = other. data ;
147+ { self . data } . hash_stable_eq ( & other_data) && self . size . hash_stable_eq ( & other. size )
148+ }
149+ }
150+
143151impl < S : Encoder > Encodable < S > for ScalarInt {
144152 fn encode ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
145153 s. emit_u128 ( self . data ) ?;
0 commit comments