diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-25 10:51:37 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-02-25 10:51:37 +0000 |
commit | cec637a3a91f0a34989dfde15ea853bbe8dc8a53 (patch) | |
tree | d813eb7be81dadbeced5ea0cf056d974cfd0fea5 /crates/ra_hir/src | |
parent | 7ffff9c74caae108db53366e3b90857b7c405c6c (diff) | |
parent | 78f10fcdc41d5c58e386bc99a94b34a2bdbaa4cd (diff) |
Merge #898
898: rename type to type_alias in the AST as well r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 5 | ||||
-rw-r--r-- | crates/ra_hir/src/ids.rs | 6 | ||||
-rw-r--r-- | crates/ra_hir/src/impl_block.rs | 2 | ||||
-rw-r--r-- | crates/ra_hir/src/nameres/lower.rs | 2 |
4 files changed, 9 insertions, 6 deletions
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 { | |||
619 | } | 619 | } |
620 | 620 | ||
621 | impl TypeAlias { | 621 | impl TypeAlias { |
622 | pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) { | 622 | pub fn source( |
623 | &self, | ||
624 | db: &impl PersistentHirDatabase, | ||
625 | ) -> (HirFileId, TreeArc<ast::TypeAliasDef>) { | ||
623 | self.id.source(db) | 626 | self.id.source(db) |
624 | } | 627 | } |
625 | 628 | ||
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 { | |||
22 | consts: LocationIntener<ItemLoc<ast::ConstDef>, ConstId>, | 22 | consts: LocationIntener<ItemLoc<ast::ConstDef>, ConstId>, |
23 | statics: LocationIntener<ItemLoc<ast::StaticDef>, StaticId>, | 23 | statics: LocationIntener<ItemLoc<ast::StaticDef>, StaticId>, |
24 | traits: LocationIntener<ItemLoc<ast::TraitDef>, TraitId>, | 24 | traits: LocationIntener<ItemLoc<ast::TraitDef>, TraitId>, |
25 | types: LocationIntener<ItemLoc<ast::TypeDef>, TypeId>, | 25 | types: LocationIntener<ItemLoc<ast::TypeAliasDef>, TypeId>, |
26 | } | 26 | } |
27 | 27 | ||
28 | impl HirInterner { | 28 | impl HirInterner { |
@@ -278,8 +278,8 @@ impl AstItemDef<ast::TraitDef> for TraitId { | |||
278 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 278 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
279 | pub struct TypeId(RawId); | 279 | pub struct TypeId(RawId); |
280 | impl_arena_id!(TypeId); | 280 | impl_arena_id!(TypeId); |
281 | impl AstItemDef<ast::TypeDef> for TypeId { | 281 | impl AstItemDef<ast::TypeAliasDef> for TypeId { |
282 | fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TypeDef>, Self> { | 282 | fn interner(interner: &HirInterner) -> &LocationIntener<ItemLoc<ast::TypeAliasDef>, Self> { |
283 | &interner.types | 283 | &interner.types |
284 | } | 284 | } |
285 | } | 285 | } |
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 { | |||
137 | .map(|item_node| match item_node.kind() { | 137 | .map(|item_node| match item_node.kind() { |
138 | ast::ImplItemKind::FnDef(it) => Function { id: ctx.to_def(it) }.into(), | 138 | ast::ImplItemKind::FnDef(it) => Function { id: ctx.to_def(it) }.into(), |
139 | ast::ImplItemKind::ConstDef(it) => Const { id: ctx.to_def(it) }.into(), | 139 | ast::ImplItemKind::ConstDef(it) => Const { id: ctx.to_def(it) }.into(), |
140 | ast::ImplItemKind::TypeDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), | 140 | ast::ImplItemKind::TypeAliasDef(it) => TypeAlias { id: ctx.to_def(it) }.into(), |
141 | }) | 141 | }) |
142 | .collect() | 142 | .collect() |
143 | } else { | 143 | } 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 { | |||
167 | self.declarations.insert(name.as_name(), PerNs::types(t.into())); | 167 | self.declarations.insert(name.as_name(), PerNs::types(t.into())); |
168 | } | 168 | } |
169 | } | 169 | } |
170 | ast::ModuleItemKind::TypeDef(it) => { | 170 | ast::ModuleItemKind::TypeAliasDef(it) => { |
171 | if let Some(name) = it.name() { | 171 | if let Some(name) = it.name() { |
172 | let t = TypeAlias { id: ctx.to_def(it) }; | 172 | let t = TypeAlias { id: ctx.to_def(it) }; |
173 | self.declarations.insert(name.as_name(), PerNs::types(t.into())); | 173 | self.declarations.insert(name.as_name(), PerNs::types(t.into())); |