Add tests of #[serde(default)] attribute for units and unions

This commit is contained in:
Mingun
2023-08-07 14:42:54 +05:00
parent 28a092261b
commit 21c7fd1bd5
8 changed files with 72 additions and 0 deletions
@@ -0,0 +1,14 @@
error: #[serde(default = "...")] can only be used on structs
--> tests/ui/default-attribute/union_path.rs:4:9
|
4 | #[serde(default = "default_u")]
| ^^^^^^^^^^^^^^^^^^^^^
error: Serde does not support derive for unions
--> tests/ui/default-attribute/union_path.rs:4:1
|
4 | / #[serde(default = "default_u")]
5 | | union Union {
6 | | f: u8,
7 | | }
| |_^