Skip to content

Commit 4ccfa97

Browse files
committed
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)]`.
1 parent f64daff commit 4ccfa97

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#[rustc_must_implement_one_of(eq, neq)]
2+
//~^ 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
3+
trait Equal {
4+
fn eq(&self, other: &Self) -> bool {
5+
!self.neq(other)
6+
}
7+
8+
fn neq(&self, other: &Self) -> bool {
9+
!self.eq(other)
10+
}
11+
}
12+
13+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
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
2+
--> $DIR/rustc_must_implement_one_of_gated.rs:1:1
3+
|
4+
LL | #[rustc_must_implement_one_of(eq, neq)]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= help: add `#![feature(rustc_attrs)]` to the crate attributes to enable
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0658`.

0 commit comments

Comments
 (0)