Skip to content

Commit 7c532ea

Browse files
committed
Keep going
1 parent 5928308 commit 7c532ea

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/rustc_data_structures/src/stable_hasher.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,16 @@ impl<T: HashStableEq> HashStableEq for Option<T> {
547547
}
548548
}
549549

550+
impl<T: HashStableEq, E: HashStableEq> HashStableEq for Result<T, E> {
551+
fn hash_stable_eq(&self, other: &Self) -> bool {
552+
match (self, other) {
553+
(Ok(first), Ok(second)) => first.hash_stable_eq(second),
554+
(Err(first), Err(second)) => first.hash_stable_eq(second),
555+
_ => false
556+
}
557+
}
558+
}
559+
550560
impl HashStableEq for bool {
551561
fn hash_stable_eq(&self, other: &Self) -> bool {
552562
self == other

0 commit comments

Comments
 (0)