Rust: expand attribute macros

This commit is contained in:
Paolo Tranquilli
2025-04-17 18:09:15 +02:00
committed by Paolo Tranquilli
parent 3437210d32
commit 49cf1739a4
66 changed files with 16543 additions and 1354 deletions

View File

@@ -3,8 +3,8 @@ import codeql.rust.elements
import TestUtils
from
ExternBlock x, string hasExtendedCanonicalPath, string hasCrateOrigin, string hasAbi,
int getNumberOfAttrs, string hasExternItemList, string isUnsafe
ExternBlock x, string hasExtendedCanonicalPath, string hasCrateOrigin, string hasExpanded,
string hasAbi, int getNumberOfAttrs, string hasExternItemList, string isUnsafe
where
toBeTested(x) and
not x.isUnknown() and
@@ -14,10 +14,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.hasAbi() then hasAbi = "yes" else hasAbi = "no") and
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasExternItemList() then hasExternItemList = "yes" else hasExternItemList = "no") and
if x.isUnsafe() then isUnsafe = "yes" else isUnsafe = "no"
select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin,
"hasAbi:", hasAbi, "getNumberOfAttrs:", getNumberOfAttrs, "hasExternItemList:", hasExternItemList,
"isUnsafe:", isUnsafe
"hasExpanded:", hasExpanded, "hasAbi:", hasAbi, "getNumberOfAttrs:", getNumberOfAttrs,
"hasExternItemList:", hasExternItemList, "isUnsafe:", isUnsafe

View File

@@ -0,0 +1,7 @@
// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from ExternBlock x
where toBeTested(x) and not x.isUnknown()
select x, x.getExpanded()