Skip to content

Commit

Permalink
Add a test for invalid name in default specification
Browse files Browse the repository at this point in the history
  • Loading branch information
meithecatte committed Feb 24, 2021
1 parent c3ec191 commit 88cd25e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test_suite/ui/invalid_name_in_default.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
use enumflags2::bitflags;

#[bitflags(default = A | C)]
#[repr(u8)]
#[derive(Clone, Copy)]
enum Test {
A = 1,
B = 2,
}

fn main() {}
11 changes: 11 additions & 0 deletions test_suite/ui/invalid_name_in_default.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
error[E0599]: no variant or associated item named `C` found for enum `Test` in the current scope
--> $DIR/invalid_name_in_default.rs:3:26
|
3 | #[bitflags(default = A | C)]
| ^
| |
| variant or associated item not found in `Test`
| help: there is a variant with a similar name: `A`
...
6 | enum Test {
| --------- variant or associated item `C` not found here

0 comments on commit 88cd25e

Please sign in to comment.