From 78f10fcdc41d5c58e386bc99a94b34a2bdbaa4cd Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 25 Feb 2019 13:38:52 +0300 Subject: rename type to type_alias in the AST as well --- crates/ra_hir/src/code_model_api.rs | 5 ++++- crates/ra_hir/src/ids.rs | 6 +++--- crates/ra_hir/src/impl_block.rs | 2 +- crates/ra_hir/src/nameres/lower.rs | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) (limited to 'crates/ra_hir/src') diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index 278407504..9a44aaa43 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs @@ -619,7 +619,10 @@ pub struct TypeAlias { } impl TypeAlias { - pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc) { + pub fn source( + &self, + db: &impl PersistentHirDatabase, + ) -> (HirFileId, TreeArc) { self.id.source(db) } diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 6df037859..5b00330c6 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -22,7 +22,7 @@ pub struct HirInterner { consts: LocationIntener, ConstId>, statics: LocationIntener, StaticId>, traits: LocationIntener, TraitId>, - types: LocationIntener, TypeId>, + types: LocationIntener, TypeId>, } impl HirInterner { @@ -278,8 +278,8 @@ impl AstItemDef for TraitId { #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub struct TypeId(RawId); impl_arena_id!(TypeId); -impl AstItemDef for TypeId { - fn interner(interner: &HirInterner) -> &LocationIntener, Self> { +impl AstItemDef for TypeId { + fn interner(interner: &HirInterner) -> &LocationIntener, Self> { &interner.types } } diff --git a/crates/ra_hir/src/impl_block.rs b/crates/ra_hir/src/impl_block.rs index 2f3c916fd..eb2d4ed8d 100644 --- a/crates/ra_hir/src/impl_block.rs +++ b/crates/ra_hir/src/impl_block.rs @@ -137,7 +137,7 @@ impl ImplData { .map(|item_node| match item_node.kind() { ast::ImplItemKind::FnDef(it) => Function { id: ctx.to_def(it) }.into(), ast::ImplItemKind::ConstDef(it) => Const { id: ctx.to_def(it) }.into(), - ast::ImplItemKind::TypeDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), + ast::ImplItemKind::TypeAliasDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), }) .collect() } else { diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 522f13b44..2bc3eb60c 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs @@ -167,7 +167,7 @@ impl LoweredModule { self.declarations.insert(name.as_name(), PerNs::types(t.into())); } } - ast::ModuleItemKind::TypeDef(it) => { + ast::ModuleItemKind::TypeAliasDef(it) => { if let Some(name) = it.name() { let t = TypeAlias { id: ctx.to_def(it) }; self.declarations.insert(name.as_name(), PerNs::types(t.into())); -- cgit v1.2.3