Skip to content

Commit

Permalink
fix: fix unconditional recursion in PartialEq (#468)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Jan 21, 2024
1 parent f78ad1f commit 7a8c368
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions bitfield/src/pack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,14 +769,14 @@ macro_rules! make_packers {
impl<A, B, F> PartialEq<&'_ $Pack<B, F>> for $Pack<A, F> {
#[inline]
fn eq(&self, other: &&'_ $Pack<B, F>) -> bool {
self.eq(*other)
<Self as PartialEq<$Pack<B, F>>>::eq(self, *other)
}
}

impl<A, B, F> PartialEq<$Pack<B, F>> for &'_ $Pack<A, F> {
#[inline]
fn eq(&self, other: &$Pack<B, F>) -> bool {
(*self).eq(other)
<$Pack<A, F> as PartialEq<$Pack<B, F>>>::eq(*self, other)
}
}

Expand Down Expand Up @@ -1052,14 +1052,14 @@ macro_rules! make_packers {
impl<A, B> PartialEq<&'_ $Pair<B>> for $Pair<A> {
#[inline]
fn eq(&self, other: &&'_ $Pair<B>) -> bool {
self.eq(*other)
<Self as PartialEq<$Pair<B>>>::eq(self, *other)
}
}

impl<A, B> PartialEq<$Pair<B>> for &'_ $Pair<A> {
#[inline]
fn eq(&self, other: &$Pair<B>) -> bool {
(*self).eq(other)
<$Pair<A> as PartialEq<$Pair<B>>>::eq(*self, other)
}
}

Expand Down
2 changes: 1 addition & 1 deletion maitake-sync/src/wait_map/tests/alloc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ struct CountDropKey {

impl PartialEq for CountDropKey {
fn eq(&self, other: &Self) -> bool {
self.idx.eq(&other.idx)
self.idx == other.idx
}
}

Expand Down

0 comments on commit 7a8c368

Please sign in to comment.