mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-28 10:39:45 +00:00
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.
This commit is contained in:
parent
3732587143
commit
eb446f92fd
1 changed files with 3 additions and 0 deletions
|
|
@ -301,6 +301,7 @@ impl<'db> MatchCheckCtx<'db> {
|
|||
// ignore this issue.
|
||||
Ref => PatKind::Deref { subpattern: subpatterns.next().unwrap() },
|
||||
Slice(_) => unimplemented!(),
|
||||
DerefPattern(_) => unimplemented!(),
|
||||
&Str(void) => match void {},
|
||||
Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind::Wild,
|
||||
Never => PatKind::Never,
|
||||
|
|
@ -351,6 +352,7 @@ impl PatCx for MatchCheckCtx<'_> {
|
|||
},
|
||||
Ref => 1,
|
||||
Slice(..) => unimplemented!(),
|
||||
DerefPattern(..) => unimplemented!(),
|
||||
Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..)
|
||||
| F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited
|
||||
| Hidden | Missing | Wildcard => 0,
|
||||
|
|
@ -411,6 +413,7 @@ impl PatCx for MatchCheckCtx<'_> {
|
|||
}
|
||||
},
|
||||
Slice(_) => unreachable!("Found a `Slice` constructor in match checking"),
|
||||
DerefPattern(_) => unreachable!("Found a `DerefPattern` constructor in match checking"),
|
||||
Never | Bool(..) | IntRange(..) | F16Range(..) | F32Range(..) | F64Range(..)
|
||||
| F128Range(..) | Str(..) | Opaque(..) | NonExhaustive | PrivateUninhabited
|
||||
| Hidden | Missing | Wildcard => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue