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