Skip to content

Commit 2d27aa2

Browse files
committed
add stubbed-out cases for rust-analyzer
rust-analyzer doesn't construct `DerefPattern(_)` constructors, so these shouldn't crash. It looks like this is how slice patterns are implemented too.
1 parent ccd1c1f commit 2d27aa2

File tree

1 file changed

+3
-0
lines changed
  • src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check

1 file changed

+3
-0
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs

+3
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ impl<'db> MatchCheckCtx<'db> {
301301
// ignore this issue.
302302
Ref => PatKind::Deref { subpattern: subpatterns.next().unwrap() },
303303
Slice(_) => unimplemented!(),
304+
DerefPattern(_) => unimplemented!(),
304305
&Str(void) => match void {},
305306
Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind::Wild,
306307
Never => PatKind::Never,
@@ -351,6 +352,7 @@ impl PatCx for MatchCheckCtx<'_> {
351352
},
352353
Ref => 1,
353354
Slice(..) => unimplemented!(),
355+
DerefPattern(..) => unimplemented!(),
354356
Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..)
355357
| F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited
356358
| Hidden | Missing | Wildcard => 0,
@@ -412,6 +414,7 @@ impl PatCx for MatchCheckCtx<'_> {
412414
}
413415
},
414416
Slice(_) => unreachable!("Found a `Slice` constructor in match checking"),
417+
DerefPattern(_) => unreachable!("Found a `DerefPattern` constructor in match checking"),
415418
Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..)
416419
| F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited
417420
| Hidden | Missing | Wildcard => {

0 commit comments

Comments
 (0)