hir_ty::match_check
cleanup: remove special handling for box patterns
#20175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As of rust-lang/rust#143414, as part of transitioning away from box patterns and towards more general deref patterns (rust-lang/rust#87121), box patterns are now represented in terms of deref patterns in the THIR and in match checking.
It doesn't seem like box patterns were lowered to the
match_check
IR to begin with though, so the handling of box patterns inmatch_check
was dead code. Since it doesn't match with the compiler anymore and it wasn't used, I've removed it in this PR without replacement.Once rust-lang/rust#143472 (or some successor thereof) is merged, it should be possible to properly implement
match_check
for deref patterns in rust-analyzer as well. I'd be happy to try doing so once syntax for deref patterns is sorted out.