Skip to content

Commit 88cd25e

Browse files
committed
Add a test for invalid name in default specification
1 parent c3ec191 commit 88cd25e

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
use enumflags2::bitflags;
2+
3+
#[bitflags(default = A | C)]
4+
#[repr(u8)]
5+
#[derive(Clone, Copy)]
6+
enum Test {
7+
A = 1,
8+
B = 2,
9+
}
10+
11+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0599]: no variant or associated item named `C` found for enum `Test` in the current scope
2+
--> $DIR/invalid_name_in_default.rs:3:26
3+
|
4+
3 | #[bitflags(default = A | C)]
5+
| ^
6+
| |
7+
| variant or associated item not found in `Test`
8+
| help: there is a variant with a similar name: `A`
9+
...
10+
6 | enum Test {
11+
| --------- variant or associated item `C` not found here

0 commit comments

Comments
 (0)