From 14cb96ec0e6be3b99bfe4ea373c058dcbd2a4f79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 19:54:16 +0200 Subject: Allign RecordPat with RecordExpr --- crates/ra_hir/src/semantics.rs | 4 ++-- crates/ra_hir/src/source_analyzer.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 6f3b3dc9a..44c71857e 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -216,7 +216,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { self.imp.resolve_record_field(field) } - pub fn resolve_record_field_pat(&self, field: &ast::RecordFieldPat) -> Option { + pub fn resolve_record_field_pat(&self, field: &ast::RecordPatField) -> Option { self.imp.resolve_record_field_pat(field) } @@ -429,7 +429,7 @@ impl<'db> SemanticsImpl<'db> { self.analyze(field.syntax()).resolve_record_field(self.db, field) } - fn resolve_record_field_pat(&self, field: &ast::RecordFieldPat) -> Option { + fn resolve_record_field_pat(&self, field: &ast::RecordPatField) -> Option { self.analyze(field.syntax()).resolve_record_field_pat(self.db, field) } diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index f2e630ef1..37b33cc4f 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -182,7 +182,7 @@ impl SourceAnalyzer { pub(crate) fn resolve_record_field_pat( &self, _db: &dyn HirDatabase, - field: &ast::RecordFieldPat, + field: &ast::RecordPatField, ) -> Option { let pat_id = self.pat_id(&field.pat()?)?; let struct_field = self.infer.as_ref()?.record_field_pat_resolution(pat_id)?; -- cgit v1.2.3 From 98181087984157e27faba0b969e384f3c62c39d5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 31 Jul 2020 20:09:09 +0200 Subject: Rename BindPat -> IdentPat --- crates/ra_hir/src/code_model.rs | 2 +- crates/ra_hir/src/semantics.rs | 6 +++--- crates/ra_hir/src/semantics/source_to_def.rs | 2 +- crates/ra_hir/src/source_analyzer.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 36c0bdc9e..27cdabea0 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs @@ -1002,7 +1002,7 @@ impl Local { Type::new(db, krate, def, ty) } - pub fn source(self, db: &dyn HirDatabase) -> InFile> { + pub fn source(self, db: &dyn HirDatabase) -> InFile> { let (_body, source_map) = db.body_with_source_map(self.parent.into()); let src = source_map.pat_syntax(self.pat_id).unwrap(); // Hmm... let root = src.file_syntax(db.upcast()); diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 44c71857e..307b336f2 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -236,7 +236,7 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> { self.imp.lower_path(path) } - pub fn resolve_bind_pat_to_const(&self, pat: &ast::BindPat) -> Option { + pub fn resolve_bind_pat_to_const(&self, pat: &ast::IdentPat) -> Option { self.imp.resolve_bind_pat_to_const(pat) } @@ -452,7 +452,7 @@ impl<'db> SemanticsImpl<'db> { Path::from_src(path.clone(), &Hygiene::new(self.db.upcast(), src.file_id.into())) } - fn resolve_bind_pat_to_const(&self, pat: &ast::BindPat) -> Option { + fn resolve_bind_pat_to_const(&self, pat: &ast::IdentPat) -> Option { self.analyze(pat.syntax()).resolve_bind_pat_to_const(self.db, pat) } @@ -594,7 +594,7 @@ to_def_impls![ (crate::EnumVariant, ast::Variant, enum_variant_to_def), (crate::TypeParam, ast::TypeParam, type_param_to_def), (crate::MacroDef, ast::MacroCall, macro_call_to_def), // this one is dubious, not all calls are macros - (crate::Local, ast::BindPat, bind_pat_to_def), + (crate::Local, ast::IdentPat, bind_pat_to_def), ]; fn find_root(node: &SyntaxNode) -> SyntaxNode { diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index d1994e2e7..863e8e5ff 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -106,7 +106,7 @@ impl SourceToDefCtx<'_, '_> { } pub(super) fn bind_pat_to_def( &mut self, - src: InFile, + src: InFile, ) -> Option<(DefWithBodyId, PatId)> { let container = self.find_pat_container(src.as_ref().map(|it| it.syntax()))?; let (_body, source_map) = self.db.body_with_source_map(container); diff --git a/crates/ra_hir/src/source_analyzer.rs b/crates/ra_hir/src/source_analyzer.rs index 37b33cc4f..d0cb62ef0 100644 --- a/crates/ra_hir/src/source_analyzer.rs +++ b/crates/ra_hir/src/source_analyzer.rs @@ -202,7 +202,7 @@ impl SourceAnalyzer { pub(crate) fn resolve_bind_pat_to_const( &self, db: &dyn HirDatabase, - pat: &ast::BindPat, + pat: &ast::IdentPat, ) -> Option { let pat_id = self.pat_id(&pat.clone().into())?; let body = self.body.as_ref()?; -- cgit v1.2.3