mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-05-31 18:01:07 +00:00
Update ui tests for warning on colliding aliases
This commit is contained in:
@@ -1,35 +1,43 @@
|
||||
error: alias `b` conflicts with deserialization name of other field
|
||||
--> tests/ui/conflict/alias.rs:5:5
|
||||
|
|
||||
5 | / /// Expected error on "alias b", because this is a name of other field
|
||||
6 | | /// Error on "alias a" is not expected because this is a name of this field
|
||||
7 | | /// Error on "alias c" is not expected because field `c` is skipped
|
||||
8 | | #[serde(alias = "a", alias = "b", alias = "c")]
|
||||
9 | | a: (),
|
||||
| |_________^
|
||||
|
||||
error: alias `c` already used by field a
|
||||
--> tests/ui/conflict/alias.rs:11:5
|
||||
error: expected expression, found `@`
|
||||
--> tests/ui/conflict/alias.rs:41:5
|
||||
|
|
||||
11 | / /// Expected error on "alias c", because it is already used as alias of `a`
|
||||
12 | | #[serde(alias = "c")]
|
||||
13 | | b: (),
|
||||
| |_________^
|
||||
41 | @//fail
|
||||
| ^ expected expression
|
||||
|
||||
error: alias `c` conflicts with deserialization name of other field
|
||||
--> tests/ui/conflict/alias.rs:21:5
|
||||
warning: unreachable pattern
|
||||
--> tests/ui/conflict/alias.rs:13:5
|
||||
|
|
||||
21 | / /// Expected error on "alias c", because this is a name of other field after
|
||||
22 | | /// applying rename rules
|
||||
23 | | #[serde(alias = "b", alias = "c")]
|
||||
24 | | a: (),
|
||||
| |_________^
|
||||
8 | #[serde(alias = "a", alias = "b", alias = "c")]
|
||||
| --- matches all the relevant values
|
||||
...
|
||||
13 | b: (),
|
||||
| ^ no value can reach this
|
||||
|
|
||||
= note: `#[warn(unreachable_patterns)]` on by default
|
||||
|
||||
error: alias `B` conflicts with deserialization name of other field
|
||||
--> tests/ui/conflict/alias.rs:33:5
|
||||
warning: unreachable pattern
|
||||
--> tests/ui/conflict/alias.rs:12:21
|
||||
|
|
||||
33 | / /// Expected error on "alias B", because this is a name of field after
|
||||
34 | | /// applying rename rules
|
||||
35 | | #[serde(alias = "B", alias = "c")]
|
||||
36 | | a: (),
|
||||
| |_________^
|
||||
8 | #[serde(alias = "a", alias = "b", alias = "c")]
|
||||
| --- matches all the relevant values
|
||||
...
|
||||
12 | #[serde(alias = "c")]
|
||||
| ^^^ no value can reach this
|
||||
|
||||
warning: unreachable pattern
|
||||
--> tests/ui/conflict/alias.rs:26:22
|
||||
|
|
||||
23 | #[serde(alias = "b", alias = "c")]
|
||||
| --- matches all the relevant values
|
||||
...
|
||||
26 | #[serde(rename = "c")]
|
||||
| ^^^ no value can reach this
|
||||
|
||||
warning: unreachable pattern
|
||||
--> tests/ui/conflict/alias.rs:37:5
|
||||
|
|
||||
35 | #[serde(alias = "B", alias = "c")]
|
||||
| --- matches all the relevant values
|
||||
36 | a: (),
|
||||
37 | b: (),
|
||||
| ^ no value can reach this
|
||||
|
||||
Reference in New Issue
Block a user