mirror of
https://github.com/github/codeql.git
synced 2025-12-18 18:10:39 +01:00
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.
26 lines
1.2 KiB
Plaintext
Generated
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
|