Skip to content

Commit

Permalink
Auto merge of rust-lang#71930 - Nadrieril:exhaustiveness-remove-tyerr…
Browse files Browse the repository at this point in the history
…, 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 @Centril
  • Loading branch information
bors committed May 21, 2020
2 parents 148c125 + d7e1d5f commit 9310e3b
Show file tree
Hide file tree
Showing 4 changed files with 427 additions and 260 deletions.
Loading

0 comments on commit 9310e3b

Please sign in to comment.