diff options
Diffstat (limited to 'crates/hir_ty/src/diagnostics/match_check/usefulness.rs')
-rw-r--r-- | crates/hir_ty/src/diagnostics/match_check/usefulness.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs index 61fba41bf..83b094a89 100644 --- a/crates/hir_ty/src/diagnostics/match_check/usefulness.rs +++ b/crates/hir_ty/src/diagnostics/match_check/usefulness.rs | |||
@@ -376,9 +376,10 @@ impl PatIdExt for PatId { | |||
376 | fn expand_or_pat(self, cx: &MatchCheckCtx<'_>) -> Vec<Self> { | 376 | fn expand_or_pat(self, cx: &MatchCheckCtx<'_>) -> Vec<Self> { |
377 | fn expand(pat: PatId, vec: &mut Vec<PatId>, pat_arena: &mut PatternArena) { | 377 | fn expand(pat: PatId, vec: &mut Vec<PatId>, pat_arena: &mut PatternArena) { |
378 | if let PatKind::Or { pats } = pat_arena[pat].kind.as_ref() { | 378 | if let PatKind::Or { pats } = pat_arena[pat].kind.as_ref() { |
379 | // FIXME(iDawer): Factor out pattern deep cloning. See discussion: | ||
380 | // https://github.com/rust-analyzer/rust-analyzer/pull/8717#discussion_r633086640 | ||
379 | let pats = pats.clone(); | 381 | let pats = pats.clone(); |
380 | for pat in pats { | 382 | for pat in pats { |
381 | // FIXME(iDawer): Ugh, I want to go back to references (PatId -> &Pat) | ||
382 | let pat = pat_arena.alloc(pat.clone()); | 383 | let pat = pat_arena.alloc(pat.clone()); |
383 | expand(pat, vec, pat_arena); | 384 | expand(pat, vec, pat_arena); |
384 | } | 385 | } |