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.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir-ty/src/infer/pat.rs b/crates/hir-ty/src/infer/pat.rs
index 8e87d22a45..a42d00786e 100644
--- a/crates/hir-ty/src/infer/pat.rs
+++ b/crates/hir-ty/src/infer/pat.rs
@@ -1155,7 +1155,7 @@ https://doc.rust-lang.org/reference/types.html#trait-objects";
fn check_record_pat_fields(
&mut self,
adt_ty: Ty<'db>,
- _pat: PatId,
+ pat: PatId,
variant: VariantId,
fields: &[RecordFieldPat],
has_rest_pat: bool,
@@ -1233,7 +1233,7 @@ https://doc.rust-lang.org/reference/types.html#trait-objects";
// Require `..` if struct has non_exhaustive attribute.
let non_exhaustive = self.has_applicable_non_exhaustive(variant.into());
if non_exhaustive && !has_rest_pat {
- // FIXME: Emit an error.
+ self.push_diagnostic(InferenceDiagnostic::NonExhaustiveRecordPat { pat, variant });
}
// Report an error if an incorrect number of fields was specified.