Enum variants with multiple fields don't work.
Try applying PreciseClone
in tests/expand/clone-full.rs to the following struct:
#[derive(Adhoc)]
#[derive_adhoc(PreciseClone)]
enum AllTypes {
NoData,
Tuple(u16, u32),
Struct { a: String, b: String },
}
It won't work. Instead you get messages like this:
Compiling adhoc-playground v0.1.0 (/home/nickm/src/adhoc-playground)
error: expected `,`
--> src/main.rs:10:22
|
10 | $vpat => $vtype {
| ^^^^
...
21 | #[derive(Adhoc)]
| ----- in this derive macro expansion
22 | #[derive_adhoc(PreciseClone)]
23 | enum AllTypes {
| ______-
24 | | NoData,
25 | | Tuple(u16, u32),
| |_________- while parsing the fields for this pattern
|
= note: this error originates in the macro `derive_adhoc_template_PreciseClone` which comes from the expansion of the derive macro `Adhoc` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected `,`
--> src/main.rs:26:25
|
23 | enum AllTypes {
| ______-
24 | | NoData,
25 | | Tuple(u16, u32),
26 | | Struct { a: String, b: String },
| | - ^
| |__________|
| while parsing the fields for this pattern
(Found while writing an enums tutorial)