Files
codeql/rust/ql/test/extractor-tests/generated/Path/PathSegment.ql
Paolo Tranquilli 689e7b8440 Rust: fix <X as Y> path extraction
This works around a quirk in rust-analyzer's AST generation machinery,
where for an `<X as Y>` path there might be no way to directly get `Y`
from the path segment.
2025-02-24 10:38:15 +01:00

26 lines
1.2 KiB
Plaintext
Generated

// generated by codegen, do not edit
import codeql.rust.elements
import TestUtils
from
PathSegment x, string hasGenericArgList, string hasNameRef, string hasParenthesizedArgList,
string hasRetType, string hasReturnTypeSyntax, string hasTypeRepr, string hasTraitTypeRepr
where
toBeTested(x) and
not x.isUnknown() and
(if x.hasGenericArgList() then hasGenericArgList = "yes" else hasGenericArgList = "no") and
(if x.hasNameRef() then hasNameRef = "yes" else hasNameRef = "no") and
(
if x.hasParenthesizedArgList()
then hasParenthesizedArgList = "yes"
else hasParenthesizedArgList = "no"
) and
(if x.hasRetType() then hasRetType = "yes" else hasRetType = "no") and
(if x.hasReturnTypeSyntax() then hasReturnTypeSyntax = "yes" else hasReturnTypeSyntax = "no") and
(if x.hasTypeRepr() then hasTypeRepr = "yes" else hasTypeRepr = "no") and
if x.hasTraitTypeRepr() then hasTraitTypeRepr = "yes" else hasTraitTypeRepr = "no"
select x, "hasGenericArgList:", hasGenericArgList, "hasNameRef:", hasNameRef,
"hasParenthesizedArgList:", hasParenthesizedArgList, "hasRetType:", hasRetType,
"hasReturnTypeSyntax:", hasReturnTypeSyntax, "hasTypeRepr:", hasTypeRepr, "hasTraitTypeRepr:",
hasTraitTypeRepr