-
-
Notifications
You must be signed in to change notification settings - Fork 785
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ui tests with compile_error resolved at call site
- Loading branch information
Showing
92 changed files
with
467 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: failed to parse borrowed lifetimes: "zzz" | ||
--> tests/ui/borrow/bad_lifetimes.rs:5:22 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | struct Test<'a> { | ||
5 | #[serde(borrow = "zzz")] | ||
| ^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate borrowed lifetime `'a` | ||
--> tests/ui/borrow/duplicate_lifetime.rs:5:22 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | struct Test<'a> { | ||
5 | #[serde(borrow = "'a + 'a")] | ||
| ^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `borrow` | ||
--> tests/ui/borrow/duplicate_variant.rs:9:15 | ||
| | ||
6 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
... | ||
9 | S(#[serde(borrow)] Str<'a>), | ||
| ^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
error: at least one lifetime must be borrowed | ||
--> tests/ui/borrow/empty_lifetimes.rs:5:22 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | struct Test<'a> { | ||
5 | #[serde(borrow = "")] | ||
| ^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: at least one lifetime must be borrowed | ||
--> tests/ui/borrow/empty_lifetimes.rs:7:22 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
... | ||
7 | #[serde(borrow = " ")] | ||
| ^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
error: field `s` has no lifetimes to borrow | ||
--> tests/ui/borrow/no_lifetimes.rs:5:5 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | struct Test { | ||
5 | / #[serde(borrow)] | ||
6 | | s: String, | ||
| |_____________^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
error: #[serde(borrow)] may only be used on newtype variants | ||
--> tests/ui/borrow/struct_variant.rs:8:5 | ||
| | ||
6 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
7 | enum Test<'a> { | ||
8 | / #[serde(borrow)] | ||
9 | | S { s: Str<'a> }, | ||
| |____________________^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
error: field `s` does not have lifetime 'b | ||
--> tests/ui/borrow/wrong_lifetime.rs:5:5 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | struct Test<'a> { | ||
5 | / #[serde(borrow = "'b")] | ||
6 | | s: &'a str, | ||
| |______________^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(default)] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/enum.rs:5:1 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | #[serde(default)] | ||
5 | enum E { | ||
| ^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(default = "...")] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/enum_path.rs:5:1 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | #[serde(default = "default_e")] | ||
5 | enum E { | ||
| ^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/default-attribute/nameless_struct_fields.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(default)] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/nameless_struct_fields.rs:5:9 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | #[serde(default)] | ||
5 | struct T(u8, u8); | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/default-attribute/nameless_struct_fields_path.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(default = "...")] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/nameless_struct_fields_path.rs:5:9 | ||
| | ||
3 | #[derive(Deserialize)] | ||
| ----------- in this derive macro expansion | ||
4 | #[serde(default = "default_t")] | ||
5 | struct T(u8, u8); | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/rename-and-ser.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: unknown serde field attribute `serialize` | ||
--> tests/ui/duplicate-attribute/rename-and-ser.rs:5:27 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | struct S { | ||
5 | #[serde(rename = "x", serialize = "y")] | ||
| ^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/rename-ser-rename-ser.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `rename` | ||
--> tests/ui/duplicate-attribute/rename-ser-rename-ser.rs:5:38 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | struct S { | ||
5 | #[serde(rename(serialize = "x"), rename(serialize = "y"))] | ||
| ^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/rename-ser-rename.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `rename` | ||
--> tests/ui/duplicate-attribute/rename-ser-rename.rs:6:13 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
... | ||
6 | #[serde(rename = "y")] | ||
| ^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/rename-ser-ser.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `rename` | ||
--> tests/ui/duplicate-attribute/rename-ser-ser.rs:5:37 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | struct S { | ||
5 | #[serde(rename(serialize = "x", serialize = "y"))] | ||
| ^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/two-rename-ser.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `rename` | ||
--> tests/ui/duplicate-attribute/two-rename-ser.rs:6:13 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
... | ||
6 | #[serde(rename(serialize = "y"))] | ||
| ^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/duplicate-attribute/with-and-serialize-with.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: duplicate serde attribute `serialize_with` | ||
--> tests/ui/duplicate-attribute/with-and-serialize-with.rs:5:25 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | struct S { | ||
5 | #[serde(with = "w", serialize_with = "s")] | ||
| ^^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
4 changes: 4 additions & 0 deletions
4
test_suite/tests/ui/enum-representation/content-no-tag.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
error: #[serde(tag = "...", content = "...")] must be used together | ||
--> tests/ui/enum-representation/content-no-tag.rs:4:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(content = "c")] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/enum-representation/internal-tuple-variant.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(tag = "...")] cannot be used with tuple variants | ||
--> tests/ui/enum-representation/internal-tuple-variant.rs:6:5 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
... | ||
6 | Tuple(u8, u8), | ||
| ^^^^^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
14 changes: 14 additions & 0 deletions
14
test_suite/tests/ui/enum-representation/untagged-and-adjacent.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
error: untagged enum cannot have #[serde(tag = "...", content = "...")] | ||
--> tests/ui/enum-representation/untagged-and-adjacent.rs:4:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: untagged enum cannot have #[serde(tag = "...", content = "...")] | ||
--> tests/ui/enum-representation/untagged-and-adjacent.rs:5:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
5 | #[serde(tag = "t", content = "c")] | ||
| ^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: untagged enum cannot have #[serde(tag = "...", content = "...")] | ||
--> tests/ui/enum-representation/untagged-and-adjacent.rs:5:20 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
5 | #[serde(tag = "t", content = "c")] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
9 changes: 9 additions & 0 deletions
9
test_suite/tests/ui/enum-representation/untagged-and-content.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
error: untagged enum cannot have #[serde(content = "...")] | ||
--> tests/ui/enum-representation/untagged-and-content.rs:4:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: untagged enum cannot have #[serde(content = "...")] | ||
--> tests/ui/enum-representation/untagged-and-content.rs:5:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
5 | #[serde(content = "c")] | ||
| ^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
9 changes: 9 additions & 0 deletions
9
test_suite/tests/ui/enum-representation/untagged-and-internal.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
error: enum cannot be both untagged and internally tagged | ||
--> tests/ui/enum-representation/untagged-and-internal.rs:4:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
| ^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: enum cannot be both untagged and internally tagged | ||
--> tests/ui/enum-representation/untagged-and-internal.rs:5:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
5 | #[serde(tag = "type")] | ||
| ^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
5 changes: 5 additions & 0 deletions
5
test_suite/tests/ui/enum-representation/untagged-struct.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: #[serde(untagged)] can only be used on enums | ||
--> tests/ui/enum-representation/untagged-struct.rs:5:1 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | #[serde(untagged)] | ||
5 | struct S; | ||
| ^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
error: expected serde rename attribute to be a string: `rename = "..."` | ||
--> tests/ui/expected-string/boolean.rs:5:22 | ||
| | ||
3 | #[derive(Serialize)] | ||
| --------- in this derive macro expansion | ||
4 | struct S { | ||
5 | #[serde(rename = true)] | ||
| ^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) |
Oops, something went wrong.