From eb2f8063444b11257111f4f8ade990ec810e0361 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 30 Jul 2020 15:25:46 +0200 Subject: Rename TypeAliasDef -> TypeAlias --- crates/ra_hir/src/has_source.rs | 4 ++-- crates/ra_hir/src/semantics.rs | 2 +- crates/ra_hir/src/semantics/source_to_def.rs | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'crates/ra_hir') diff --git a/crates/ra_hir/src/has_source.rs b/crates/ra_hir/src/has_source.rs index f32b8cbb9..1557b7c83 100644 --- a/crates/ra_hir/src/has_source.rs +++ b/crates/ra_hir/src/has_source.rs @@ -105,8 +105,8 @@ impl HasSource for Trait { } } impl HasSource for TypeAlias { - type Ast = ast::TypeAliasDef; - fn source(self, db: &dyn HirDatabase) -> InFile { + type Ast = ast::TypeAlias; + 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 0b634f23e..054405966 100644 --- a/crates/ra_hir/src/semantics.rs +++ b/crates/ra_hir/src/semantics.rs @@ -582,7 +582,7 @@ to_def_impls![ (crate::Union, ast::UnionDef, union_to_def), (crate::Trait, ast::TraitDef, trait_to_def), (crate::ImplDef, ast::ImplDef, impl_to_def), - (crate::TypeAlias, ast::TypeAliasDef, type_alias_to_def), + (crate::TypeAlias, ast::TypeAlias, type_alias_to_def), (crate::Const, ast::ConstDef, const_to_def), (crate::Static, ast::StaticDef, static_to_def), (crate::Function, ast::Fn, fn_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 4118de2e2..d23a1974b 100644 --- a/crates/ra_hir/src/semantics/source_to_def.rs +++ b/crates/ra_hir/src/semantics/source_to_def.rs @@ -89,10 +89,7 @@ impl SourceToDefCtx<'_, '_> { pub(super) fn const_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::CONST) } - pub(super) fn type_alias_to_def( - &mut self, - src: InFile, - ) -> Option { + pub(super) fn type_alias_to_def(&mut self, src: InFile) -> Option { self.to_def(src, keys::TYPE_ALIAS) } pub(super) fn record_field_to_def( @@ -195,7 +192,7 @@ impl SourceToDefCtx<'_, '_> { let def = self.const_to_def(container.with_value(it))?; DefWithBodyId::from(def).into() }, - ast::TypeAliasDef(it) => { + ast::TypeAlias(it) => { let def = self.type_alias_to_def(container.with_value(it))?; def.into() }, @@ -217,7 +214,7 @@ impl SourceToDefCtx<'_, '_> { 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(), - ast::TypeAliasDef(it) => self.type_alias_to_def(container.with_value(it))?.into(), + ast::TypeAlias(it) => self.type_alias_to_def(container.with_value(it))?.into(), ast::ImplDef(it) => self.impl_to_def(container.with_value(it))?.into(), _ => continue, } -- cgit v1.2.3