This repository was archived by the owner on May 28, 2025. It is now read-only.
Commit e20cb77
committed
Auto merge of rust-lang#116391 - Nadrieril:constructorset, r=cjgillot
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#76918)), my one-pass rewrite (rust-lang#116042), and future librarification.File tree
4 files changed
+726
-581
lines changed- compiler/rustc_mir_build/src/thir/pattern
- tests/ui/pattern/usefulness
4 files changed
+726
-581
lines changed
0 commit comments