Rust: Adapt QL to AST changes

This commit is contained in:
Simon Friis Vindum
2025-12-17 11:12:16 +01:00
parent dd02ac3964
commit b64809cbd3
3 changed files with 5 additions and 5 deletions

View File

@@ -46,7 +46,7 @@ module Impl {
private predicate isMacroExpansion(AstNode macro, AstNode expansion) {
expansion = macro.(MacroCall).getMacroCallExpansion()
or
expansion = macro.(Adt).getDeriveMacroExpansion(_)
expansion = macro.(TypeItem).getDeriveMacroExpansion(_)
or
expansion = macro.(Item).getAttributeMacroExpansion()
}

View File

@@ -1796,9 +1796,9 @@ private module DollarCrateResolution {
macroDefPath = mc.getPath()
)
or
exists(ItemNode adt |
expansion = adt.(Adt).getDeriveMacroExpansion(_) and
macroDefPath = adt.getAttr("derive").getMeta().getPath()
exists(ItemNode type |
expansion = type.(TypeItem).getDeriveMacroExpansion(_) and
macroDefPath = type.getAttr("derive").getMeta().getPath()
)
}

View File

@@ -5,7 +5,7 @@ query predicate attribute_macros(Item i, int index, Item expanded) {
i.fromSource() and expanded = i.getAttributeMacroExpansion().getItem(index)
}
query predicate derive_macros(Adt i, int index, int subIndex, Item expanded) {
query predicate derive_macros(TypeItem i, int index, int subIndex, Item expanded) {
i.fromSource() and expanded = i.getDeriveMacroExpansion(index).getItem(subIndex)
}