Update error span for attribute / data kind mismatches

This commit is contained in:
Jonas Platte
2023-07-27 10:07:45 +02:00
parent 74fe70855f
commit 31a0e73489
7 changed files with 40 additions and 42 deletions
@@ -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")]
| ^^^^^^^^^^^^
@@ -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")]
| ^^^^^^^^^^^^