From 1142112c70b705f59b7d559d9d72cdc831865158 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 14:51:08 +0200 Subject: Rename FnDef -> Fn --- crates/ra_hir/src/has_source.rs | 4 ++-- crates/ra_hir/src/semantics.rs | 2 +- crates/ra_hir/src/semantics/source_to_def.rs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index 76c32fc17..f32b8cbb9 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs @@ -81,8 +81,8 @@ impl HasSource for EnumVariant { } } impl HasSource for Function { - type Ast = ast::FnDef; - fn source(self, db: &dyn HirDatabase) -> InFile { + type Ast = ast::Fn; + fn source(self, db: &dyn HirDatabase) -> InFile { self.id.lookup(db.upcast()).source(db.upcast()) } } diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs index 1436b1afe..0b634f23e 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -585,7 +585,7 @@ to_def_impls![ (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), (crate::Const, ast::ConstDef, const_to_def), (crate::Static, ast::StaticDef, static_to_def), - (crate::Function, ast::FnDef, fn_to_def), + (crate::Function, ast::Fn, fn_to_def), (crate::Field, ast::RecordFieldDef, record_field_to_def), (crate::Field, ast::TupleFieldDef, tuple_field_to_def), (crate::EnumVariant, ast::EnumVariant, enum_variant_to_def), diff --git a/crates/ra_hir/src/semantics/source_to_def.rs b/crates/ra_hir/src/semantics/source_to_def.rs index 42e5a1bdb..4118de2e2 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -71,7 +71,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn impl_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::IMPL) } - pub(super) fn fn_to_def(&mut self, src: InFile) -> Option { + pub(super) fn fn_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::FUNCTION) } pub(super) fn struct_to_def(&mut self, src: InFile) -> Option { @@ -171,7 +171,7 @@ impl SourceToDefCtx<'_, '_> { let def = self.impl_to_def(container.with_value(it))?; def.into() }, - ast::FnDef(it) => { + ast::Fn(it) => { let def = self.fn_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, @@ -213,7 +213,7 @@ impl SourceToDefCtx<'_, '_> { for container in src.cloned().ancestors_with_macros(self.db.upcast()).skip(1) { let res: GenericDefId = match_ast! { match (container.value) { - ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), + ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), ast::StructDef(it) => self.struct_to_def(container.with_value(it))?.into(), ast::EnumDef(it) => self.enum_to_def(container.with_value(it))?.into(), ast::TraitDef(it) => self.trait_to_def(container.with_value(it))?.into(), @@ -233,7 +233,7 @@ impl SourceToDefCtx<'_, '_> { match (container.value) { ast::ConstDef(it) => self.const_to_def(container.with_value(it))?.into(), ast::StaticDef(it) => self.static_to_def(container.with_value(it))?.into(), - ast::FnDef(it) => self.fn_to_def(container.with_value(it))?.into(), + ast::Fn(it) => self.fn_to_def(container.with_value(it))?.into(), _ => continue, } }; -- cgit v1.2.3