mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
Rust: separate attribute macro and macro call expansions
This commit is contained in:
@@ -3,9 +3,9 @@ import codeql.rust.elements
|
||||
import TestUtils
|
||||
|
||||
from
|
||||
Struct x, string hasExtendedCanonicalPath, string hasCrateOrigin, string hasExpanded,
|
||||
int getNumberOfAttrs, string hasFieldList, string hasGenericParamList, string hasName,
|
||||
string hasVisibility, string hasWhereClause
|
||||
Struct x, string hasExtendedCanonicalPath, string hasCrateOrigin,
|
||||
string hasAttributeMacroExpansion, int getNumberOfAttrs, string hasFieldList,
|
||||
string hasGenericParamList, string hasName, string hasVisibility, string hasWhereClause
|
||||
where
|
||||
toBeTested(x) and
|
||||
not x.isUnknown() and
|
||||
@@ -15,7 +15,11 @@ where
|
||||
else hasExtendedCanonicalPath = "no"
|
||||
) and
|
||||
(if x.hasCrateOrigin() then hasCrateOrigin = "yes" else hasCrateOrigin = "no") and
|
||||
(if x.hasExpanded() then hasExpanded = "yes" else hasExpanded = "no") and
|
||||
(
|
||||
if x.hasAttributeMacroExpansion()
|
||||
then hasAttributeMacroExpansion = "yes"
|
||||
else hasAttributeMacroExpansion = "no"
|
||||
) and
|
||||
getNumberOfAttrs = x.getNumberOfAttrs() and
|
||||
(if x.hasFieldList() then hasFieldList = "yes" else hasFieldList = "no") and
|
||||
(if x.hasGenericParamList() then hasGenericParamList = "yes" else hasGenericParamList = "no") and
|
||||
@@ -23,6 +27,6 @@ where
|
||||
(if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no") and
|
||||
if x.hasWhereClause() then hasWhereClause = "yes" else hasWhereClause = "no"
|
||||
select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin,
|
||||
"hasExpanded:", hasExpanded, "getNumberOfAttrs:", getNumberOfAttrs, "hasFieldList:", hasFieldList,
|
||||
"hasGenericParamList:", hasGenericParamList, "hasName:", hasName, "hasVisibility:", hasVisibility,
|
||||
"hasWhereClause:", hasWhereClause
|
||||
"hasAttributeMacroExpansion:", hasAttributeMacroExpansion, "getNumberOfAttrs:", getNumberOfAttrs,
|
||||
"hasFieldList:", hasFieldList, "hasGenericParamList:", hasGenericParamList, "hasName:", hasName,
|
||||
"hasVisibility:", hasVisibility, "hasWhereClause:", hasWhereClause
|
||||
|
||||
Reference in New Issue
Block a user