Skip to content

Commit

Permalink
Merge #8352
Browse files Browse the repository at this point in the history
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 #8128.

Co-authored-by: Brandon <[email protected]>
  • Loading branch information
bors[bot] and Brandon authored Apr 5, 2021
2 parents 453f236 + 4dbec2d commit 7278108
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions crates/hir_def/src/nameres/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ struct MacroDirective {

#[derive(Clone, Debug, Eq, PartialEq)]
enum MacroDirectiveKind {
FnLike { ast_id: AstIdWithPath<ast::MacroCall>, legacy: Option<MacroCallId> },
FnLike { ast_id: AstIdWithPath<ast::MacroCall> },
Derive { ast_id: AstIdWithPath<ast::Item> },
}

Expand Down Expand Up @@ -806,13 +806,7 @@ impl DefCollector<'_> {
let mut res = ReachedFixedPoint::Yes;
macros.retain(|directive| {
match &directive.kind {
MacroDirectiveKind::FnLike { ast_id, legacy } => {
if let Some(call_id) = legacy {
res = ReachedFixedPoint::No;
resolved.push((directive.module_id, *call_id, directive.depth));
return false;
}

MacroDirectiveKind::FnLike { ast_id } => {
match macro_call_as_call_id(
ast_id,
self.db,
Expand Down Expand Up @@ -1535,7 +1529,7 @@ impl ModCollector<'_, '_> {
self.def_collector.unexpanded_macros.push(MacroDirective {
module_id: self.module_id,
depth: self.macro_depth + 1,
kind: MacroDirectiveKind::FnLike { ast_id, legacy: None },
kind: MacroDirectiveKind::FnLike { ast_id },
});
}

Expand Down

0 comments on commit 7278108

Please sign in to comment.