aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src/body/lower.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-12-20 11:22:55 +0000
committerAleksey Kladov <[email protected]>2019-12-20 11:22:55 +0000
commitfe1b160dcfdeb3f582ccae1440c9580ade0beb39 (patch)
tree574aaf7ee9a3b57e39bf1129a6d20c1f4b330fb7 /crates/ra_hir_def/src/body/lower.rs
parentac5a3f611b05dbedd286169539335ae9f0fbb7b0 (diff)
Support for nested statics, consts and type aliases
Diffstat (limited to 'crates/ra_hir_def/src/body/lower.rs')
-rw-r--r--crates/ra_hir_def/src/body/lower.rs15
1 files changed, 14 insertions, 1 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs
index 0d3f946df..b61f924b7 100644
--- a/crates/ra_hir_def/src/body/lower.rs
+++ b/crates/ra_hir_def/src/body/lower.rs
@@ -25,7 +25,8 @@ use crate::{
25 path::GenericArgs, 25 path::GenericArgs,
26 path::Path, 26 path::Path,
27 type_ref::{Mutability, TypeRef}, 27 type_ref::{Mutability, TypeRef},
28 ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, Intern, ModuleDefId, StructLoc, UnionLoc, 28 ConstLoc, ContainerId, DefWithBodyId, EnumLoc, FunctionLoc, Intern, ModuleDefId, StaticLoc,
29 StructLoc, TypeAliasLoc, UnionLoc,
29}; 30};
30 31
31pub(super) fn lower( 32pub(super) fn lower(
@@ -497,6 +498,18 @@ where
497 let ast_id = self.expander.ast_id(&def); 498 let ast_id = self.expander.ast_id(&def);
498 FunctionLoc { container: container.into(), ast_id }.intern(self.db).into() 499 FunctionLoc { container: container.into(), ast_id }.intern(self.db).into()
499 } 500 }
501 ast::ModuleItem::TypeAliasDef(def) => {
502 let ast_id = self.expander.ast_id(&def);
503 TypeAliasLoc { container: container.into(), ast_id }.intern(self.db).into()
504 }
505 ast::ModuleItem::ConstDef(def) => {
506 let ast_id = self.expander.ast_id(&def);
507 ConstLoc { container: container.into(), ast_id }.intern(self.db).into()
508 }
509 ast::ModuleItem::StaticDef(def) => {
510 let ast_id = self.expander.ast_id(&def);
511 StaticLoc { container, ast_id }.intern(self.db).into()
512 }
500 ast::ModuleItem::StructDef(def) => { 513 ast::ModuleItem::StructDef(def) => {
501 let ast_id = self.expander.ast_id(&def); 514 let ast_id = self.expander.ast_id(&def);
502 StructLoc { container, ast_id }.intern(self.db).into() 515 StructLoc { container, ast_id }.intern(self.db).into()