about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/tests/complexity.rs
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-07-26 01:15:04 -0500
committerGitHub <noreply@github.com>2025-07-26 01:15:04 -0500
commit3f7d497c8aba1b415c2b9b6a597eab1faa744416 (patch)
treebeb74b00c992ea03b7d3a6fc2188780cf3522c1b /compiler/rustc_pattern_analysis/tests/complexity.rs
parent9c13f4fb201e31f51ebaf8633ece12e660263008 (diff)
parentaf07c08c60fe779c2e73c561403cb5edf4f15e9b (diff)
downloadrust-3f7d497c8aba1b415c2b9b6a597eab1faa744416.tar.gz
rust-3f7d497c8aba1b415c2b9b6a597eab1faa744416.zip
Rollup merge of #144171 - Nadrieril:exhaustive-witnesses, r=davidtwco
pattern_analysis: add option to get a full set of witnesses

This adds an option to the rustc_pattern_analysis machinery to have it report a complete set of patterns when a match is non-exhaustive (by default we only guarantee to report _some_ missing patterns). This is for use in rust-analyzer.

Leaving as draft until I'm sure this is what r-a needs.

r? ghost
Diffstat (limited to 'compiler/rustc_pattern_analysis/tests/complexity.rs')
-rw-r--r--compiler/rustc_pattern_analysis/tests/complexity.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_pattern_analysis/tests/complexity.rs b/compiler/rustc_pattern_analysis/tests/complexity.rs
index 93aecafe48d..4754476f383 100644
--- a/compiler/rustc_pattern_analysis/tests/complexity.rs
+++ b/compiler/rustc_pattern_analysis/tests/complexity.rs
@@ -16,7 +16,7 @@ fn check(patterns: &[DeconstructedPat<Cx>], complexity_limit: usize) -> Result<(
     let ty = *patterns[0].ty();
     let arms: Vec<_> =
         patterns.iter().map(|pat| MatchArm { pat, has_guard: false, arm_data: () }).collect();
-    compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, complexity_limit)
+    compute_match_usefulness(arms.as_slice(), ty, PlaceValidity::ValidOnly, complexity_limit, false)
         .map(|_report| ())
 }