Skip to content

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

@tobiasvl

Description

@tobiasvl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    L-suggestionLint: Improving, adding or fixing lint suggestions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions