Skip to content

Commit 75219e1

Browse files
committed
rustc_back: impl Hash for Svh
1 parent aff24e1 commit 75219e1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustc_back/svh.rs

+8
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,14 @@ impl Svh {
126126
}
127127
}
128128

129+
impl Hash for Svh {
130+
fn hash<H>(&self, state: &mut H) where H: Hasher {
131+
// We have to hash a &str since that's what the old implementations did, and otherwise we
132+
// break the abi
133+
&self.to_string()[..].hash(state);
134+
}
135+
}
136+
129137
impl fmt::Display for Svh {
130138
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
131139
f.pad(&self.as_string())

0 commit comments

Comments
 (0)