pattern_analysis: add option to get a full set of witnesses

This commit is contained in:
Nadrieril
2025-07-19 11:28:31 +02:00
parent 81af9d4569
commit 2bb00741d4
7 changed files with 116 additions and 16 deletions

View File

@@ -57,6 +57,13 @@ pub trait PatCx: Sized + fmt::Debug {
fn is_exhaustive_patterns_feature_on(&self) -> bool;
/// Whether to ensure the non-exhaustiveness witnesses we report for a complete set. This is
/// `false` by default to avoid some exponential blowup cases such as
/// <https://github.com/rust-lang/rust/issues/118437>.
fn exhaustive_witnesses(&self) -> bool {
false
}
/// The number of fields for this constructor.
fn ctor_arity(&self, ctor: &Constructor<Self>, ty: &Self::Ty) -> usize;