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

match-same-arms doesn't delete the old arm when merging #9251

Closed
tobiasvl opened this issue Jul 27, 2022 · 0 comments · Fixed by #12794
Closed

match-same-arms doesn't delete the old arm when merging #9251

tobiasvl opened this issue Jul 27, 2022 · 0 comments · Fixed by #12794
Labels
L-suggestion Lint: Improving, adding or fixing lint suggestions

Comments

@tobiasvl
Copy link

Description

match_same_arms can suggest merging two match arms with identical bodies. If this is done, the fixed arm will merge the other arm into itself, but the old arm will not be deleted, leading to rustc warning about unreachable_patterns.

Version

rustc 1.62.0 (a8314ef7d 2022-06-27)
binary: rustc
commit-hash: a8314ef7d0ec7b75c336af2c9857bfaf43002bfc
commit-date: 2022-06-27
host: x86_64-pc-windows-msvc
release: 1.62.0
LLVM version: 14.0.5

Additional Labels

No response

@xFrednet xFrednet added the L-suggestion Lint: Improving, adding or fixing lint suggestions label Jul 27, 2022
bors added a commit that referenced this issue May 13, 2024
improve [`match_same_arms`] messages, enable rustfix test

closes: #9251

don't worry about the commit size, most of them are generated

---

changelog: improve [`match_same_arms`] lint messages
@bors bors closed this as completed in a863780 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-suggestion Lint: Improving, adding or fixing lint suggestions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants