aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/nameres
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r--crates/ra_hir/src/nameres/lower.rs11
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;
10use crate::{ 10use 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() {