diff options
Diffstat (limited to 'src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs')
-rw-r--r-- | src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs b/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs new file mode 100644 index 000000000..ec2995872 --- /dev/null +++ b/src/test/ui/traits/default-method/rustc_must_implement_one_of_gated.rs @@ -0,0 +1,13 @@ +#[rustc_must_implement_one_of(eq, neq)] +//~^ the `#[rustc_must_implement_one_of]` attribute is used to change minimal complete definition of a trait, it's currently in experimental form and should be changed before being exposed outside of the std +trait Equal { + fn eq(&self, other: &Self) -> bool { + !self.neq(other) + } + + fn neq(&self, other: &Self) -> bool { + !self.eq(other) + } +} + +fn main() {} |