Skip to content

Commit dfd183f

Browse files
committed
Get it compiling
1 parent 95c40b8 commit dfd183f

File tree

2 files changed

+10
-1
lines changed
  • compiler

2 files changed

+10
-1
lines changed

compiler/rustc_codegen_ssa/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ bitflags::bitflags! {
107107
}
108108

109109
#[derive(Clone, Debug, Encodable, Decodable, HashStable)]
110+
#[stable_hasher(no_hash_stable_eq)]
110111
pub struct NativeLib {
111112
pub kind: NativeLibKind,
112113
pub name: Option<Symbol>,

compiler/rustc_middle/src/ty/consts/int.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use rustc_apfloat::ieee::{Double, Single};
22
use rustc_apfloat::Float;
33
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
44
use rustc_target::abi::Size;
5+
use rustc_data_structures::stable_hasher::HashStableEq;
56
use std::convert::{TryFrom, TryInto};
67
use 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)]
123124
pub 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+
143151
impl<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

Comments
 (0)