mirror of
https://github.com/github/codeql.git
synced 2026-02-12 05:01:06 +01:00
Rust: Adapt QL to AST changes
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user