Allowed Enum variants to be individually marked as untagged (#2403)

This commit is contained in:
David Ewert authored and GitHub committed 2023-06-07 20:58:59 -07:00
1 parent bbba632ab3
commit 48e5753e76
7 files changed
+230 -11

No files matched your search

@@ -0,0 +1,10 @@
use serde_derive::Serialize;
#[derive(Serialize)]
enum E {
#[serde(untagged)]
A(u8),
B(String),
}
fn main() {}
@@ -0,0 +1,5 @@
error: all variants with the #[serde(untagged)] attribute must be placed at the end of the enum
--> tests/ui/enum-representation/partially_tagged_wrong_order.rs:7:5
|
7 | B(String),
| ^