-
-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update error span for attribute / data kind mismatches
- Loading branch information
Showing
7 changed files
with
40 additions
and
42 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
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,5 @@ | ||
error: #[serde(default)] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/enum.rs:5:1 | ||
--> tests/ui/default-attribute/enum.rs:4:9 | ||
| | ||
5 | enum E { | ||
| ^^^^ | ||
4 | #[serde(default)] | ||
| ^^^^^^^ |
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,5 @@ | ||
error: #[serde(default = "...")] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/enum_path.rs:5:1 | ||
--> tests/ui/default-attribute/enum_path.rs:4:9 | ||
| | ||
5 | enum E { | ||
| ^^^^ | ||
4 | #[serde(default = "default_e")] | ||
| ^^^^^^^^^^^^^^^^^^^^^ |
6 changes: 3 additions & 3 deletions
6
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,5 @@ | ||
error: #[serde(default = "...")] can only be used on structs with named fields | ||
--> tests/ui/default-attribute/nameless_struct_fields_path.rs:5:9 | ||
--> tests/ui/default-attribute/nameless_struct_fields_path.rs:4:9 | ||
| | ||
5 | struct T(u8, u8); | ||
| ^^^^^^^^ | ||
4 | #[serde(default = "default_t")] | ||
| ^^^^^^^^^^^^^^^^^^^^^ |
6 changes: 3 additions & 3 deletions
6
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,5 @@ | ||
error: #[serde(untagged)] can only be used on enums | ||
--> tests/ui/enum-representation/untagged-struct.rs:5:1 | ||
--> tests/ui/enum-representation/untagged-struct.rs:4:9 | ||
| | ||
5 | struct S; | ||
| ^^^^^^ | ||
4 | #[serde(untagged)] | ||
| ^^^^^^^^ |
6 changes: 3 additions & 3 deletions
6
test_suite/tests/ui/struct-representation/internally-tagged-tuple.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,5 @@ | ||
error: #[serde(tag = "...")] can only be used on enums and structs with named fields | ||
--> tests/ui/struct-representation/internally-tagged-tuple.rs:5:9 | ||
--> tests/ui/struct-representation/internally-tagged-tuple.rs:4:9 | ||
| | ||
5 | struct S(u8, u8); | ||
| ^^^^^^^^ | ||
4 | #[serde(tag = "type")] | ||
| ^^^^^^^^^^^^ |
8 changes: 3 additions & 5 deletions
8
test_suite/tests/ui/struct-representation/internally-tagged-unit.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,7 +1,5 @@ | ||
error: #[serde(tag = "...")] can only be used on enums and structs with named fields | ||
--> tests/ui/struct-representation/internally-tagged-unit.rs:3:10 | ||
--> tests/ui/struct-representation/internally-tagged-unit.rs:4:9 | ||
| | ||
3 | #[derive(Serialize)] | ||
| ^^^^^^^^^ | ||
| | ||
= note: this error originates in the derive macro `Serialize` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
4 | #[serde(tag = "type")] | ||
| ^^^^^^^^^^^^ |