diff options
author | Dawer <[email protected]> | 2021-04-28 19:25:01 +0100 |
---|---|---|
committer | Dawer <[email protected]> | 2021-05-31 20:03:45 +0100 |
commit | 26baab5d2836eb5affd93d1991b3e96853f13869 (patch) | |
tree | 58a34d9449743150e6e0e9d256742aa9d8cc0653 /crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | |
parent | c3c2893f302d087ff3c1ddd3a1d4e88c03c4356b (diff) |
Enable generation of non-exhaustiveness witnesses
Diffstat (limited to 'crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs')
-rw-r--r-- | crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs index cde04409e..2f3555205 100644 --- a/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs +++ b/crates/hir_ty/src/diagnostics/pattern/deconstruct_pat.rs | |||
@@ -109,6 +109,7 @@ impl Constructor { | |||
109 | } | 109 | } |
110 | } | 110 | } |
111 | 111 | ||
112 | /// Determines the constructor that the given pattern can be specialized to. | ||
112 | pub(super) fn from_pat(cx: &MatchCheckCtx<'_>, pat: PatId) -> Self { | 113 | pub(super) fn from_pat(cx: &MatchCheckCtx<'_>, pat: PatId) -> Self { |
113 | match &cx.pattern_arena.borrow()[pat] { | 114 | match &cx.pattern_arena.borrow()[pat] { |
114 | Pat::Bind { .. } | Pat::Wild => Wildcard, | 115 | Pat::Bind { .. } | Pat::Wild => Wildcard, |
@@ -312,7 +313,6 @@ impl SplitWildcard { | |||
312 | // | 313 | // |
313 | // The exception is: if we are at the top-level, for example in an empty match, we | 314 | // The exception is: if we are at the top-level, for example in an empty match, we |
314 | // sometimes prefer reporting the list of constructors instead of just `_`. | 315 | // sometimes prefer reporting the list of constructors instead of just `_`. |
315 | |||
316 | let report_when_all_missing = pcx.is_top_level && !IntRange::is_integral(&pcx.ty); | 316 | let report_when_all_missing = pcx.is_top_level && !IntRange::is_integral(&pcx.ty); |
317 | let ctor = if !self.matrix_ctors.is_empty() || report_when_all_missing { | 317 | let ctor = if !self.matrix_ctors.is_empty() || report_when_all_missing { |
318 | Missing | 318 | Missing |