Fix adjacently tagged empty tuple variant or struct variant

This commit is contained in:
David Tolnay
2018-05-06 21:49:37 -07:00
parent 9dc05c36f0
commit 3cd9d071c2
2 changed files with 12 additions and 1 deletions
+11
View File
@@ -567,6 +567,17 @@ fn test_gen() {
}
assert::<AssocDeriveMulti<i32, NoSerdeImpl>>();
#[derive(Serialize)]
#[serde(tag = "t", content = "c")]
enum EmptyAdjacentlyTagged {
#[allow(dead_code)]
Struct {},
#[allow(dead_code)]
Tuple(),
}
assert_ser::<EmptyAdjacentlyTagged>();
}
//////////////////////////////////////////////////////////////////////////