mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Rust: Take derive macros into account in is{In,From}MacroExpansion
This commit is contained in:
@@ -70,9 +70,9 @@ module Impl {
|
||||
*/
|
||||
pragma[nomagic]
|
||||
predicate isFromMacroExpansion() {
|
||||
exists(MacroCall mc |
|
||||
MacroCallImpl::isInMacroExpansion(mc, this) and
|
||||
not this = mc.getATokenTreeNode()
|
||||
exists(AstNode root |
|
||||
MacroCallImpl::isInMacroExpansion(root, this) and
|
||||
not this = root.(MacroCall).getATokenTreeNode()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -14,10 +14,12 @@ module Impl {
|
||||
private import rust
|
||||
|
||||
pragma[nomagic]
|
||||
predicate isInMacroExpansion(MacroCall mc, AstNode n) {
|
||||
n = mc.getMacroCallExpansion()
|
||||
predicate isInMacroExpansion(AstNode root, AstNode n) {
|
||||
n = root.(MacroCall).getMacroCallExpansion()
|
||||
or
|
||||
isInMacroExpansion(mc, n.getParentNode())
|
||||
n = root.(Adt).getDeriveMacroExpansion(_)
|
||||
or
|
||||
isInMacroExpansion(root, n.getParentNode())
|
||||
}
|
||||
|
||||
// the following QLdoc is generated: if you need to edit it, do it in the schema file
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user