Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce unreachable_patterns warning when deserialization names collide #2855

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

dtolnay
Copy link
Member

@dtolnay dtolnay commented Nov 11, 2024

Closes #2308.

warning: unreachable pattern
 --> src/main.rs:7:22
  |
5 |     #[serde(rename = "Response")]
  |                      ---------- matches all the relevant values
6 |     Request { id: String},
7 |     #[serde(rename = "Response")]
  |                      ^^^^^^^^^^ no value can reach this
  |
  = note: `#[warn(unreachable_patterns)]` on by default

@dtolnay dtolnay merged commit 7f1e697 into serde-rs:master Nov 11, 2024
15 checks passed
@dtolnay dtolnay deleted the namespan branch November 11, 2024 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

No unreachable warning when duplicate field names on enum after rename attributes
1 participant