From 2bb00741d463143a10e632bb118d4ed336dbb75f Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Sat, 19 Jul 2025 11:28:31 +0200 Subject: pattern_analysis: add option to get a full set of witnesses --- compiler/rustc_pattern_analysis/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'compiler/rustc_pattern_analysis/src/lib.rs') diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index 66df35f9ee4..d9bb93a829b 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -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 + /// . + fn exhaustive_witnesses(&self) -> bool { + false + } + /// The number of fields for this constructor. fn ctor_arity(&self, ctor: &Constructor, ty: &Self::Ty) -> usize; -- cgit 1.4.1-3-g733a5