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

This commit is contained in:
David Ewert
2023-06-07 20:58:59 -07:00
committed by GitHub
parent bbba632ab3
commit 48e5753e76
7 changed files with 230 additions and 11 deletions
@@ -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),
| ^