Skip to content

min_exhaustive_patterns false negative #16866

Open
@benluelo

Description

@benluelo

rust-analyzer seems to have issues with min_exhaustive_patterns when the matched type is an associated type, but rustc handles it fine. Interestingly enough, if an unreachable pattern is found, it will be reported, but removing it will then cause an error to be reported.

rust-analyzer version: rust-analyzer 1.78.0-nightly (c67326b0 2024-03-15)
rustc version:

rustc 1.78.0-nightly (c67326b06 2024-03-15)
binary: rustc
commit-hash: c67326b063bd27ed04f306ba2e372cd92e0a8751
commit-date: 2024-03-15
host: aarch64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0

code snippet to reproduce:

note that this compiles fine, but opening this in an editor with rust-analyzer will show an error.

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=2e2a29b7f5ec9aa1daefbb6cefc62bc9

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-patternpattern handling related thingsC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions