Skip to content

Commit

Permalink
Auto merge of #116391 - Nadrieril:constructorset, r=cjgillot
Browse files Browse the repository at this point in the history
exhaustiveness: Rework constructor splitting

`SplitWildcard` was pretty opaque. I replaced it with a more legible abstraction: `ConstructorSet` represents the set of constructors for patterns of a given type. This clarifies responsibilities: `ConstructorSet` handles one clear task, and diagnostic-related shenanigans can be done separately.

I'm quite excited, I had has this in mind for years but could never quite introduce it. This opens up possibilities, including type-specific optimisations (like using a `FxHashSet` to collect enum variants, which had been [hackily attempted some years ago](rust-lang/rust#76918)), my one-pass rewrite (rust-lang/rust#116042), and future librarification.
  • Loading branch information
bors committed Oct 12, 2023
2 parents 2e61650 + 20b0bb5 commit ce39358
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit ce39358

Please sign in to comment.