Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer/pat.rs')
| -rw-r--r-- | crates/hir-ty/src/infer/pat.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer/pat.rs b/crates/hir-ty/src/infer/pat.rs index ca2a0d87f7..f21438647c 100644 --- a/crates/hir-ty/src/infer/pat.rs +++ b/crates/hir-ty/src/infer/pat.rs @@ -1620,7 +1620,10 @@ https://doc.rust-lang.org/reference/types.html#trait-objects"; TyKind::Slice(element_ty) => (element_ty, Some(expected), expected), // The expected type must be an array or slice, but was neither, so error. _ => { - // FIXME: Emit an error: expected an array or a slice. + self.push_diagnostic(InferenceDiagnostic::ExpectedArrayOrSlicePat { + pat, + found: expected.store(), + }); let err = self.types.types.error; (err, Some(err), err) } |