2016-10-30 01:33:57 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
|
|
|
|
struct Foo;
|
|
|
|
|
|
|
|
impl PartialEq for Foo {
|
2018-12-09 22:26:16 +00:00
|
|
|
fn eq(&self, _: &Foo) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
fn ne(&self, _: &Foo) -> bool {
|
2023-07-28 19:35:48 +00:00
|
|
|
//~^ ERROR: re-implementing `PartialEq::ne` is unnecessary
|
|
|
|
//~| NOTE: `-D clippy::partialeq-ne-impl` implied by `-D warnings`
|
2018-12-09 22:26:16 +00:00
|
|
|
false
|
|
|
|
}
|
2016-10-30 01:33:57 +00:00
|
|
|
}
|
|
|
|
|
2018-12-11 06:06:41 +00:00
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
impl PartialEq for Bar {
|
2018-12-27 15:17:45 +00:00
|
|
|
fn eq(&self, _: &Bar) -> bool {
|
|
|
|
true
|
|
|
|
}
|
2018-12-11 06:06:41 +00:00
|
|
|
#[allow(clippy::partialeq_ne_impl)]
|
2018-12-27 15:17:45 +00:00
|
|
|
fn ne(&self, _: &Bar) -> bool {
|
|
|
|
false
|
|
|
|
}
|
2018-12-11 06:06:41 +00:00
|
|
|
}
|
|
|
|
|
2016-10-30 01:33:57 +00:00
|
|
|
fn main() {}
|