Commit 9310e3b
committed
Auto merge of rust-lang#71930 - Nadrieril:exhaustiveness-remove-tyerr, r=varkor
De-abuse TyKind::Error in exhaustiveness checking
Replaces rust-lang#71074. Context: rust-lang#70866.
In order to remove the use of `TyKind::Error`, I had to make sure we skip over those fields whose inhabitedness should not be observed. This is potentially error-prone however, since we must be careful not to mix filtered and unfiltered lists of patterns. I managed to hide away most of the filtering behind a new `Fields` struct, that I used everywhere relevant. I quite like the result; I think the twin concepts of `Constructor` and `Fields` make a good mental model.
As usual, I tried to separate commits that shuffle code around from commits that require more thought to review.
cc @varkor @CentrilFile tree
4 files changed
+427
-260
lines changed- src
- librustc_mir_build/hair/pattern
- librustc_typeck/check
- test/ui/pattern/usefulness
4 files changed
+427
-260
lines changed
0 commit comments