2021-12-21 09:40:50 -06:00
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
#[rustc_must_implement_one_of(eq, neq)]
|
|
|
|
trait Equal {
|
|
|
|
fn eq(&self, other: &Self) -> bool {
|
|
|
|
!self.neq(other)
|
|
|
|
}
|
|
|
|
|
|
|
|
fn neq(&self, other: &Self) -> bool {
|
|
|
|
!self.eq(other)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct T0;
|
|
|
|
struct T1;
|
|
|
|
struct T2;
|
|
|
|
struct T3;
|
|
|
|
|
|
|
|
impl Equal for T0 {
|
|
|
|
fn eq(&self, _other: &Self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Equal for T1 {
|
|
|
|
fn neq(&self, _other: &Self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Equal for T2 {
|
|
|
|
fn eq(&self, _other: &Self) -> bool {
|
|
|
|
true
|
|
|
|
}
|
|
|
|
|
|
|
|
fn neq(&self, _other: &Self) -> bool {
|
|
|
|
false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Equal for T3 {}
|
2022-01-14 07:52:30 -06:00
|
|
|
//~^ not all trait items implemented, missing one of: `eq`, `neq`
|
2021-12-21 09:40:50 -06:00
|
|
|
|
|
|
|
fn main() {}
|