mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-22 17:18:08 +00:00
Improve UI test coverage
With this commit I believe I've covered all `compile_error!`-based errors.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(default = "default_e")]
|
||||
enum E {
|
||||
S { f: u8 },
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
error: #[serde(default = "...")] can only be used on structs with named fields
|
||||
--> $DIR/enum_path.rs:6:1
|
||||
|
|
||||
6 | enum E {
|
||||
| ^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
#[macro_use]
|
||||
extern crate serde_derive;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
#[serde(default = "default_t")]
|
||||
struct T(u8, u8);
|
||||
|
||||
fn main() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
error: #[serde(default = "...")] can only be used on structs with named fields
|
||||
--> $DIR/nameless_struct_fields_path.rs:6:9
|
||||
|
|
||||
6 | struct T(u8, u8);
|
||||
| ^^^^^^^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
Reference in New Issue
Block a user