diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index c013e78d945..ce6f3c00806 100644
--- a/crates/hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
@@ -185,12 +185,16 @@ impl SourceAnalyzer {
 
     pub(crate) fn resolve_record_pat_field(
         &self,
-        _db: &dyn HirDatabase,
+        db: &dyn HirDatabase,
         field: &ast::RecordPatField,
     ) -> Option<Field> {
-        let pat_id = self.pat_id(&field.pat()?)?;
-        let struct_field = self.infer.as_ref()?.record_pat_field_resolution(pat_id)?;
-        Some(struct_field.into())
+        let field_name = field.field_name()?.as_name();
+        let record_pat = ast::RecordPat::cast(field.syntax().parent().and_then(|p| p.parent())?)?;
+        let pat_id = self.pat_id(&record_pat.into())?;
+        let variant = self.infer.as_ref()?.variant_resolution_for_pat(pat_id)?;
+        let variant_data = variant.variant_data(db.upcast());
+        let field = FieldId { parent: variant, local_id: variant_data.field(&field_name)? };
+        Some(field.into())
     }
 
     pub(crate) fn resolve_macro_call(
diff --git a/crates/hir_ty/src/infer.rs b/crates/hir_ty/src/infer.rs
index c63878e7a61..efe9198cc92 100644
--- a/crates/hir_ty/src/infer.rs
+++ b/crates/hir_ty/src/infer.rs
@@ -131,8 +131,7 @@ pub struct InferenceResult {
     method_resolutions: FxHashMap<ExprId, FunctionId>,
     /// For each field access expr, records the field it resolves to.
     field_resolutions: FxHashMap<ExprId, FieldId>,
-    record_pat_field_resolutions: FxHashMap<PatId, FieldId>,
-    /// For each struct literal, records the variant it resolves to.
+    /// For each struct literal or pattern, records the variant it resolves to.
     variant_resolutions: FxHashMap<ExprOrPatId, VariantId>,
     /// For each associated item record what it resolves to
     assoc_resolutions: FxHashMap<ExprOrPatId, AssocItemId>,
@@ -151,9 +150,6 @@ impl InferenceResult {
     pub fn field_resolution(&self, expr: ExprId) -> Option<FieldId> {
         self.field_resolutions.get(&expr).copied()
     }
-    pub fn record_pat_field_resolution(&self, pat: PatId) -> Option<FieldId> {
-        self.record_pat_field_resolutions.get(&pat).copied()
-    }
     pub fn variant_resolution_for_expr(&self, id: ExprId) -> Option<VariantId> {
         self.variant_resolutions.get(&id.into()).copied()
     }
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs
index 942f70edf53..e4813c87c14 100644
--- a/crates/hir_ty/src/infer/pat.rs
+++ b/crates/hir_ty/src/infer/pat.rs
@@ -7,7 +7,6 @@ use chalk_ir::Mutability;
 use hir_def::{
     expr::{BindingAnnotation, Expr, Literal, Pat, PatId, RecordFieldPat},
     path::Path,
-    FieldId,
 };
 use hir_expand::name::Name;
 
@@ -80,11 +79,6 @@ impl<'a> InferenceContext<'a> {
         let field_tys = def.map(|it| self.db.field_types(it)).unwrap_or_default();
         for subpat in subpats {
             let matching_field = var_data.as_ref().and_then(|it| it.field(&subpat.name));
-            if let Some(local_id) = matching_field {
-                let field_def = FieldId { parent: def.unwrap(), local_id };
-                self.result.record_pat_field_resolutions.insert(subpat.pat, field_def);
-            }
-
             let expected_ty = matching_field.map_or(self.err_ty(), |field| {
                 field_tys[field].clone().substitute(&Interner, &substs)
             });