diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-25 16:18:35 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-25 16:18:35 +0100 |
commit | ba7286345256eb1140853dc0daa3c276e2ddcbbe (patch) | |
tree | e5f328bc2e9794cc93413ecba4a121f8f6f020ad /crates/ra_hir_def/src/nameres | |
parent | 96d335d578984b42c2e00c715c924bceca391a6c (diff) | |
parent | dad2f75b91bcc6ac7620326fec082aca7edea7ce (diff) |
Merge #5063
5063: Store field/variant attrs in ItemTree and use it for adt.rs queries r=jonas-schievink a=jonas-schievink
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_def/src/nameres')
-rw-r--r-- | crates/ra_hir_def/src/nameres/collector.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 94da700ad..2ced4f66b 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs | |||
@@ -742,7 +742,7 @@ impl ModCollector<'_, '_> { | |||
742 | // `#[macro_use] extern crate` is hoisted to imports macros before collecting | 742 | // `#[macro_use] extern crate` is hoisted to imports macros before collecting |
743 | // any other items. | 743 | // any other items. |
744 | for item in items { | 744 | for item in items { |
745 | if self.is_cfg_enabled(self.item_tree.attrs(*item)) { | 745 | if self.is_cfg_enabled(self.item_tree.attrs((*item).into())) { |
746 | if let ModItem::ExternCrate(id) = item { | 746 | if let ModItem::ExternCrate(id) = item { |
747 | let import = self.item_tree[*id].clone(); | 747 | let import = self.item_tree[*id].clone(); |
748 | if import.is_macro_use { | 748 | if import.is_macro_use { |
@@ -753,7 +753,7 @@ impl ModCollector<'_, '_> { | |||
753 | } | 753 | } |
754 | 754 | ||
755 | for &item in items { | 755 | for &item in items { |
756 | let attrs = self.item_tree.attrs(item); | 756 | let attrs = self.item_tree.attrs(item.into()); |
757 | if self.is_cfg_enabled(attrs) { | 757 | if self.is_cfg_enabled(attrs) { |
758 | let module = | 758 | let module = |
759 | ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id }; | 759 | ModuleId { krate: self.def_collector.def_map.krate, local_id: self.module_id }; |