Rust: add canonical_path and crate_origin to Item

This commit is contained in:
Paolo Tranquilli
2024-10-22 15:12:47 +02:00
parent 7338eafbd4
commit 194e0daa8c
82 changed files with 852 additions and 144 deletions

View File

@@ -2,13 +2,18 @@
import codeql.rust.elements
import TestUtils
from ExternBlock x, string hasAbi, int getNumberOfAttrs, string hasExternItemList, string isUnsafe
from
ExternBlock x, string hasCanonicalPath, string hasCrateOrigin, string hasAbi,
int getNumberOfAttrs, string hasExternItemList, string isUnsafe
where
toBeTested(x) and
not x.isUnknown() and
(if x.hasCanonicalPath() then hasCanonicalPath = "yes" else hasCanonicalPath = "no") and
(if x.hasCrateOrigin() then hasCrateOrigin = "yes" else hasCrateOrigin = "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, "hasAbi:", hasAbi, "getNumberOfAttrs:", getNumberOfAttrs, "hasExternItemList:",
hasExternItemList, "isUnsafe:", isUnsafe
select x, "hasCanonicalPath:", hasCanonicalPath, "hasCrateOrigin:", hasCrateOrigin, "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.getCanonicalPath()

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.getCrateOrigin()