diff options
| author | dianne <diannes.gm@gmail.com> | 2025-07-04 21:17:40 -0700 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-07-04 23:47:31 -0700 |
| commit | 50061f3b11f51d7a6e3acd8ce793a1f17f99b597 (patch) | |
| tree | 361e856dd3e167443f287dbf2a45d3e28ac28656 /compiler/rustc_pattern_analysis/tests | |
| parent | d98a5da813da67eb189387b8ccfb73cf481275d8 (diff) | |
| download | rust-50061f3b11f51d7a6e3acd8ce793a1f17f99b597.tar.gz rust-50061f3b11f51d7a6e3acd8ce793a1f17f99b597.zip | |
always check for mixed deref pattern and normal constructors
This makes it work for box patterns and in rust-analyzer.
Diffstat (limited to 'compiler/rustc_pattern_analysis/tests')
| -rw-r--r-- | compiler/rustc_pattern_analysis/tests/common/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_pattern_analysis/tests/common/mod.rs b/compiler/rustc_pattern_analysis/tests/common/mod.rs index 8980b644f59..0b939ef7816 100644 --- a/compiler/rustc_pattern_analysis/tests/common/mod.rs +++ b/compiler/rustc_pattern_analysis/tests/common/mod.rs @@ -1,6 +1,7 @@ use rustc_pattern_analysis::constructor::{ Constructor, ConstructorSet, IntRange, MaybeInfiniteInt, RangeEnd, VariantVisibility, }; +use rustc_pattern_analysis::pat::DeconstructedPat; use rustc_pattern_analysis::usefulness::{PlaceValidity, UsefulnessReport}; use rustc_pattern_analysis::{MatchArm, PatCx, PrivateUninhabitedField}; @@ -184,6 +185,14 @@ impl PatCx for Cx { fn complexity_exceeded(&self) -> Result<(), Self::Error> { Err(()) } + + fn report_mixed_deref_pat_ctors( + &self, + _deref_pat: &DeconstructedPat<Self>, + _normal_pat: &DeconstructedPat<Self>, + ) -> Self::Error { + panic!("`rustc_pattern_analysis::tests` currently doesn't test deref pattern errors") + } } /// Construct a single pattern; see `pats!()`. |
