Skip to content

Commit 834fe6b

Browse files
committed
Add a test for variants with additional data
1 parent ac4883a commit 834fe6b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test_suite/ui/with_fields.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#[derive(Copy, Clone, enumflags2::BitFlags)]
2+
enum Foo {
3+
Bar(u32),
4+
}
5+
6+
fn main() {}

test_suite/ui/with_fields.stderr

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
error: Bitflag variants cannot contain additional data
2+
--> $DIR/with_fields.rs:3:8
3+
|
4+
3 | Bar(u32),
5+
| ^^^^^

0 commit comments

Comments
 (0)