@@ -2,6 +2,7 @@ use rustc_apfloat::ieee::{Double, Single};
2
2
use rustc_apfloat:: Float ;
3
3
use rustc_serialize:: { Decodable , Decoder , Encodable , Encoder } ;
4
4
use rustc_target:: abi:: Size ;
5
+ use rustc_data_structures:: stable_hasher:: HashStableEq ;
5
6
use std:: convert:: { TryFrom , TryInto } ;
6
7
use std:: fmt;
7
8
@@ -118,7 +119,7 @@ impl std::fmt::Debug for ConstInt {
118
119
/// This is a packed struct in order to allow this type to be optimally embedded in enums
119
120
/// (like Scalar).
120
121
// 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 ) ]
122
123
#[ repr( packed) ]
123
124
pub struct ScalarInt {
124
125
/// The first `size` bytes of `data` are the value.
@@ -140,6 +141,13 @@ impl<CTX> crate::ty::HashStable<CTX> for ScalarInt {
140
141
}
141
142
}
142
143
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
+
143
151
impl < S : Encoder > Encodable < S > for ScalarInt {
144
152
fn encode ( & self , s : & mut S ) -> Result < ( ) , S :: Error > {
145
153
s. emit_u128 ( self . data ) ?;
0 commit comments