Added ui tests, Limited serde(tag = "...") to structs with named field

Added ui test struct-representation/internally-tagged-unit
Added ui test struct-representation/internally-tagged-tuple
    
Limited the serde(tag = "...") to enums and structs with named field
This commit is contained in:
Johannes Willbold
2018-12-27 23:01:03 +01:00
parent 9e53405f43
commit 2359417804
6 changed files with 56 additions and 4 deletions
@@ -0,0 +1,11 @@
#[macro_use]
extern crate serde_derive;
#[derive(Serialize)]
#[serde(tag = "type")]
struct S (
u8,
u8
);
fn main() {}
@@ -0,0 +1,12 @@
error: #[serde(tag = "...")] can only be used on enums and structs with named fields
--> $DIR/internally-taged-tuple.rs:6:10
|
6 | struct S (
| __________^
7 | | u8,
8 | | u8
9 | | );
| |_^
error: aborting due to previous error
@@ -0,0 +1,8 @@
#[macro_use]
extern crate serde_derive;
#[derive(Serialize)]
#[serde(tag = "type")]
struct U;
fn main() {}
@@ -0,0 +1,8 @@
error: #[serde(tag = "...")] can only be used on enums and structs with named fields
--> $DIR/internally-tagged-unit.rs:4:10
|
4 | #[derive(Serialize)]
| ^^^^^^^^^
error: aborting due to previous error