diff options
author | Aleksey Kladov <[email protected]> | 2019-01-24 14:54:18 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-24 14:54:18 +0000 |
commit | 60a607d33f1c50acd0a4218da32abe35b2941e38 (patch) | |
tree | fa1e5e1785cb04186ed07e04e3e5c1c73bb83c79 /crates/ra_hir/src/nameres | |
parent | c57a8579888643e73e12dd0ca23e81f88608c52f (diff) |
new struct id
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/lower.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_hir/src/nameres/lower.rs b/crates/ra_hir/src/nameres/lower.rs index 1f8adc7eb..b0c4aa819 100644 --- a/crates/ra_hir/src/nameres/lower.rs +++ b/crates/ra_hir/src/nameres/lower.rs | |||
@@ -10,7 +10,7 @@ use rustc_hash::FxHashMap; | |||
10 | use crate::{ | 10 | use crate::{ |
11 | SourceItemId, Path, ModuleSource, HirDatabase, Name, SourceFileItems, | 11 | SourceItemId, Path, ModuleSource, HirDatabase, Name, SourceFileItems, |
12 | HirFileId, MacroCallLoc, AsName, PerNs, DefKind, DefLoc, Function, | 12 | HirFileId, MacroCallLoc, AsName, PerNs, DefKind, DefLoc, Function, |
13 | ModuleDef, Module, | 13 | ModuleDef, Module, Struct, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] | 16 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] |
@@ -147,7 +147,14 @@ impl LoweredModule { | |||
147 | item: &ast::ModuleItem, | 147 | item: &ast::ModuleItem, |
148 | ) { | 148 | ) { |
149 | let name = match item.kind() { | 149 | let name = match item.kind() { |
150 | ast::ModuleItemKind::StructDef(it) => it.name(), | 150 | ast::ModuleItemKind::StructDef(it) => { |
151 | if let Some(name) = it.name() { | ||
152 | let s = Struct::from_ast(db, module, file_id, it); | ||
153 | let s: ModuleDef = s.into(); | ||
154 | self.declarations.insert(name.as_name(), PerNs::both(s, s)); | ||
155 | } | ||
156 | return; | ||
157 | } | ||
151 | ast::ModuleItemKind::EnumDef(it) => it.name(), | 158 | ast::ModuleItemKind::EnumDef(it) => it.name(), |
152 | ast::ModuleItemKind::FnDef(it) => { | 159 | ast::ModuleItemKind::FnDef(it) => { |
153 | if let Some(name) = it.name() { | 160 | if let Some(name) = it.name() { |