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
Use x, string hasExtendedCanonicalPath, string hasCrateOrigin, int getNumberOfAttrs,
string hasUseTree, string hasVisibility
Use x, string hasExtendedCanonicalPath, string hasCrateOrigin, string hasExpanded,
int getNumberOfAttrs, string hasUseTree, string hasVisibility
where
toBeTested(x) and
not x.isUnknown() and
@@ -14,8 +14,10 @@ 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
getNumberOfAttrs = x.getNumberOfAttrs() and
(if x.hasUseTree() then hasUseTree = "yes" else hasUseTree = "no") and
if x.hasVisibility() then hasVisibility = "yes" else hasVisibility = "no"
select x, "hasExtendedCanonicalPath:", hasExtendedCanonicalPath, "hasCrateOrigin:", hasCrateOrigin,
"getNumberOfAttrs:", getNumberOfAttrs, "hasUseTree:", hasUseTree, "hasVisibility:", hasVisibility
"hasExpanded:", hasExpanded, "getNumberOfAttrs:", getNumberOfAttrs, "hasUseTree:", hasUseTree,
"hasVisibility:", hasVisibility

View File

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