Skip to content

Commit

Permalink
Auto merge of #105750 - oli-obk:valtrees, r=lcnr
Browse files Browse the repository at this point in the history
Always fall back to PartialEq when a constant in a pattern is not recursively structural-eq

Right now we destructure the constant as far as we can, but with this PR we just don't take it apart anymore. This is preparatory work for moving to always using valtrees, as these will just do a single conversion of the constant to a valtree at the start, and if that fails, fall back to `PartialEq`.

This removes a few cases where we emitted the `unreachable pattern` lint, because we stop looking into the constant deeply enough to detect that a constant is already covered by another pattern.

Previous work: rust-lang/rust#70743

This is groundwork towards fixing rust-lang/rust#83085 and rust-lang/rust#105047
  • Loading branch information
bors committed May 16, 2023
2 parents 4f6cde4 + 43399d6 commit 77d2bae
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 77d2bae

Please sign in to comment.