Add a test for ungated #[rustc_must_implement_one_of]

This test checks that `#[rustc_must_implement_one_of]` is gated behind
`#![feature(rustc_attrs)]`.
This commit is contained in:
Maybe Waffle 2022-01-11 03:39:43 +03:00
parent f64daff0c6
commit 4ccfa97021
2 changed files with 24 additions and 0 deletions

View file

@ -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() {}

View file

@ -0,0 +1,11 @@
error[E0658]: 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
--> $DIR/rustc_must_implement_one_of_gated.rs:1:1
|
LL | #[rustc_must_implement_one_of(eq, neq)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
error: aborting due to previous error
For more information about this error, try `rustc --explain E0658`.