From 127a4eff7186021df5a609d392b011917d881388 Mon Sep 17 00:00:00 2001 From: dianne Date: Fri, 4 Jul 2025 21:17:40 -0700 Subject: [PATCH] always check for mixed deref pattern and normal constructors This makes it work for box patterns and in rust-analyzer. --- crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs b/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs index 7cf22c64d0..2e408b1fac 100644 --- a/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs +++ b/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs @@ -527,6 +527,14 @@ impl PatCx for MatchCheckCtx<'_> { fn complexity_exceeded(&self) -> Result<(), Self::Error> { Err(()) } + + fn report_mixed_deref_pat_ctors( + &self, + _deref_pat: &DeconstructedPat<'_>, + _normal_pat: &DeconstructedPat<'_>, + ) { + // FIXME(deref_patterns): This could report an error comparable to the one in rustc. + } } impl fmt::Debug for MatchCheckCtx<'_> {