mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 01:18:02 +00:00
Allowed Enum variants to be individually marked as untagged (#2403)
This commit is contained in:
@@ -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),
|
||||
| ^
|
||||
Reference in New Issue
Block a user