aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_def/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-05 20:00:27 +0100
committerGitHub <[email protected]>2021-04-05 20:00:27 +0100
commit72781085bba92756d11f9fcc3d879b60108d230f (patch)
tree0b7d4debbe2e5fb4603faa452cf05b795f9f20dc /crates/hir_def/src
parent453f2360d311335839744ed538efe21d31dc6bad (diff)
parent4dbec2d5453dacdc699a5801114fcd7a3fbcc635 (diff)
Merge #8352
8352: Remove dead legacy macro expansion code r=lnicola a=brandondong I was investigating some unrelated macro issue when I noticed this dead code. This legacy macro expansion logic was changed in https://github.com/rust-analyzer/rust-analyzer/pull/8128. Co-authored-by: Brandon <[email protected]>
Diffstat (limited to 'crates/hir_def/src')
-rw-r--r--crates/hir_def/src/nameres/collector.rs12
1 files changed, 3 insertions, 9 deletions
diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs
index 4ddc791ce..f42f92702 100644
--- a/crates/hir_def/src/nameres/collector.rs
+++ b/crates/hir_def/src/nameres/collector.rs
@@ -215,7 +215,7 @@ struct MacroDirective {
215 215
216#[derive(Clone, Debug, Eq, PartialEq)] 216#[derive(Clone, Debug, Eq, PartialEq)]
217enum MacroDirectiveKind { 217enum MacroDirectiveKind {
218 FnLike { ast_id: AstIdWithPath<ast::MacroCall>, legacy: Option<MacroCallId> }, 218 FnLike { ast_id: AstIdWithPath<ast::MacroCall> },
219 Derive { ast_id: AstIdWithPath<ast::Item> }, 219 Derive { ast_id: AstIdWithPath<ast::Item> },
220} 220}
221 221
@@ -806,13 +806,7 @@ impl DefCollector<'_> {
806 let mut res = ReachedFixedPoint::Yes; 806 let mut res = ReachedFixedPoint::Yes;
807 macros.retain(|directive| { 807 macros.retain(|directive| {
808 match &directive.kind { 808 match &directive.kind {
809 MacroDirectiveKind::FnLike { ast_id, legacy } => { 809 MacroDirectiveKind::FnLike { ast_id } => {
810 if let Some(call_id) = legacy {
811 res = ReachedFixedPoint::No;
812 resolved.push((directive.module_id, *call_id, directive.depth));
813 return false;
814 }
815
816 match macro_call_as_call_id( 810 match macro_call_as_call_id(
817 ast_id, 811 ast_id,
818 self.db, 812 self.db,
@@ -1535,7 +1529,7 @@ impl ModCollector<'_, '_> {
1535 self.def_collector.unexpanded_macros.push(MacroDirective { 1529 self.def_collector.unexpanded_macros.push(MacroDirective {
1536 module_id: self.module_id, 1530 module_id: self.module_id,
1537 depth: self.macro_depth + 1, 1531 depth: self.macro_depth + 1,
1538 kind: MacroDirectiveKind::FnLike { ast_id, legacy: None }, 1532 kind: MacroDirectiveKind::FnLike { ast_id },
1539 }); 1533 });
1540 } 1534 }
1541 1535