mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-04-23 10:38:02 +00:00
Ui tests with compile_error resolved at call site
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
error: enum tags `conflict` for type and content conflict with each other
|
||||
--> tests/ui/conflict/adjacent-tag.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(tag = "conflict", content = "conflict")]
|
||||
5 | | enum E {
|
||||
6 | | A,
|
||||
7 | | B,
|
||||
8 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
error: #[serde(flatten)] cannot be used on newtype structs
|
||||
--> tests/ui/conflict/flatten-newtype-struct.rs:6:12
|
||||
|
|
||||
5 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
6 | struct Foo(#[serde(flatten)] HashMap<String, String>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
error: #[serde(flatten)] cannot be used on tuple structs
|
||||
--> tests/ui/conflict/flatten-tuple-struct.rs:6:17
|
||||
|
|
||||
5 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
6 | struct Foo(u32, #[serde(flatten)] HashMap<String, String>);
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
error: #[serde(from = "...")] and #[serde(try_from = "...")] conflict with each other
|
||||
--> tests/ui/conflict/from-try-from.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(from = "u64", try_from = "u64")]
|
||||
5 | | struct S {
|
||||
6 | | a: u8,
|
||||
7 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
error: variant field name `conflict` conflicts with internal tag
|
||||
--> tests/ui/conflict/internal-tag-alias.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(tag = "conflict")]
|
||||
5 | | enum E {
|
||||
6 | | A {
|
||||
@@ -9,3 +11,5 @@ error: variant field name `conflict` conflicts with internal tag
|
||||
9 | | },
|
||||
10 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
error: variant field name `conflict` conflicts with internal tag
|
||||
--> tests/ui/conflict/internal-tag.rs:4:1
|
||||
|
|
||||
3 | #[derive(Serialize)]
|
||||
| --------- in this derive macro expansion
|
||||
4 | / #[serde(tag = "conflict")]
|
||||
5 | | enum E {
|
||||
6 | | A {
|
||||
@@ -9,3 +11,5 @@ error: variant field name `conflict` conflicts with internal tag
|
||||
9 | | },
|
||||
10 | | }
|
||||
| |_^
|
||||
|
|
||||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
Reference in New Issue
Block a user