mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 21:48:02 +00:00
Add tests of #[serde(default)] attribute for units and unions
This commit is contained in:
@@ -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 | | }
|
||||
| |_^
|
||||
Reference in New Issue
Block a user