Skip to content

Commit 8a430d9

Browse files
authored
Merge pull request #5 from n0-computer/fail-unit-case
test: Add test that common fields macro fails when used with a unit case
2 parents c5bd61a + 6fe2546 commit 8a430d9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
use nested_enum_utils::common_fields;
2+
3+
#[common_fields({ x: u64 })]
4+
enum Enum {
5+
A,
6+
B {},
7+
}
8+
9+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
error: Expected named variants in enum
2+
--> tests/compile_fail/common_fields_unit.rs:3:1
3+
|
4+
3 | #[common_fields({ x: u64 })]
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
|
7+
= note: this error originates in the attribute macro `common_fields` (in Nightly builds, run with -Z macro-backtrace for more info)

0 commit comments

Comments
 (0)