mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Merge pull request #19014 from darichey/fix-cfg-macro
Check cfg when collecting macro defs
This commit is contained in:
commit
a64667f2ab
@ -1381,6 +1381,9 @@ impl ExprCollector<'_> {
|
||||
}
|
||||
}
|
||||
ast::Stmt::Item(ast::Item::MacroDef(macro_)) => {
|
||||
if self.check_cfg(¯o_).is_none() {
|
||||
return;
|
||||
}
|
||||
let Some(name) = macro_.name() else {
|
||||
statements.push(Statement::Item(Item::Other));
|
||||
return;
|
||||
@ -1390,6 +1393,9 @@ impl ExprCollector<'_> {
|
||||
self.collect_macro_def(statements, macro_id);
|
||||
}
|
||||
ast::Stmt::Item(ast::Item::MacroRules(macro_)) => {
|
||||
if self.check_cfg(¯o_).is_none() {
|
||||
return;
|
||||
}
|
||||
let Some(name) = macro_.name() else {
|
||||
statements.push(Statement::Item(Item::Other));
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user