diff options
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 d668b883c..da0f1ec94 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -661,7 +661,10 @@ pub struct TypeAlias { | |||
661 | } | 661 | } |
662 | 662 | ||
663 | impl TypeAlias { | 663 | impl TypeAlias { |
664 | pub fn source(&self, db: &impl PersistentHirDatabase) -> (HirFileId, TreeArc<ast::TypeDef>) { | 664 | pub fn source( |
665 | &self, | ||
666 | db: &impl PersistentHirDatabase, | ||
667 | ) -> (HirFileId, TreeArc<ast::TypeAliasDef>) { | ||
665 | self.id.source(db) | 668 | self.id.source(db) |
666 | } | 669 | } |
667 | 670 | ||
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())); |