diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-05-21 17:29:31 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-05-21 17:29:31 +0100 |
commit | de403b10448e23f232804596538de92fc57203d6 (patch) | |
tree | dcf8ccdfd09d282f14e5e5c24057496caaa3a4ff /crates/hir_def/src/nameres/collector.rs | |
parent | eb08a27f1bd31cc15db4893dded60663effaf3f9 (diff) | |
parent | d00bc9c2fc211650bf3d16b0e77fc7dac20f34c5 (diff) |
Merge #8910
8910: Don't lower extern block in the ItemTree r=jonas-schievink a=jonas-schievink
The ItemTree lowering code used to attach attributes on an `extern {}` block to all the children. This is wrong and causes problems with attribute resolution that manifested as a hang.
This PR treats extern blocks as first-class items in the ItemTree and lowers its contents in the `ModCollector` instead.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8414#issuecomment-845607923
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8905
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8909
bors r+
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir_def/src/nameres/collector.rs')
-rw-r--r-- | crates/hir_def/src/nameres/collector.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index e76d039b8..fa4b135fd 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs | |||
@@ -1243,6 +1243,7 @@ impl ModCollector<'_, '_> { | |||
1243 | status: PartialResolvedImport::Unresolved, | 1243 | status: PartialResolvedImport::Unresolved, |
1244 | }) | 1244 | }) |
1245 | } | 1245 | } |
1246 | ModItem::ExternBlock(block) => self.collect(&self.item_tree[block].children), | ||
1246 | ModItem::MacroCall(mac) => self.collect_macro_call(&self.item_tree[mac]), | 1247 | ModItem::MacroCall(mac) => self.collect_macro_call(&self.item_tree[mac]), |
1247 | ModItem::MacroRules(id) => self.collect_macro_rules(id), | 1248 | ModItem::MacroRules(id) => self.collect_macro_rules(id), |
1248 | ModItem::MacroDef(id) => self.collect_macro_def(id), | 1249 | ModItem::MacroDef(id) => self.collect_macro_def(id), |