diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-04-09 16:16:36 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-04-09 16:16:36 +0100 |
commit | 343b14f7e06f3ec82a15b3648ba229e03e0b0583 (patch) | |
tree | 6ac8072d75595b2a8eae527d8d10b9c8ca5bcb64 /crates/hir_def | |
parent | c08e690c937bc19ab518a4ba4a6178218b20b69a (diff) | |
parent | ec2895e95649ca87bcac54ee635abb8b6f78b086 (diff) |
Merge #8450
8450: Don't ignore unnamed consts when looking for definitions r=Veykril a=Veykril
Fixes #8448
bors r+
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/child_by_source.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/hir_def/src/child_by_source.rs b/crates/hir_def/src/child_by_source.rs index f40a7f80d..f2e809ca9 100644 --- a/crates/hir_def/src/child_by_source.rs +++ b/crates/hir_def/src/child_by_source.rs | |||
@@ -80,6 +80,10 @@ impl ChildBySource for ModuleId { | |||
80 | impl ChildBySource for ItemScope { | 80 | impl ChildBySource for ItemScope { |
81 | fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) { | 81 | fn child_by_source_to(&self, db: &dyn DefDatabase, res: &mut DynMap) { |
82 | self.declarations().for_each(|item| add_module_def(db, res, item)); | 82 | self.declarations().for_each(|item| add_module_def(db, res, item)); |
83 | self.unnamed_consts().for_each(|konst| { | ||
84 | let src = konst.lookup(db).source(db); | ||
85 | res[keys::CONST].insert(src, konst); | ||
86 | }); | ||
83 | self.impls().for_each(|imp| add_impl(db, res, imp)); | 87 | self.impls().for_each(|imp| add_impl(db, res, imp)); |
84 | 88 | ||
85 | fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) { | 89 | fn add_module_def(db: &dyn DefDatabase, map: &mut DynMap, item: ModuleDefId) { |