Skip to content

Commit fc78970

Browse files
committed
clippy fix: remove or annotate manual PartialEq::ne
1 parent 4eedad3 commit fc78970

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

library/core/src/cmp.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1824,8 +1824,6 @@ mod impls {
18241824
impl const PartialEq for $t {
18251825
#[inline]
18261826
fn eq(&self, other: &Self) -> bool { *self == *other }
1827-
#[inline]
1828-
fn ne(&self, other: &Self) -> bool { *self != *other }
18291827
}
18301828
)*)
18311829
}
@@ -1836,10 +1834,6 @@ mod impls {
18361834
fn eq(&self, _other: &()) -> bool {
18371835
true
18381836
}
1839-
#[inline]
1840-
fn ne(&self, _other: &()) -> bool {
1841-
false
1842-
}
18431837
}
18441838

18451839
partial_eq_impl! {
@@ -2037,6 +2031,8 @@ mod impls {
20372031
fn eq(&self, other: &&B) -> bool {
20382032
PartialEq::eq(*self, *other)
20392033
}
2034+
// if <A as PartialEq<B>>::ne uses inline assembly or FFI, then
2035+
// this forwarding impl may be more efficient than the default impl
20402036
#[inline]
20412037
fn ne(&self, other: &&B) -> bool {
20422038
PartialEq::ne(*self, *other)
@@ -2109,6 +2105,8 @@ mod impls {
21092105
fn eq(&self, other: &&mut B) -> bool {
21102106
PartialEq::eq(*self, *other)
21112107
}
2108+
// if <A as PartialEq<B>>::ne uses inline assembly or FFI, then
2109+
// this forwarding impl may be more efficient than the default impl
21122110
#[inline]
21132111
fn ne(&self, other: &&mut B) -> bool {
21142112
PartialEq::ne(*self, *other)
@@ -2179,6 +2177,8 @@ mod impls {
21792177
fn eq(&self, other: &&mut B) -> bool {
21802178
PartialEq::eq(*self, *other)
21812179
}
2180+
// if <A as PartialEq<B>>::ne uses inline assembly or FFI, then
2181+
// this forwarding impl may be more efficient than the default impl
21822182
#[inline]
21832183
fn ne(&self, other: &&mut B) -> bool {
21842184
PartialEq::ne(*self, *other)
@@ -2195,6 +2195,8 @@ mod impls {
21952195
fn eq(&self, other: &&B) -> bool {
21962196
PartialEq::eq(*self, *other)
21972197
}
2198+
// if <A as PartialEq<B>>::ne uses inline assembly or FFI, then
2199+
// this forwarding impl may be more efficient than the default impl
21982200
#[inline]
21992201
fn ne(&self, other: &&B) -> bool {
22002202
PartialEq::ne(*self, *other)

0 commit comments

Comments
 (0)